22 command 2305: transmit byte(s), 3 sdm-sio4 configuration examples, Example cr10x program – Campbell Scientific SDM-SIO4 4-Channel Serial I/O Interface User Manual
Page 47
Section 5. Programming the Datalogger
5-15
the termination character as an ASCII code 0..255; 999 means character not
enabled.
Min. delay for floating point data = floats*3*(characters*0.26*ports).
Min. delay for strings = characters*0.26*ports.
5.2.22 Command 2305: Transmit Byte(s)
By using P113 command 2305 it is possible to transmit either one or two bytes
from the command options. If any command option is set to 999 then the byte
will not be sent. The number range for each command option is 0-255 and 999.
An example of its use is below:
1: SDM-SIO4 (P113)
1:
1
Reps.
2:
0
SDM address.
3:
1
Mode, send bytes to port 1.
4:
2305
Command.
5:
13
Decimal number that represents Carriage Ret.
6:
10
Decimal number that represents Line Feed
7:
0000
Values/Rep.
8:
0000
Start location.
9:
1
Mult.
10: 0.0
Offset.
The example will transmit the bytes ‘carriage return line feed’ (CrLf) to port
one.
Values per repetition = 0
5.3 SDM-SIO4 Configuration Examples
Although the serial port configurations can be set up using the ‘command line’,
many users may prefer to set up the ports from their program. This would
normally be done once when the program is first compiled. The instruction can
be placed within a logical block which only runs when a specified datalogger
flag is reset. The program should be written so that the flag can then be set to
prevent the instruction running after the first execution; this also enables you to
force reconfiguration by toggling the flag low.
Example CR10X Program
This program is an example of how you could set up the SDM-SIO4 serial
mode and filter type once on program compilation or if flag 1 was reset. This
works on port 1 of the SDM-SIO4.
The program will convert ASCII floating point input values into Campbell
Scientific floating point format. The datalogger will store two values in
locations 1 and 2.
NOTE