MODBUS Communications Driver - Functions
SendText: Send Text to Port
String to Send
short status = MB SendText(const char *txt);
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.
if (MessageBox(NULL, "Dial phone?", "Send Text test", MB_YESNO) == IDYES) MB_SendText("AT D 1 800 555 1212\r\n");
June 6, 1998