ABB IRC5 Applications Manual page 34

Hide thumbs Also See for IRC5:
Table of Contents

Advertisement

5 RAPID reference information
5.1.1 SiConnect - Sensor Interface Connect
Continued
When calling routine RRI_Open, first a connection to the device with name
AnyDevice is opened. Then, cyclic transmission is started at rate SampleRate.
Example 2
Establish a connection to the device called AnyDevice with the optional argument
\NoStop preventing the system to stop if the connection to AnyDevice is broken.
Handle error states in the TRAP routine.
Error handling
If UDP is used as communication protocol no guarantees are given regarding the
success of the connect operation and therefore no error handling is possible at
the connect moment.
If TCP is used as communication protocol the system variable ERRNO is set to
ERR_COMM_INIT if the connect operation fails. This error can then be handled in
an error handler.
The switch \NoStop makes it possible to handle communication errors detected
after a successful connect. \NoStop means that movements and execution of
RAPID continues and that a TRAP routine can be used to handle specific errors
using IError or specific state changes using IPers.
NOTE: IPers and IError are not safe interrupts, so if an error is detected after
a stop, no TRAP will be executed. A way to handle this problem is to have a
SiConnect \NoStop in the restart shelf, to be sure that the application tries to
reestablish the connection to the client.
Continues on next page
34
PERS sensdata DataIn :=
["No",[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];
VAR num SampleRate:=64;
...
! Setup Interface Procedure
PROC RRI_Open()
SiConnect AnyDevice;
! Send and receive data cyclic with 64 ms rate
SiGetCyclic AnyDevice, DataIn, SampleRate;
SiSetCyclic AnyDevice, DataOut, SampleRate;
ENDPROC
PERS sensor AnyDevice;
...
SiConnect AnyDevice \NoStop;
! Send and receive data cyclic with 64 ms rate
SiGetCyclic AnyDevice, DataIn, SampleRate;
SiSetCyclic AnyDevice, DataOut, SampleRate;
...
TRAP sensorChange
IF AnyDevice.state = STATE_ERROR THEN
...
ENDIF
ENDTRAP
© Copyright 2008-2009,2013 ABB. All rights reserved.
3HAC031973-001 Revision: F

Advertisement

Table of Contents
loading

Table of Contents