2 serialclose(), 3 serialin(), 4 serialout() – Campbell Scientific SDM-SIO1 Serial Input/Output Module User Manual

Page 23: Serialclose(), Serialin(), Serialout()

Advertising
background image

SDM-SIO1 Serial Input/Output Module

4.1.2 SerialClose()

This will place the SDM-SIO1 unit into shutdown mode where only SDM
communications will operate. This means any data coming into the SDM-SIO1
on the RS-232/RS-485 interface will be lost. This is the lowest power mode
and for optimum power efficiency the SDM-SIO1 should be placed in this
mode whenever possible.

4.1.3 SerialIn()

The primary difference when using this command compared to when it is used
with a serial port built into the datalogger is timing. If the data has already been
sent by the remote sensor/system, the instruction will run in a few tens of
microseconds as the data is read from internal memory. However, when using
the SDM-SIO1 extra time is required to transfer data from the module and into
the datalogger memory. The extra time (in microseconds) taken to transfer
data from the SDM-SIO1 to the logger can be calculated using the formula
below.

Time = (C + 1) * (8 * SDMRate)

Where,

C = Number of characters to transfer from the SDM-SIO1

SDMRate = Rate set using the SDMSpeed() instruction in CRBasic giving the
time in microseconds for one bit period.

It’s worth noting that the bit rate defined by SDMSpeed() is not exact and will
vary slightly depending on the logger used. If you require more accurate
information about SDM data rates consult the logger documentation.

Example

The instruction SerialIn(Dest,32,1,0,10) using a 30 μs bit rate would transfer
its 10 bytes of data from the SDM-SIO1 to the logger in approximately 2.7 ms.

Time = (10 + 1) * (8 * 30)

30 μs per bit is the default data rate for most Campbell loggers. It
is possible to reduce this time and the transfer time by using the
SDMSpeed() instruction. This can be done if using short cable
runs between the logger and all SDM devices.

NOTE

4.1.4 SerialOut()

Transmission from the SDM-SIO1 will commence once the first byte of user
information is received from the logger. There will be a total delay of 16 bit
periods (at the SDMSpeed()) before transmission commences. Normally this
delay can be ignored as it is short (0.48 ms), but some applications may need to
account for it.

17

Advertising