MsgTcp
Purpose:
-
Provide TCP communications functions for instruments that require asynchronous send/receive and support for framing.
Enter:
-
MsgTcp <i=instrument_name> <h=host_name> <p=port> <v=verbose_file> <sof=start_of_frame> <eof=end_of_frame> <isof=end_of_frame> <ieof=end_of_frame> <osof=end_of_frame> <oeof=end_of_frame> <f=frame_type> <t=disabledelay> <sync=ON|OFF>
Where:
-
i
Required. Specify the MSG instrument name.
h
Required. Specify the instrument hostname.
p
Required. Specify the instrument host port to be used.
v
Required. Specify to pipe the output to stdout or specify a report filename.
sof
Optional. Specify a start of frame decimal value or ASCII value. The default is decimal 2.
eof
Optional. Specify an end of frame decimal value or ASCII value. The default is decimal 3.
isof
Optional. Specify a start of Input frame decimal value or ASCII value. The default is to use the sof value.
ieof
Optional. Specify an end of Input frame decimal value or ASCII value. The default is to use the eof value.
osof
Optional. Specify a start of Output frame decimal value or ASCII value. The default is to use the sof value.
oeof
Optional. Specify an end of Output frame decimal value or ASCII value. The default is to use the eof value.
f
Optional. Specify a framing args format
c => one decimal char (default)
a => ascii (including \\n, \\r).t
Optional. Specify to disable delay between tx frames to improve performance. The default is OFF.
sync
Optional. Specify ON or OFF:
- Specify ON to enable synchronous command response mode.
- Specify OFF to enable asynchronous response mode.
The default is OFF.
Example:
-
MsgTcp i=CTC_MEXA h=10.0.0.1 p=7700 sof="0" eof="\r\n" f=a v=NONE MSG instrument name, i = CTC_MEXA Host name or IP of instrument, h = 10.0.0.1 Port number of instrument host, p = 7700 Start of frame, sof = "0" End of frame, eof = "\r\n" Start of Input frame, isof = "0" (default, uses sof) End of Input frame, ieof = "\r\n" Start of Output frame, osof = "0" (default, uses sof) End of Output frame, oeof = "\r\n" Frame type, f = a (for ascii) Location/name of report file, v = NONE (no report file) Disable delay, t = OFF Sync, sync = OFF (default)
Notes:
Unless the message Input and Output are different, use the default of sof and eof. Decimal use byte location of the frame. Ascii can accept either numeric values or special characters line “\r\n” as in the example above.