User Guide
17
4.1.3 SerialIn
The primary difference when using this command compared to when it is used
with a serial port built into the dataloggers 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
dataloggers own 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’ command 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 your loggers’ documentation.
Example
The command ‘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)
Note: that 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.
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.
4.1.5 SerialInBlock
The
SerialInBlock()
instruction can be used as described in the datalogger
manual. However, if using the option to capture only the most recent data, make
sure the instruction is called often enough to avoid filling up the SDM-SIO1’s
buffer. The SDM-SIO1’s buffer operates in a fill and stop mode, and therefore will
not include the most recent data if it gets full.
4.1.6 SerialOutBlock
No special information. Can also be used to set the general purpose output line
(see Appendix A).