SPLat Logo

iiPrintText dest#,text-string [D >= 23]

NOTICE: We are updating our website. For product enquiries and orders please contact us directly.
NOTICE: SPLat Controls has moved. We are now at 1/85 Brunel Rd, Seaford, 3198. map

iiPrintText dest#,text-string [D >= 23]

Print text.

The text string given in the instruction will be sent to the destination called for in dest. If dest is a valid RAM address, the result will be written to RAM in successive bytes. You can use that to write to an Xwire buffer, for example. If dest is the address of a serial port, then the data will be sent out that serial port.

The maximum number of bytes per message to the serial port is 255. However, the serial transmit buffer is 128 bytes (which could change in future Firmware revisions). If you try to send out more than the buffer can hold, your program will stall until there is room in the buffer (this is your whole program, not just a single MultiTrack task). You can avoid this by using COMTx_Space to ensure there is room before attempting to output.

The text "string" can be a comma-delimited list of bytes in any of the following formats:

ExampleMax valueDescription
23 255 Decimal constant
'A3 'FF Hex constant
%10101100 %11111111 Binary constant
"Hello"   A quoted text string

Strings may be any printable characters, enclosed in quotes. A quotation mark is represented by two quotation marks in a row, viz ""

Any number of individual bytes, words and strings may be concatenated, with commas separating them. Spaces are not allowed except within quoted strings.

Examples:

   #Open_Serial User( 38400, 8, n )

_Loop
iiPrintText 251,"The quick brown fox",'0D,'0A
Pause 100
Goto _Loop

This example will configure the default serial port, then print the quoted message followed by '0D (carriage return) and '0A (line feed).  It will then wait 1 second before printing the message again.

iiPrintText	XWBuf,'FF,'09,'E3,'67,'FF

This example would print a series of hexadecimal bytes, perhaps destined for an Xwire peripheral that can make sense of them.

This instruction is automatically indexed.

When printing to RAM the index register I is added to the dest address and the result is stored in that location. I is then incremented by the number of characters stored. This allows several things to be "printed" to RAM.

"Printing" to RAM is typically used for communicating with an Xwire peripheral.

The dest argument determines where the result of the instruction is directed.

Destination address (dest)

Where the result is directed
0 - 249

The result is stored in successive RAM locations, starting at dest. It will occupy as many RAM locations as are needed to contain the result, one location per character. For example, the result of iifPrintWFW 25,7,3 will occupy 7 bytes, RAM locations 25 through 31, because the format specifier calls for 7 digits of output. A run-time error will occur if the output over-runs the end of RAM (address 249). Using RAM as the destination is particularly useful for sending data out on Xwire.

Note: These addresses are not jndexed. Instead they use I as an offset from the dest address, and automatically increment I by the number of bytes stored in RAM by the instruction.

251 - 254 The result is directed to the serial port at the address given, providing the selected protocol is "User programmable", and that the controller you are programming has a serial port at that address. This is the primary means of generating any arbitrary serial output under program control.
 

Dialect restriction: This instruction is not implemented in boards with dialect numbers less than 23.

See also iiPrintNVText