High Speed Pulse Compare Function EtherCAT Programming Guide
27-12 March, 2017
27
27.9 _ECAT_Compare_Channel0_Position
Syntax
U16 PASCAL _ECAT_Compare_Channel0_Position(U16 CardNo, I32 Start, U16 Dir, U16
Interval, U32 TriggerCount);
Purpose
Set the parameters for triggering the signal at a fixed pulse interval of channel 0.
Note:
1. For the trigger retaining time, please refer to description of API
“_ECAT_Compare_Set_Channel_Trigger_Time”.
2. Output signal of channel 0 is triggered via PIN11 and PIN12 of CN2 and CN9 connector on motion card
PCI-L221-B1. These two sets of points will both be triggered when pulses are matched
.
Parameter
Name Data type Property Description
CardNo U16 Number Card No.
Start I32 Pulse Start position of the compare.
Dir U16 Option
Direction
0: forward
1: backward
Interval U16 Pulse number Pulse interval for carrying out the compare.
Trigger_cnt U32 Amount Triggering count of the compare function.
Example
U16 CardNo = 0;
I32 start = 100000;
U16 dir = 0;
U16 Interval = 10; //10 pulse
U32 trigger_cnt = 50000;
U16 status=_ECAT_Compare_Channel0_Position(CardNo, start, dir, interval, trigger_cnt);
/* The motion card starts comparing pulses from position 100000 and channel 0 will be triggered
once every 10 pulses with total trigger count 50000. */
/* That is, when it is at position 100010, 100020, 100030, …, 600000 (pulse), channel 0 will be
triggered once.*/
Description
The motion card starts comparing pulses from the start position and trigger a differential signal
based on the set pulse interval (every time a given pulse number is reached). Meanwhile, the
motion card carries on comparing the pulses for the next fixed interval to trigger the differential
signal of channel 0. Then, it stops comparing pulses when the total trigger count is reached.