6 Process Data Communications and SDO Communications
6-8
NJ/NX-series CPU Unit Built-in EtherCAT Port User’s Manual (W505)
With this sample program, validity of the process data is checked individually for each slave, and the
data inputs and outputs with the salve are controlled.
The slave with which the process data is input and output is given the node address 1 and named
“slave 1”.
The _EC_PDSlavTbl (Process Data Communicating Slave Table) system-defined variable is used to
see if the process data inputs and outputs are valid for the slave 1.
If the process data inputs and outputs with the slave 1 are valid, E001_Out_Bit07 changes to TRUE
when E001_In_Bit00 changes to TRUE. Also, when the process data outputs with the slave 1 are
valid, E001_Out_Bit00 changes to TRUE.
LD
ST
IF _EC_PDSlavTbl[1]=TRUE AND _EC_CommErrTbl[1]=FALSE AND
_EC_SlavErrTbl[1]=WORD#16#0 THEN
A:=TRUE;
ELSE
A:=FALSE;
END_IF;
(* Output valid condition *)
IF A=TRUE THEN
Slav_Out:=TRUE;
ELSE
Slav_Out:=FALSE;
END_IF;
Sample Programming to Check the Validity of the Process Data for
Each Slave
_EC_PDSlavTbl[1]
_EC_CommErrTbl[1]
_EC_SlavErrTbl[1]
WORD#16#0000
Slave_1_outputs_valid
_EC_InDataInvalid
Slave 1 inputs
Slave 1 outputs
EQ
EN
In1
In2
Slave_1_inputs_valid
Slave_1_outputs_valid
E001_Out_Bit00
Slave_1_inputs_valid
E001_In_Bit00
E001_Out_Bit07