Programming; Crbasic Instructions; Serialopen() - Campbell SDM-SI01A Product Manual

Table of Contents

Advertisement

6.3 Programming

The normal serial port instructions such as
SDM-SIO1A. Aside from changes to the COMPort and the SerialOpenFormat parameter, a
program written for a standard serial port will usually work with the SDM-SIO1A. The main
difference to be aware of, when trying to write fast running programs, is the extra delay needed
to transfer data from the SDM-SIO1A to the data logger (roughly equivalent to transferring data
over a serial link at 38 kilobaud).
The following section gives further information about the CRBasic programming language and
how the serial instructions are to be used with the SDM-SIO1A.
This section assumes the user has knowledge of the CRBasic programming language. A useful
introduction to programming for serial sensors can be found here:
https://s.campbellsci.com/documents/sp/technical-papers/serial.pdf
See
Example data logger programs
CRBasic to send and receive data using the SDM-SIO1A.
Please contact Campbell Scientific for further assistance or training. The Campbell Scientific user
forum is also a useful resource to check if others might have already written code for a specific
serial device.
Only the parameters that need special explanation or whose functionality has changed when
used with the SDM-SIO1A are listed in the following sections. Any other parameters should be
taken as not having changed. Please refer to the data logger manual and/or the CRBasic Editor
help system for more guidance.

6.3.1 CRBasic instructions

6.3.1.1 SerialOpen()

All internal buffers in the SDM-SIO1A will be flushed when this instruction is called, resulting in
the loss of any data that might have been in them at that point in time.
COMPort
l
The COMPort numbers are defined in
32 to 47 are reserved for use with the SDM-SIO1A.
BaudRate
l
BaudRate is used to set up the SDM-SIO1A baud rate as you would with any RS-232
interface. The SDM-SIO1A does not support automatic baud rate recognition. Instead,
SerialOpen()
(p. 35) for two simple examples of how to write programs in
Table 6-1
(p. 10). COM port numbers in the range of
SDM-SIO1A and SDM-SIO4A Serial Input/Output Modules
SerialIn()
and
are used with the
18

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sdm-si04a

Table of Contents