X hits on this document

115 views

0 shares

0 downloads

0 comments

34 / 37

MODBUS Communications Driver - Functions

SendText: Send Text to Port

SYNOPSIS

status

Error Return

Integer

txt

String to Send

String

short status = MB SendText(const char *txt);

_

DESCRIPTION

Sends an arbitrary text string to the serial port at the current baud rate. Strings are always sent with one stop bit and no parity.

You may wish to use this command to send dialing strings to a modem. Any reply sent by the destination device will be lost. Status will return a nonzero value if the string could not be transmitted for some reason.

Note. Your code must wait long enough for the string to be transmitted before issuing a MODBUS command that uses the serial port. The MODBUS Driver DLL purges the serial port’s transmission buffer before transmitting each command, so your string’s transmission could be interrupted if you don’t include a delay.

EXAMPLE

if (MessageBox(NULL, "Dial phone?", "Send Text test", MB_YESNO) == IDYES) MB_SendText("AT D 1 800 555 1212\r\n");

Page 26

June 6, 1998

Revision 2.210

Document info
Document views115
Page views117
Page last viewedTue Jan 17 20:09:16 UTC 2017
Pages37
Paragraphs781
Words6172

Comments