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"
"1 Ch. Standard, extended DC mode, 64 Bit time stamp, Output"
"1 Ch. Standard, Period mode, Output"
"1 Ch. Standard, Frequency mode, 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.
Notice If the switching function is enabled at standstill, the output is set according to the last known state. If there is no state message, the output state = FALSE

Specify number of currently valid threshold values

Up to eight valid threshold values can be specified which are to be processed.
If n threshold values are specified, the threshold values Threshold 1 ... Threshold n are always active. A specific selection, e.g. of the threshold values Threshold 3 and Threshold 4, is therefore not possible.
The value should be at least "1" so that the first threshold value is enabled.

PDO 0x70n2:11 "Number of output events" ≥ 1,

specify active counting direction

0x70n1:04 "Disable thresholds cw"

0x70n1:05 "Disable thresholds ccw"

Both (default):

FALSE:
Output is switched in positive direction of rotation according to the specifications for "Threshold 1" ... 8.*)

FALSE:
Output is switched in negative direction of rotation according to the specifications for "Threshold 1" ... 8.*)

Only backwards

TRUE:
When enabled in positive direction of travel, the output is set to FALSE regardless of the current state.
When enabled at standstill, the output is set according to the last known direction of rotation.

FALSE:
Output is switched in negative direction of rotation according to the specifications for "Threshold 1" ... 8.*)

Only forwards

FALSE:
Output is switched in positive direction of rotation according to the specifications for "Threshold 1" ... 8.*)

TRUE:
When enabled in negative direction of travel, the output is set to FALSE regardless of the current state.
When enabled at standstill, the output is set according to the last known direction of rotation

*)Notice The output is switched when the counter value is reached by a counter pulse. If the counter value is set to a preset counter value at runtime, the output does not switch.

The following settings are possible per threshold value:

Specify threshold values

Up to eight 32-bit threshold values can be specified.
Notice 0 is a valid value, i.e. the output is switched at zero crossing if the threshold value is valid according to the setting in "Number of output events".

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"

Specify switching duration

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
"Threshold base value"

0

Switching function with preset counter values active

0x7001:02
"Control_Enable thresholds output"

TRUE

Automatic switching function active

0x7002:11
"Number of output events"

2

The first two threshold values (Threshold 1 a. 2) are active

0x7003:01
"Output state 1"

TRUE

Status of the output for the first threshold (Threshold 1) is TRUE

0x7003:02
"Output state 2"

FALSE

Status of the output for the second threshold (Threshold 2) is FALSE

0x7001:04
"Control_Disable thresholds cw"

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
"Control_Disable thresholds ccw"

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)

Switching with preset counter values 1:
A) active in both counting directions, B) active in backward direction only, C) active in forward direction only

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.

Switching with preset counter values 2:
(A): Position cam forward only, (B): Position cam only backward, (C): 3 position cams for both directions

"Cam switch"

"Number of output events"
(0x7001:11)

"Threshold"
(0x70n4:01) …(0x70n4:16)

"Output state"
(0x70n3:01) …(0x70n3:06)

"Duration"
(0x70n5:11) ...(0x70n5:16)

"Direction"
(0x70n1:04)
(0x70n1:05)

(A)

2

"Threshold 1" = A1
"Threshold 2" = A2

"Output state 1" = TRUE
"Output state 2" = FALSE

"Duration 1" = 0
"Duration 2" = 0

"Disable thresholds cw" = FALSE

"Disable thresholds ccw" = TRUE

(B)

2

"Threshold 1" = B1
"Threshold 2" = B2

"Output state 1" = TRUE
"Output state 2" = FALSE

"Duration 1" = 0
"Duration 2" = 0

"Disable thresholds cw" = TRUE

"Disable thresholds ccw" = FALSE

(C)

6

"Threshold 1" = C1
"Threshold 2" = C2

"Threshold 3" = C3
"Threshold 4" = C4

"Threshold 5" = C5
"Threshold 6" = C6

"Output state 1" = TRUE
"Output state 2" = FALSE

"Output state 3" = TRUE
"Output state 4" = FALSE

"Output state 5" = TRUE
"Output state 6" = FALSE

"Duration 1" = 0
"Duration 2" = 0

"Duration 3" = 0
"Duration 4" = 0

"Duration 5" = 0
"Duration 6" = 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
"Threshold base value"

0

Switching function with preset counter values active

0x7001:02
"Control_Enable thresholds output"

TRUE

Automatic switching function active

0x7002:11
"Number of output events"

3

The first two threshold values (Threshold 1, 2 and 3) are active

0x7003:01
"Output state 1"

TRUE

Status of the output for the first threshold (Threshold 1) is TRUE

0x7003:02
"Output state 2"

TRUE

Status of the output for the second threshold (Threshold 2) is TRUE

0x7003:03
"Output state 3"

TRUE

Status of the output for the third threshold (Threshold 3) is TRUE

0x7001:04
"Control_Disable thresholds cw"

FALSE

Switching function in forward direction (cw) active

0x7001:05
"Control_Disable thresholds ccw"

FALSE

Switching function in reverse direction (ccw) active

Switching with preset counter values 3:
Switch output for defined times (duration)