EC_Err:=(_EC_ErrSta <> WORD#16#00);
R_TRIG_instance(Clk:=EC_Err, Q=>EC_Err_Trigger);
IF ( (EC_Err_Trigger=TRUE) AND (DoEC_PktSave=FALSE) AND (_EC_PktMonStop=FALSE)
AND (_EC_PktSaving=FALSE) AND (_Card1Ready=TRUE) ) THEN
DoEC_PktSave:=TRUE;
Stage :=INT#1;
EC_StopMon_instance(Execute:=FALSE);
EC_SaveMon_instance(Execute:=FALSE);
EC_CopyMon_instance(Execute:=FALSE);
EC_StartMon_instance(Execute:=FALSE);
END_IF;
IF (DoEC_PktSave=TRUE) THEN
CASE Stage OF
1 :
EC_StopMon_instance(
Execute :=
TRUE);
IF (EC_StopMon_instance.Done=TRUE) THEN
Stage:=INT#2;
ELSIF (EC_StopMon_instance.Error=TRUE) THEN
Stage:=INT#10;
END_IF;
2 :
EC_SaveMon_instance(
Execute :=
TRUE);
IF (EC_SaveMon_instance.Done=TRUE) THEN
Stage:=INT#3;
ELSIF (EC_SaveMon_instance.Error=TRUE) THEN
Stage:=INT#20;
END_IF;
3 :
EC_CopyMon_instance(
Execute :=
TRUE,
FileName:=’PacketFile’);
IF (EC_CopyMon_instance.Done=TRUE) THEN
Stage:=INT#4;
ELSIF (EC_CopyMon_instance.Error=TRUE) THEN
Stage:=INT#30;
END_IF;
// Start sequence when
_EC_ErrSta
changes to TRUE.
// Instruction execution
// Stop EtherCAT packet monitor.
// Save EtherCAT packet data to file in system.
// Copy EtherCAT packet data file to the SD Memory Card.
// Normal end
// Error end
// Normal end
// Error end
// Normal end
// Error end
// Initialize instance.
4 :
EC_StartMon_instance(
Execute :=
TRUE);
IF (EC_StartMon_instance.Done=TRUE) THEN
Stage:=INT#0;
ELSIF (EC_StartMon_instance.Error=TRUE) THEN
Stage:=INT#40;
END_IF;
0 :
DoEC_PktSave:=FALSE;
ELSE
DoEC_PktSave:=FALSE;
END_CASE;
END_IF:
// Processing after normal end
// Processing after error end
// Restart EtherCAT packet monitoring.
// Normal end
// Error end
Appendices
A-14
NJ/NX-series CPU Unit Built-in EtherCAT Port User's Manual (W505)
Summary of Contents for NJ101-10 Series
Page 10: ...Manual Structure 8 NJ NX series CPU Unit Built in EtherCAT Port User s Manual W505...
Page 80: ...3 EtherCAT Communications 3 12 NJ NX series CPU Unit Built in EtherCAT Port User s Manual W505...
Page 236: ...9 Troubleshooting 9 38 NJ NX series CPU Unit Built in EtherCAT Port User s Manual W505...
Page 274: ...Appendices A 38 NJ NX series CPU Unit Built in EtherCAT Port User s Manual W505...
Page 275: ...I Index I 1 NJ NX series CPU Unit Built in EtherCAT Port User s Manual W505 I...
Page 279: ......