Set Digital Inputs Run time via API call - 0x106
Table of Contents
Before you start
Ensure you have reviewed:
A full list of API calls can be found at: https://api.oemserver.com/swagger/index.html.
Description
This call implements setting an initial run hour value for the feature described in On Board Run Hours for Digital Inputs
Payload:
Offset | Length | Data Type | Description |
0 | 1 | BYTE |
Run Time Mask b0 – Run Time 1 b1 – Run Time 2 b2 – Run Time 3 b3-7 – Reserved |
4 | UINT32 | Run time 1 | |
4 | UINT32 | Run time 2 | |
4 | UINT32 | Run time 3 |
Example: Setting run time 1 to 0, setting run time 2 to 123456789 and doing nothing to run time 3.
curl -X 'POST' \
'https://api.oemserver.com/v1/AsyncMessaging/Send?serial=439705' \
-H 'accept: text/plain' \
-H 'Authorization: Basic XXXXXX' \
-H 'Content-Type: application/json' \
-d '{
"MessageType": 262,
"CANAddress": 4294967295,
"ExpiryDateUTC": "2025-04-26T23:52:12.126Z",
"Data": [3,0,0,0,0,0x15,0xCD,0x5B,0x07,0,0,0,0]
}'
3: The run time mask. This indicates what run times you would like to target with this message. 3 is 0000 0011 in binary, there for it will change run time 1 (b0) and run time 2 (b1).
0,0,0,0: This will set run time 1 to 0.
0x15, 0xCD, 0x5B, 0x07: This UINT32 value is made up of 4 bytes. 123456789 in 32bit binary is 00000111 01011011 11001101 00010101. This can be written as 0x07, 0x5B, 0xCD, 0x15 in hex (or 7, 91, 205, 21 in decimal). This is big endian, and the async payload structure is little endian. Therefore, it is written and is sent as 0x15, 0xCD, 0x5B, 0x07 or 21, 205, 91, 7. The message can be sent in either hex or decimal.
0,0,0,0: Since the run time mask for run time 3 is not set, this value can be set to anything and will have no effect.