05.05.2014 Views

csmstr - Omega Engineering

csmstr - Omega Engineering

csmstr - Omega Engineering

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

USING RAW PORTS<br />

SENDING DATA<br />

The example above listens on a TCP/IP socket for a frame that starts with an asterisk and<br />

ends with a carriage return. It then converts the frame to a decimal value, stores this in an<br />

integer tag, and echoes the value back to the client.<br />

SENDING DATA<br />

To send data on a raw port, use the PortWrite or PortPrint functions, as documented in<br />

the Function Reference section of this manual. The first function sends a single byte, while<br />

the second function sends an entire string. To send numeric values, use the IntToText<br />

function to convert them into strings.<br />

NOTES FOR EDICT USERS<br />

Users of Red Lion’s Edict-97 software should note…<br />

• The raw serial port device driver controls the port’s handshaking lines, so there<br />

is no need to call SetRTS, HoldTx or any of the various other port management<br />

functions. These functions are thus not provided by Crimson.<br />

• When sending data, Crimson automatically handles buffer overflow events, and<br />

ensures that no data is lost. The PortWrite and PortPrint thus neither provide<br />

a return value, nor is such a value required.<br />

• To directly emulate GAF, use a program similar to the example shown above,<br />

but store the received string in a string tag, and increment an integer tag. Such<br />

direct emulation is not recommended, as you will nearly always then have a<br />

trigger to respond to the change in the sequence number, in which case you<br />

might as well handle this logic within the communications program.<br />

• Crimson’s enhanced programming support allows much higher performance<br />

levels when using raw port drivers. Performance typically exceeds that of the<br />

equivalent Edict configuration by an order of magnitude or more.<br />

REVISION 6 PAGE 273

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!