This guide walks through defining a stream in streams.json, describing its data blocks, and picking/configuring the right driver for your hardware or network interface.
1. Understand the streams.json structure
APIC uses streams.json to define how data flows between LRUs, simulations, hardware drivers, and network interfaces. Each stream contains a blocks list and a driver configuration:
{
"streams": {
"[StreamName]": {
"blocks": [ ... ],
"driver": { ... }
}
}
}
2. Define the blocks array
Each block describes one data element flowing in or out of the stream:
{
"raw": "LRU_Seeker.VideoFrame",
"direction": "in",
"framePerMS": 10,
"rawcounterbyte": 4,
"headerMarker": "534f_2A",
"model": "modelName"
}
| Field | Description |
|---|---|
raw | Block path: LRU.BlockName. |
direction | "in" = input stream (read from device), "out" = output stream (write to device). |
framePerMS | Stream rate. Numeric value = frames per millisecond; append hz postfix for Hertz (e.g. 100hz). Set to 0 to disable both transmission and reception. |
rawcounterbyte (optional) | Byte position of a block counter to automatically increment on send or receive. |
headerMarker (optional) | Unique identifier placed at the start of a data block to mark its beginning. An underscore (_) means ignore the value. |
model (optional) | Model name to execute (invokes modelName::OnRun()) when block data is received. The model's periodic scheduler is suspended during this mode. |
3. Choose and configure a driver
The driver object determines which transport the stream uses. Pick the driver that matches your interface:
Sniffer Driver (network capture)
Captures packets from network interfaces using SnifferDriver. Supports local, remote, or both directions, and optional pcap filters.
"driver": {
"name": "SnifferDriver",
"active": true,
"adapter": "\\Device\\NPF_Loopback",
"filter": "udp",
"remoteIP": "127.0.0.1",
"remotePort": 0,
"localIP": "127.0.0.1",
"localPort": 3021,
"source": "remote",
"destination": "remote"
}
| Field | Description |
|---|---|
adapter | Network adapter name; available names are listed on application startup. |
filter | pcap capture filter string. |
remoteIP / remotePort | Filter messages to/from a remote address; can be empty/zero. |
localIP / localPort | Filter messages to/from a local address; can be empty/zero. |
source | "remote", "local", or "both" — which side to capture from. |
destination | "remote", "local", or "both" — which side to capture to. |
NI65xx Driver (NIDAQ)
Interfaces with NI DAQ cards, supporting multiple ports, read/write configuration, raw types, and power-up states.
"driver": {
"name": "NI65xxDriver",
"active": true,
"CardType": "MX",
"DeviceID": 1,
"PortNum": 2,
"PowerUpState": "low",
"RawType": "U",
"LinesPerPort": 16,
"Port0": "R",
"Port1": "W"
}
| Field | Values | Description |
|---|---|---|
CardType | e.g. "MX" | Hardware card type. |
DeviceID | integer | Unique device ID of the card. |
PortNum | integer | Number of ports available. |
PowerUpState | low / high / TriState / NA | Output line state after power-up. |
RawType | BI / BU / U / F | Binary signed, binary unsigned, unsigned integer, or 64-bit float. |
LinesPerPort | 16 / 32 / 64 | I/O lines per port. |
Port0..PortX | R / W | Direction per port: Read or Write. |
Socket Drivers (UDP / TCP)
Handles UDP and TCP sockets with multiple IN/OUT blocks, optional header markers, and raw counter bytes.
"driver": {
"name": "UDPSocketDriver",
"active": true,
"remoteIP": "172.30.176.2",
"remoteIPBind": "172.30.192.1",
"remotePortBind": 8081,
"remotePort": 8081,
"localIP": "172.30.192.1",
"localPort": 8081
}
Use "name": "TCPSocketDriver" for TCP. remoteIPBind/remotePortBind apply only to TCP and set the local bind used when connecting out. localIP/localPort define where the driver listens.
XDMA Driver (FPGA high-speed streaming)
Handles high-speed FPGA streaming: video frames, frame sync, metadata, and static/dynamic modes.
"driver": {
"name": "XDMADriver",
"DeviceGuid": "{74c7e4a9-6d5d-4a70-bc0d-20691dff9e9d}",
"userBaseAddress": "0x00020000",
"DDR_BASE": "0x88000000",
"DeviceIndex": 0,
"FrameWidth": 640,
"FrameHeight": 512,
"BPP": 2,
"FrameRateUs": 200000,
"FrameSyncDelayMs": 10,
"AddMetadata": "Yes",
"StreamingMode": "Static",
"SyncSource": "External"
}
| Field | Description |
|---|---|
DeviceGuid | Unique identifier of the XDMA PCIe device. |
userBaseAddress / DDR_BASE | Base addresses for control/buffer mapping and DDR frame transfer. |
DeviceIndex | Index of the XDMA device when multiple are present. |
FrameWidth / FrameHeight / BPP | Image frame dimensions and bytes per pixel. |
FrameRateUs | Frame interval in microseconds (e.g. 200000 = 5 FPS). |
FrameSyncDelayMs | Delay before frame sync signal is sent/processed. |
AddMetadata | "Yes"/"No" — append metadata to each frame. |
StreamingMode | "Static" (fixed memory) or "Dynamic" (continuous stream). |
SyncSource | "Internal", "External", or "Sim" — frame timing source. |
CIGI Driver
Implements the CIGI protocol:
"driver": {
"name": "CIGIDriver",
"remoteIP": "127.0.0.1",
"remotePort": 8015,
"localIP": "",
"localPort": 8014
}
Serial Driver
Drives a serial port for telemetry, commands, and sensors. Configurable COM port, baud rate, parity, stop bits, and buffer sizes.
"driver": {
"name": "SerialDriver",
"file": "c:/data/serialData.txt",
"comPort": "\\\\.\\COM10",
"baudRate": 921600,
"parity": 0,
"stopBits": 1,
"byteSize": 8,
"totalTimeoutConstant": 10,
"InBufferSize": "auto",
"OutBufferSize": "4096"
}
| Field | Description |
|---|---|
file | Optional — read/write from a file instead of a serial port; when set, comPort is ignored. |
comPort | Serial port name/path, e.g. \\\\.\\COM101. |
baudRate | Communication speed in bits per second. |
parity | 0=None, 1=Odd, 2=Even, 3=Mark, 4=Space. |
stopBits | Typically 1 or 2. |
byteSize | Data bits per character (usually 8). |
totalTimeoutConstant | Read/write timeout in ms. |
InBufferSize / OutBufferSize | Buffer sizes in bytes, or "auto" for system default. |
The UEI Serial Driver ("name": "UEISerialDriver") uses the same serial settings plus an ip field for the UEI box address.
FFMpeg and GenICam video drivers
Both stream video from a camera. FFMpeg example:
"driver": {
"name": "FFMPegDriver",
"cameraName": "Lenovo FHD Webcam",
"format": "yuvj422p",
"fps": 30,
"width": 640,
"height": 480,
"bufferSizeMB": 10
}
If cameraName is missing or empty, a list of available connected devices is shown on startup. bufferSizeMB sizes the buffer for incoming frames not yet processed.
GenICam adds hardware trigger support via externalSync (line, activation: RisingEdge/FallingEdge), numOfPreAllocatedBuffers, and waitForFrameTimeout_us (0 = event-driven async mode). Note: setting fps overrides the external sync properties.
Shmem Driver (shared memory)
"driver": {
"name": "ShmemDriver",
"filename": "sharememFilename",
"size": 2048
}
INET Driver (HTTP/SFTP)
"driver": {
"name": "INETDriver",
"protocol": "http",
"IP": "127.0.0.1",
"port": 30000,
"URL": "/api/v0/{1}",
"header": {
"Content-Type": "application/json",
"Accept": "text/json",
"Accept-Language": "en-US",
"Cache-Control": "no-cache"
}
}
protocol is "http" or "sftp"; URL can include indexed placeholders. The header object defines custom HTTP headers sent with each request.
GDL90 Driver
Implements the GDL90 protocol for aviation entity display (e.g. ADS-B data between airborne and ground systems):
"driver": {
"name": "GDL90Driver",
"active": true,
"remoteIP": "127.0.0.1",
"remotePort": 4000,
"localIP": "",
"localPort": 4001
}
4. Apply tips and best practices
- Use
headerMarkerfor reliable frame detection in UDP/TCP streams. - Set
rawcounterbyteto detect lost frames. - Ensure blocks generated by DBSimGenerator match the driver's endian and bit ordering.
- For serial streams, enable overlapping mode for high-throughput.
- Multiple blocks per stream can mix directions (IN/OUT).