Specifications

Section 12. Serial Input and Output Functions
12-9
Syntax
SerialInBlock ( ComPort, Dest, MaxNumberBytes )
Remarks
Incoming serial data, up to the value defined in MaxNumberBytes, will be
stored in the Dest parameter. SerialInBlock will not wait for the return of
characters. If no new characters are received since the last execution of the
instruction, 0 will be returned by the instruction. This instruction can be used
as the expression for the NumberBytes parameter in the SerialOutBlock
instruction.
ComPort The ComPort parameter specifies the communication port and mode
that will be used when receiving the binary data.
See the CRBasic Editor help for parameter details.
This instruction runs sequentially from the processing task sequencer,
regardless of whether the datalogger is in pipeline or sequential mode.
SerialOpen (ComPort, BaudRate, Format, TXDelay, BufferSize)
The SerialOpen instruction is used to set up one of the datalogger's ports for
communication with a non-PakBus device.
Syntax
SerialOpen ( ComPort, BaudRate, Format, TXDelay, BufferSize )
Remarks
When the SerialOpen instruction is executed, the serial port is "opened" and
subsequent textual messages will flow in and out of the port in between
PakBus packets. The data will be redirected away from the terminal mode
input based on subsequent SerialIn and SerialOut instructions.
See the CRBasic Editor help for parameter details.
SerialFlush is used to clear the buffer.
For PakBus communication, BufferSize can normally be left at 0. However,
during communication with some devices it may be necessary to limit the
packet size (BufferSize) and add a delay (TXDelay) for communication to be
successful. For example, PakBus packets are 1000 bytes. The largest packet
that an RF95 can accommodate is 248 bytes. Setting the buffer to 240 would
limit the packet size and ensure that the RF95's buffer was not exceeded. A
delay (e.g., 500,000 ms) would ensure that each packet has sufficient time to
arrive at its destination before the next packet is transmitted.
This instruction runs sequentially from the processing task sequencer,
regardless of whether the datalogger is in pipeline or sequential mode.
SerialOut (ComPort, OutString, WaitString, NumberTries, TimeOut)
The SerialOut instruction is used to transmit a string over one of the
datalogger's communication ports.
NOTE