dS378
dS378
User Manual v2.19
Binary command set
Summary.
0x30 Get Status
0x31 Set relay
0x32 Set output
0x33 Get Relays
0x34 Get Inputs
0x35 Get Analogue
0x36 Get Counters
0x30 (decimal 48) Get Status (1 byte command, returning 8 bytes)
This command returns 8 bytes of status data
Module ID
This will be 35 (0x23) for the dS378
System Firmware Major
2 for example
System Firmware Minor
18 for example
Application Firmware Major
1 for example
Application Firmware Minor
2 for example
Volts
Power supply volts x 10. Example 125 is 12.5v
Internal Temperature (high byte) x 10
Internal Temperature (low byte)
combined to 16 bits, 267 = 26.7 degrees C
In the above example the returned bytes would be:
0x22 0x02 0x12 0x01 0x02 0x7D 0x01 0x0B
The last two bytes combined are 0x10B which is 267 decimal.
0x31 0x02 0x01 0x00 0x00 0x00 0x00 Set Relay (7 byte command, returning 1 byte)
This command turns a relay on or off or pulses it for a time period and returns an ACK/NACK
byte. ACK=0, NACK=non-zero (actually the unknown relay number).
0x31 The actual command, the rest are parameters.
0x02 Relay number. Valid numbers are 1-8 (0x01-0x08)
0x01 Turn relay on (0x00 for off). This is ignored when following pulse time is >100.
0x00 } high byte
Pulse time
0x00 } mid high
These 4 bytes combined are a 32-bit pulse time for the relay
0x00 } mid low
when less than 100 (as it is here 0x00000000) its ignored
0x00 } low byte
When >100 this pulses relay on for that number of mS
To pulse relay 5 on for one second the command is:
0x31 0x05 0x00 0x00 0x00 0x03 0xE8
0x000003E8 (or just 0x3E8) is 1000 decimal, which is 1000mS or 1 second.
The relay will turn on and then go off 1 second later.
When sending a relay pulse time, the relay on/off byte is ignored. The relay is always on for
the duration of the pulse.
Copyright
© 2016-2017,
Devantech Ltd.
All rights reserved.
31
www.pishrobot.com