A. Technical appendix
A-51
Festo P.BE-SBO-Q-EN en 1602e
!
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
! Procedure ConnectToCamera
! Description:
! This procedure establishes an initial connection with a Camera
! Telnet Server.
! Telnet servers may perform option negotiation initially with the
! client
! this must be detected and a response given before the session is
! opened.
! This procedure can be used in other procedures’ error handlers.
!
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
PROC ConnectToCamera()
VAR num retry_no := 0;
! If the socket was already open, close it.
SocketClose ComSocket;
SocketCreate ComSocket;
SocketConnect ComSocket, CameraIPAddress, CameraTelnetPortNo;
! Receive first bytes after establishing a connection
SocketReceive ComSocket \Str := stReceived;
TPWrite ”Connection Established. Received: ” + stReceived;
! Check for Telnet negotiation, ”Interpret As Command”, IAC = 0xFF
! in the first byte of the first data received after a connection is
! made.
IF StrPart(stReceived, 1, 1) = ”\ff” THEN
! Send Telnet: IAC WILL BINARY = 0xFF, 0xFB, 0x00, which is
!normal for modern Telnet servers and clients.
SocketSend ComSocket \Str:=”\ff\fb\00”;
! After negotiation, Telnet servers send Server information
! strings and often login prompts if authentication is required.
SocketReceive ComSocket \Str := stReceived;
TPWrite ”Negotiation complete. Received: ” + stReceived;
ENDIF
! Test authentication settings for this camera
IF stReceived <> ”20 SBOx
−
Q
−
ZEWAS: no authentication requi-
red.\0D\0A” THEN
TPWrite ”Not a Camera response! Check CheckKon settings!”;
Stop;
ENDIF
! Error handler if the Socket times out or is closed by the server
ERROR
IF ERRNO = ERR_SOCK_TIMEOUT THEN
! Retry the above Socket call that timed out
IF retry_no < 3 THEN
TPWrite ”Connection timeout. Retry = ”\Num:=retry_no;
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...