Difference between revisions of "Digital Inputs / Outputs"

From Wiki
Line 11: Line 11:
 
<span style="color:#008000">Each robot control is shipped with and configured for a single Digital IO module. So if you have only one Digital IO module, skip this section. </span>
 
<span style="color:#008000">Each robot control is shipped with and configured for a single Digital IO module. So if you have only one Digital IO module, skip this section. </span>
  
If you want to add an additional module, please add a line in the project file, e.g. <code>C:\CPRog\Data\Project\51_IGUS_arm5DOF_SV.prj</code>:
+
If you want to add an additional module, please add a line in the project file for your robot, e.g. <code>C:\CPRog\Data\Project\51_IGUS_arm5DOF_SV.prj</code>:
 
<code>
 
<code>
 
  <DIOModule ID="112"/>
 
  <DIOModule ID="112"/>

Revision as of 00:48, 12 May 2018

Digital IO connection

The CPR robolink control comes with a digital input / output module. This page shows how to connect actuators, valves or sensors to the module.

The Digital IO module provides 7 digital inputs and 7 digital outputs. The inputs are electrically decoupled from the control electronics by an optocoupler and accept 24V input signals. The outputs are reed relays which can drive up to 500 mA per channel.

Indicators: When the state of a sensor input or and output changes the orange LED on the top is blinking once.

CPRog project configuration

Each robot control is shipped with and configured for a single Digital IO module. So if you have only one Digital IO module, skip this section.

If you want to add an additional module, please add a line in the project file for your robot, e.g. C:\CPRog\Data\Project\51_IGUS_arm5DOF_SV.prj:

<DIOModule ID="112"/>
<DIOModule ID="128"/>

The first line shows the existing entry for the first Digital IO module (CAN ID 112 = 0x70). The ID switch at the top of this physical module is set to 1.

The second line adds a Digital IO module with CAN ID 128 = 0x80. The ID switch on the physical module has to be set to 2 to match this ID.

Nomenclature

To control the IOs in Software, all CPR robots provide digital inputs and outputs are named channels 1 through 4. In software they are addressed with Ch: 1, Ch: 2, Ch: 3, and Ch: 4.

This should get clearer as you read the "How to use the inputs" and "How to use the outputs" paragraphs.

In contrast, the igus robolink arms use the following nomenclature:

  • For the first DIO-Modul: Channels 21 through 27, i.e. Ch: 21, Ch: 22,...
  • For the second DIO-Modul: Channels 31 through 37
  • For the third DIO-Modul: Channels 41 through 47

The maximum amount of DIO modules installed in the control electronics is currently 3.

Attention: The DIO are also used by the PLC Interface (if active), refer to this.

How to use the outputs

File:CPRog DInTestProgram.PNG
Digital IO communication

The output signals can be switched on or off with the 'Digital Out' command in CPRog (see screenshot on the right).

  • The 'Local' parameter has to be 'true' to use the physical outputs. If it is 'false' the virtual global outputs are used.
  • The 'Ch' channel parameter defines the output channel, see the naming conventions above
  • The 'State' parameter tells CPRog to switch the output on 'true' or off 'false'

Please be aware that the outputs can only be switched on when the robot is enabled!

Attention: The outputs must not drive more then 500 mA, also not at startup! Avoid higher currents e.g. due to capaciators! Use a secondary relay in this this case.

How to use the inputs

The digital inputs can be used e.g. in if-then-else statements. The local and channel parameters are used as above.

The program on the right shows a simple test. The first input of DIO module 1 is checked in a loop. If it is true than the first output is set.



Example

The picture on the right shows an output example: The first pin ( upper left line ) accepts the power supply for all outputs. The other seven lines are the outputs of the reed relays. This means, the relay connects, when switched on, the supply pin (first pin) with the according output pin.

For inputs its the same: the first pin is the ground pin, to be connected with the sensor ground. The sensor signal is connected with one of the seven input pins.