Switching with preset counter values
To switch the outputs based on preset counter values, the following settings must be made for each output. The following applies: n = 0 for output 1, n = 1 for output 2.
Select process data or suitable Predefined PDO Assignment | "1 Ch. Standard, Output" |
Select reference value of the switching value | Index 0x8001:2n "Threshold base value" = 0: "Counter value (0)", |
Activate automatic switching function | PDO 0x70n1:02 "Control Enable thresholds output" = TRUE As soon as the automatic switching function is enabled, the switching state specified via the PLC variable is ignored. |
Specify number of currently valid threshold values | Up to eight valid threshold values can be specified which are to be processed. PDO 0x70n2:11 "Number of output events" ≥ 1, |
0x70n1:04 "Disable thresholds cw" | 0x70n1:05 "Disable thresholds ccw" | |
---|---|---|
Both (default): | FALSE: | FALSE: |
Only backwards | TRUE: | FALSE: |
Only forwards | FALSE: | TRUE: |
*) |
The following settings are possible per threshold value:
Specify threshold values | Up to eight 32-bit threshold values can be specified. 0x70n4:11 to 0x70n4:18 "Threshold 1" to "Threshold 8" |
Set output state | Per threshold value the state of the output can be freely defined (TRUE or FALSE). PDO 0x70n3:01 "Output state 1" to 0x70n3:08 "Output state 8" |
To switch the output for a defined time (time cam) a switching duration in µs can be specified for each of the eight threshold values if required. If the switching duration has not yet expired before the next threshold value is reached, the time restarts with the next threshold value. The maximum value is 24,000 µs. If no switching duration is defined (Duration n = 0), the current status of the output remains active until the next threshold value is reached (position cam). PDO 0x70n5:11 "Duration 1" to 0x70n5:18 "Duration 8 |
Status of the output
The current output status is reported back via the PDOs 0x60n3:01 "Status of digital output" and 0x60n3:02 "Status of tristate".
Note that the process data is updated with the EtherCAT cycle time, but the switching of the output by means of the switching function is asynchronous.
Example of a position cam with different counting directions
The following graphic shows the switching behavior of the output with a position cam, realized by two thresholds, depending on the active counting directions with the following settings for output 1.
Index | Value | Meaning |
---|---|---|
0x8001:20 | 0 | Switching function with preset counter values active |
0x7001:02 | TRUE | Automatic switching function active |
0x7002:11 | 2 | The first two threshold values (Threshold 1 a. 2) are active |
0x7003:01 | TRUE | Status of the output for the first threshold (Threshold 1) is TRUE |
0x7003:02 | FALSE | Status of the output for the second threshold (Threshold 2) is FALSE |
0x7001:04 | FALSE | Switching function in forward direction (cw) active (see following Fig. A and C) |
TRUE | Switching function in forward direction (cw) not active (see following Fig. B) | |
0x7001:05 | FALSE | Switching function in backward direction (ccw) active (see following Fig. A and B) |
TRUE | Switching function in backward direction (ccw) not active (see following Fig. C) |
Example for position cams synchronous to a linear movement
To switch the output synchronously to a linear movement, the switching position (Threshold) must be defined as a switching cam depending on the counter value.
Three examples are shown in the following figure. For all positions within the gray highlighted areas the status of the output is TRUE.
- (A) A position cam is only valid in forward motion
- (B) A position cam is only valid in backward motion
- (C) Three position cams are each valid for both directions of movement
"Cam switch" | "Number of output events" | "Threshold" | "Output state" | "Duration" | "Direction" |
---|---|---|---|---|---|
(A) | 2 | "Threshold 1" = A1 | "Output state 1" = TRUE | "Duration 1" = 0 | "Disable thresholds cw" = FALSE "Disable thresholds ccw" = TRUE |
(B) | 2 | "Threshold 1" = B1 | "Output state 1" = TRUE | "Duration 1" = 0 | "Disable thresholds cw" = TRUE "Disable thresholds ccw" = FALSE |
(C) | 6 | "Threshold 1" = C1 "Threshold 3" = C3 "Threshold 5" = C5 | "Output state 1" = TRUE "Output state 3" = TRUE "Output state 5" = TRUE | "Duration 1" = 0 "Duration 3" = 0 "Duration 5" = 0 | "Disable thresholds cw" = FALSE "Disable thresholds ccw" = FALSE |
Example for three time cams
The following graphic shows the switching behavior of the output with three active time cams. Three threshold values "Threshold 1" ... "Threshold 3" are active for defined switching times "Duration1" ... "Duration 3" with the following settings for output 1.
Index | Value | Meaning |
---|---|---|
0x8001:20 | 0 | Switching function with preset counter values active |
0x7001:02 | TRUE | Automatic switching function active |
0x7002:11 | 3 | The first two threshold values (Threshold 1, 2 and 3) are active |
0x7003:01 | TRUE | Status of the output for the first threshold (Threshold 1) is TRUE |
0x7003:02 | TRUE | Status of the output for the second threshold (Threshold 2) is TRUE |
0x7003:03 | TRUE | Status of the output for the third threshold (Threshold 3) is TRUE |
0x7001:04 | FALSE | Switching function in forward direction (cw) active |
0x7001:05 | FALSE | Switching function in reverse direction (ccw) active |