EtherCAT Programming Guide High Speed Pulse Compare Function
March, 2017 27-21
27
27.16 _ECAT_Compare_Set_Channel1_Position_Table_Level
Syntax
U16 PASCAL _ECAT_Compare_Set_Channel1_Position_Table_Level (U16 CardNo,
I32* pos_table, U32* level_table, U32 table_size)
Purpose
Set the pulse data of channel 1 and its user-defined active level for triggering signals. The max.
data entry is 100000.
Note:
1. For the trigger retaining time, please refer to description of API
“_ECAT_Compare_Set_Channel_Trigger_Time”.
2. Output signal of channel 1 is triggered via PIN13 and PIN14 of CN2 or CN11 connector on motion card
PCI-L221-B1. These two signals will both be triggered when pulses are matched.
Parameter
Name Data type Property Description
CardNo U16 Number Card No.
Pos_table I32*
Data array
The position for comparing pulses at user-defined
intervals.
Level_table U32*
Data array
The active level for triggering signals;
Translate the trigger state at the 32 positions into a 32-bit
value.
Table_size U32
Number
Data size to be compared, which value has to be identical
to the array size of Pos_table. The max. is 100000.
Example
U16 CardNo = 0;
I32 pos_table[16] ={1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000, 11000,
12000, 13000, 14000, 15000, 16000};
U32 level_table[16] ={0x1111,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
// Hexadecimal value, 0x00001111 = Binary array, [0000 0000 0000 0000 0001 0001 0001 0001]
B
// Refer to the pulse array with the setting of pos_table, a signal will be triggered at 1000, 5000,
9000, and 13000 (pulse).
U32 table_size =16;
U16 status =_ECAT_Compare_Set_Channel1_Position_Table_Level (CardNo, pos_table,
level_table,table_size);