SDMSIO4 (SDM-SIO4 Serial Input/Output Device)
The SDMSIO4 instruction is used to control and transmit/retrieve data from a Campbell Scientific SIO4 Interface (legacy 4 Channel Serial Input/Output device). See the SDM-SIO4 Serial Input Interface manual for operation details
NOTE: This instruction is not compatible with the newer SDM-SIO4A. The SDM-SIO4 is a legacy product that has been replaced with the SDM-SIO4A. The SerialOpen instruction is used to set up and control the SDM-SIO4A.
Syntax
SDMSIO4 ( Dest, Reps, SDMAddress, Mode, Command, Param1, Param2, ValuesPerRep, Multiplier, Offset )
Remarks
NOTE: Unlike other SDM instructions, the SDMSIO4 instruction is called from the datalogger's processing task. Therefore, if a delay is required between SDMSIO4 instructions, use the Delay instruction's Option 1 for parameter 1.
Parameters
Dest
The variable in which to store the results of the instruction when retrieving data from the SIO4. If data is being sent to the SIO4, then Dest becomes the source array for the data to be sent. The Dest array must be at least as large as the Reps parameter value multiplied by the ValuesPerRep parameter value.
Type: Variable or Array
Reps
Defines the number of sequential SIO4s that will be called by the instruction. The datalogger will poll the SIO4 with the address set by the Address parameter first, receive or send the number of values set by the ValuesPerRep parameter next, and then poll the SIO4 with the next sequential address. If the Reps parameter is 2, the ValuesPerRep is 3, and the Command parameter is set to receive, then three values from the first SIO4 would be sent to the first three elements of the Dest array, and three values from the second SIO4 would be received and written to the fourth through sixth elements of the Dest array.
Constant integer (or expression that evaluates as a constant).
SDMAddress (Address of Device)
Defines the address of the device with which to communicate. Valid SDM addresses are 0 through 14. Address 15 is reserved for the SDMTrigger instruction.
Some SDM instructions support repetitions. If a Reps parameter is present and it is greater than 1, the data logger will increment the SDM address used in the instruction for each subsequent device with which it communicates.
SIO4Mode
Defines which port the instruction will affect.
Code | Description |
---|---|
1 | Send/Receive Port 1 |
2 | Send/Receive Port 2 |
3 | Send/Receive Port 3 |
4 | Send/Receive Port 4 |
5 | Send to all Ports (global) |
SIO4Cmd
Used to configure the SIO4. The commands are listed briefly below. See the SDM-SIO4 manual for details.
Code | Description |
---|---|
1 | Poll of available data |
2 | Get EPROM and memory signatures. |
3 | Flush all receive buffers. |
4 | Send data to datalogger. |
5 | Return number of watchdog errors, invalid command executed, and lithium battery voltage. |
6 | Flush transmit buffer. |
7 | Activate command line. |
8 | Poll TX buffers for data. |
9 | Flush converted data buffer. |
66 | Send single-byte data to datalogger. |
67 | Get return code |
320 | Send byte data to SDM-SIO4. |
321 | Execute command line command. |
1024 | Send string to SIO4. |
1025 | Transmit a byte. |
1026 | Serial port status. |
1027 | Manual handshake mode. |
2049 | Communication parameters. |
2054 | Set up receive filter. |
2304 | Transmit string and/or data to device (formatter/filter). |
2305 | Transmit bytes. |
Param1
The first parameter that should be passed to the SIO4 for the selected Command. Refer to the SDM-SIO4 manual for details.
Param2
The second parameter that should be passed to the SIO4 for the selected Command. Refer to the SDM-SIO4 manual for details.
ValuesPerRep
The number of values to be sent or received from each SIO4 each time this instruction is performed.
Mult, Offset (Multiplier and Offset)
Factors by which to scale the raw results of the measurement. Typically used to convert the raw measurement to engineering units or to units other than which is output. For example, the TCDiff instruction measures a thermocouple and outputs temperature in degrees C. A multiplier of 1.8 and an offset of 32 will convert the temperature to degrees F.
For temperature measurements, a multiplier (mult) of 1 and an offset of 0, would output in degrees Celsius. For analog measurements, a multiplier (mult) of 1 and an offset of 0, would output the measured voltage in millivolts divided by the excitation voltage in volts.
If Repetitions of greater than 1 are used for this instruction, Repetitions can also be used for the Multiplier and Offset. See Multipliers, Offsets, and Disable Variables with Repetitions for more information.
Type: Constant, Variable, Array, or Expression