Turn a Digital Output on/off - 0x004
Table of Contents
Before you start
Ensure you have reviewed:
Description
0x004 - Set Digital Output.
For detail on device outputs, see: Common Concepts - Digital Outputs and Remote Output Control
This message remotely sets digital outputs on a device. The output numbers are physical outputs (no logical remapping). The firmware translates the logical level into a physical level depending on the active high setting in system parameters. The changed mask allows the server to change required outputs and not affect others.
For this message to have any effect - the output being changed must be set up as Digital Output under the Digital Output parameters.

How to use
Outputs are used for a variety of purpose. Often to immobilize a vehicle. If we are using the output for this purpose, we would set the output function as Immobilizer - and instead use the Immobilization Command
The Set Output command is commonly used with devices such as the Hawk Datalogger - for example to remotely turn on or off a water pump.
Payload:
Data structure for to set digital outputs.
Offset |
Length |
Data Type |
Description |
0 |
2 |
UINT16 |
Logical level |
2 |
2 |
UINT16 |
Change mask |
If we would like to turn on Digital Outputs 1 and 2,
We require,
- Logical Level - 0000 0110 (outputs 1 and 2 logical level 1)
- Change Mask - 1111 1111 = 0xFFFF - allow all inputs to be changed. In general we typically will always set these 2 bytes to 0xFFFF
Therefore the data to send is:
FF FF 00 06.
Sending this as a JSON array gives [15, 15, 6, 0] (note byte ordering)
cURL Example:
curl -X 'POST' \
'https://api.oemserver.com/v1/AsyncMessaging/Send?serial=439705' \
-H 'accept: text/plain' \
-H 'Authorization: Basic XXXXXXXXXXXXXXXXXXXXX' \
-H 'Content-Type: application/json' \
-d '{
"MessageType": 4,
"CANAddress": 4294967295,
"ExpiryDateUTC": "2025-03-28T13:27:05.246Z",
"SendAfterDateUTC": "2025-03-26T13:27:05.246Z",
"Flags": 0,
"Data": [15,15,6,0]
}'
Response
Device Manager responds 200 OK with the Message ID (a someone arbitrary number assigned by Device Manager to Async messages)

Within Device Manager, we can view the Async Message history or queue on the Device View.

We can see in the details, Output 1, and Output 2 have been set to ‘High’ (1, on).
So our command has worked.
Confirming the device has actioned the change
We can keep track as to whether our change has been applied and the state of our outputs in a few places:
-
Field ID 2 – Digital Data
We simply look at the status of the relevant output(s)
-
Digital Output Changed Log Reason
These logs are not enabled by default, but this can be adjusted in the parameters
If enabled, a log with Log Reason 10 - Digital Output Changed Log Reason will be generated on a change.