VAR nSlaveState:ETC_SLAVE_STATE;pSlave:POINTER TO ETCSlave; END_VAR(* 示例1 :检查单个从站状态 *) InoSV630N(xSetOperational:= TRUE, wState=> nSlaveState);(* 示例2 :检查所有从站的链表 *) pSlave:=EtherCAT.FirstSlave; WHILE pSlave<>0 DOpSlave^();IF pSlave^.wState<>0 THENnSlaveState:=pSlave^.wState;END_IF//用户添加其他代码pSlave:=pSlave^.NextInstance; END_WHILE