SerialIn()

The primary difference when using this instruction with an SDM‑SIO2R compared to when it is used with a serial port built into the data logger 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‑SIO2R, extra time is required to transfer data from the module into the data logger memory.

The extra time (in microseconds) taken to transfer data from the SDM‑SIO2R to the data logger can be calculated using the following formula:

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

Where,

C = Number of characters to transfer from the SDM‑SIO2R

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 data logger used. If you require more accurate information about SDM data rates, consult your data 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‑SIO2R to the data logger in approximately 2.7 ms.

Time (in microseconds) = (10 + 1) × (8 × 30)

Note that 30 µs per bit is the default data rate for most Campbell Scientific data 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 data logger and all SDM devices.