-
Notifications
You must be signed in to change notification settings - Fork 2
_secs_open
#secs_open
###Open a SECS II connection.
Syntax
socket = secs_open ( target,modifier[ ,T1/T5[ ,T2/T6[ ,T5/T7[ ,RTY/T8 ] ] ] ] ) ;
Arguments
- str target
The target for the SECS II connection. There are 3 types of connections. HSMS over TCP/IP: the target will be a DNS host name/an IP address. SECS I over TCP/IP: the target will be a DNS host name/an IP address. SECS I over Serial: the target will be a str value, like "com1:" or "/dev/ttyS0"
- list modifier
This is the baud rate if the connection is SECS I over a serial connection (300, 1200, 2400, 4800, 9600, 19200, etc).
This is the port number for TCP/IP connections.
The TCP/IP connection will be HSMS if the modifier is >= MHP or will be SECS I if the modifier is < MHP.
- list T1/T5(optional)
For SECS I, this is T1, the inter-character timeout. For HSMS, this is T5.
- list T2/T6(optional)
For SECS I, this is T2, the ENQ / EOT timeout. For HSMS, this is T6.
- list T5/T7(optional)
For SECS I, this is T4, the inter-block timeout. For HSMS, this is T7
- list RTY/T8(optional)
For SECS I, this is T1, the retry value.. For HSMS, this is T8.
Return Value
handle socket
- socketHandle : The socket handle for the open connection.
The STATUS variable is set to $ACKNOWLEDGE
- -1 : One of the arguments was out of boumds.
The STATUS variable is set to %BOUNDS
- -1 : Failed to open SECS port. (for serial connections).
The STATUS variable is set to %SECS
- -1 : Failed to connect to hsms service at node 'x' on port 'y' (for HSMS connections).
The STATUS variable is set to %SECS
- -1 : Failed to connect to terminal server at node 'x' on port y" (for SECS I connections over TCP/IP)
The STATUS variable is set to %SECS
- -1 : 'target' is not a tty device (for serial connections)
The STATUS variable is set to %IO
Warnings
- %BOUNDS : One of the arguments was out of boumds.
- %SECS : Failed to open SECS port. (for serial connections).
- %SECS : Failed to connect to hsms service at node 'x' on port 'y' (for HSMS connections).
- %SECS : Failed to connect to terminal server at node 'x' on port y" (for SECS I connections over TCP/IP)
- %IO : 'target' is not a tty device (for serial connections)
Exceptions
- %ARGUMENT: Invalid arguments. Usage: socket = secs_open ( target,modifier[ ,T1/T5[ ,T2/T6[ ,T5/T7[ ,RTY/T8 ] ] ] ] ) ;
Description
- None
Examples
puts "Create an example for the function 'secs_open'" ;
Related Links