A. Technical appendix
A-50
Festo P.BE-SBO-Q-EN en 1602e
! Important !
! Here we don’t receive ASCII text, but, instead we get a binary
data stream.
SocketReceive ComSocket \RawData := dataCollectionRaw;
! Error handling has been omitted here.
! Extract all floating point values from the data container
! Offsets of each data element are determined by CheckOpti.
UnpackRawBytes dataCollectionRaw, 31, float_x, \Float4;
UnpackRawBytes dataCollectionRaw, 35, float_y, \Float4;
UnpackRawBytes dataCollectionRaw, 39, float_angle, \Float4;
TPWrite ”X coordinate = ”, \Num := float_x;
TPWrite ”Y coordinate = ”, \Num := float_y;
TPWrite ”Angle = ”, \Num := float_angle;
ENDPROC
!
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
! Procedure CheckConnectionStatus
! Description:
! Procedure checks that the socket is still connected, if not, then
! it will attempt to re
−
connect. This procedure can be used before
! communications.
! An alternative would be to use error handlers.
!
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
PROC CheckConnectionStatus()
status := SocketGetStatus(ComSocket);
TPWrite ”Connection Status: ”\Num:=status;
IF status <> SOCKET_CONNECTED THEN
TPWrite ”Camera Not Connected, re
−
connecting”;
ConnectToCamera;
ENDIF
ERROR
Stop;
ENDPROC
Summary of Contents for SBO***-Q Series
Page 2: ......
Page 19: ...System overview 1 1 Festo P BE SBO Q EN en 1602e Chapter 1 System overview...
Page 39: ...Mounting 2 1 Festo P BE SBO Q EN en 1602e Chapter 2 Mounting...
Page 47: ...Installation 3 1 Festo P BE SBO Q EN en 1602e Chapter 3 Installation...
Page 62: ...3 Installation 3 16 Festo P BE SBO Q EN en 1602e...
Page 63: ...Commissioning 4 1 Festo P BE SBO Q EN en 1602e Chapter 4 Commissioning...
Page 162: ...4 Commissioning 4 100 Festo P BE SBO Q EN en 1602e Fig 4 34 Structure of an imported data type...
Page 183: ...Technical appendix A 1 Festo P BE SBO Q EN en 1602e Appendix A Technical appendix...
Page 247: ...Index B 1 Festo P BE SBO Q EN en 1602e Appendix B Index...
Page 248: ...B Index B 2 Festo P BE SBO Q EN en 1602e Table of contents B Index B 1...