Skip to content

_secs_open

bergsma edited this page Sep 26, 2014 · 5 revisions

#secs_open

###Open a SECS II connection.

Syntax

socket = secs_open ( target,modifier[ ,T1/T5[ ,T2/T6[ ,T5/T7[ ,RTY/T8 ] ] ] ] ) ;

Arguments

  1. 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"

  1. 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.

  1. list T1/T5(optional)

For SECS I, this is T1, the inter-character timeout. For HSMS, this is T5.

  1. list T2/T6(optional)

For SECS I, this is T2, the ENQ / EOT timeout. For HSMS, this is T6.

  1. list T5/T7(optional)

For SECS I, this is T4, the inter-block timeout. For HSMS, this is T7

  1. 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

secs_close
secs_mhp

Clone this wiki locally