RS232

Syntax

Example

Description/Remarks

RS232 port_number

RS232 4

returns the first value found in COM port 4.

This command reads the first ASCII string found in the COM port buffer. If the COM port buffer is empty, this command waits until a string is present in the COM port buffer. This command then places that string into the GainSeeker text buffer for further processing.

The return value is the first number in the ASCII string.

The port_number must be between 1 and 12. An invalid port defaults to COM port 1. If you need to read from COM port 0, use the RS0 command.

It is possible to use the RS232 command to design two templates that access the same COM port on one workstation and can be open and running at the same time.

See also: RSCHK, FLUSH

RS232 port_number, "text_output"

RS232 2, "/13"

writes the string /13 to COM port 2.

Writes a string to the COM port. Does not return a value.

If you need to write to COM port 0, use the RS0 command.

See also: RSCHK, FLUSH

Note: In some Citrix implementations when a template is configured to send a text string to a device via the COM port and then to read a value from the COM port, GainSeeker may generate a run-time error -2147417848 (80010108) "The object has disconnected from its clients". In this case, using a footswitch to trigger a reading from the device may resolve the issue by eliminating the need for two-way serial communication under Citrix.

Note: If a data entry operator presses CTRL+K during data entry to bypass the RS-232 device and enter data values via keyboard, the data entry session will replace any RS232 input mode cells with Keyboard input mode cells. However, the data entry session will still try to execute all commands in the template—including the RS232 command—and the operator may not be able to complete data entry without access to the RS-232 device. If this will cause significant problems during data entry, you may need to use only RS232 input mode cells (and avoid using the RS232 command) or create a second template for keyboard data entry that can be used when the RS-232 device is not available.