Reference
Source reference
On this page · 4 sections
A source is an entry in the agent's sources list with an id, a type, an interval in milliseconds, and its tags. Tags are named source.tag on the agent and agent.source.tag in a project. Every type reports its state on the agent's home page and in /api/status, with the link it uses.
| Type | Configuration | Needs |
|---|---|---|
| simulator | Generated signals with the browser simulator's shapes: min, max, period (ms), kind sine, ramp, step, square (exactly min, then exactly max: a run bit) or noise, noise as a fraction of the span. A write turns the tag into a constant. | none |
| modbus-tcp | host, port (502), unitId, interval. A tag is register in the usual convention - 4xxxx a holding register, 3xxxx an input register, 1xxxx a discrete input, 1 to 9999 a coil - or address + kind (holding, input, coil, discrete); type int16, uint16, int32, uint32, float32 (wordSwap for the other word order) for a register, a coil or a discrete input is on or off; value = raw × scale + offset; writable holding registers take writes (function 6 or 16), writable coils too (function 5 or 15). | none |
| modbus-rtu | The same tags over a serial line with RTU framing (CRC-16): port is COM3 or /dev/ttyUSB0 with baudRate, dataBits, parity (none, even, odd), stopBits, or tcp://host:port for a serial device server. | none (the serialport package when installed) |
| scpi | An instrument on its LXI raw socket (host, port 5025). A tag with a query is read on the interval and parsed as a number (type: "string" keeps the text); a tag with a command takes writes, {value} replaced. | none |
| scpi-serial | The same over a serial line (port, baudRate, …). | none (the serialport package when installed) |
| s7 | A Siemens S7-300, 400, 1200 or 1500 over ISO-on-TCP (port 102): host, rack (0), slot (1 for a 1200 or 1500, 2 for a 300 or 400), interval. A tag is an address in the Siemens notation - DB1.DBD0, DB1.DBW4, DB1.DBX0.0, M0.0, MW2, I0.1 or E0.1, Q0.1 or A0.1 - or the same spelled out as area, db, byte and bit; type bool, byte, int16, uint16, int32, uint32 or real; value = raw × scale + offset; writable takes writes. The PLC must permit PUT/GET, on a data block that is not optimised. See the agent. | none |
| enip | An Allen-Bradley ControlLogix, CompactLogix or Micro800 over EtherNet/IP (port 44818): host, slot (0), interval, route (false for a controller with the port built in), batchSize (12). A tag's address is the controller tag as Studio 5000 names it - Tank_Temperature, Motor_1.Running, Flow[2], Program:MainProgram.Cycles - atomic types only; scale, unit, writable. ethernet-ip is the same type. See the agent. | none |
| mqtt | A broker at url (mqtt://host:1883, mqtts:// for TLS with ca, cert, key, rejectUnauthorized), username, password, clientId, keepalive (60 s), qos (0 or 1). A tag is a topic (wildcards + and # allowed); a JSON payload gives the tag its path (value, data.temp, readings[0]) or the whole; a number is a number; type: "string" keeps a numeric text. A writable tag publishes a write to writeTopic (default the topic) with retain. MQTT 3.1.1 without a dependency. | none |
| http | A URL polled every interval ms with method (GET) and headers; the answer is JSON, and a tag is a path into it (data.tt101.value, readings[1]; a source-level path descends first, for an envelope). A writable tag sends write.method (POST) to write.url (default the url) with write.body, a template of {{value}} (JSON), {{raw}} and {{tag}}; timeout (5000), rejectUnauthorized: false for a device with a self-signed certificate. | none |
| visa | An instrument by resource: TCPIP0::host::5025::SOCKET, TCPIP0::host::inst0::INSTR (VXI-11, portmapPort and corePort optional), ASRL3::INSTR; USB0::…::INSTR, GPIB0::5::INSTR and hislip0 through the VISA library. Same tags as scpi. | none for socket, VXI-11 and serial; the koffi package and a VISA library (Keysight, R&S or another vendor) for USB, GPIB and HiSLIP |
| opcua | An OPC UA server at endpoint (opc.tcp://host:4840). The tags are monitored items of one subscription at interval ms - the server pushes changes; a tag is a nodeId, writable takes writes (the variant type from the first sample, or dataType); securityPolicy, securityMode, user, password as the server wants. /api/sources/<id>/browse finds node ids. | the node-opcua package |
| daqmx | DAQmx channels: ai tags (channel, min, max, terminal, reduce mean/min/max/rms/last) read as one finite acquisition of samples at rate Hz per interval; di lines; ao and do take writes. | the koffi package and the DAQmx runtime |
| agent (in a project) | Not an agent source but the project's side: a source of type agent with the agent's url (empty when the app is served by the agent) and token; its tags are agent.<source>.<tag>, plus agent.flows.<name> for values the flows publish and agent.$alarms for the alarm list. |
Common tag fields
| Field | Types | Meaning |
|---|---|---|
| unit | all | The engineering unit, carried with every sample. |
| scale, offset | modbus, scpi, visa, daqmx | value = raw × scale + offset. |
| writable | modbus | The register takes writes. |
| command | scpi, visa | The command a write sends, {value} replaced; a command ending in ? has its reply read and discarded. |
| type | modbus: int16, uint16, int32, uint32, float32; scpi, visa: string | The register's type; or keep an instrument's reply as text. |
Serial lines
port names the line: COM3 on Windows, /dev/ttyUSB0 or /dev/ttyS0 on Linux; baudRate (9600), dataBits (8), parity (none, even, odd), stopBits (1). With the serialport package installed next to the agent the port is opened through it; without it the agent sets the line with mode (Windows) or stty (Linux) and opens the port as a file, which needs no package. A serial device server - a Moxa NPort, ser2net, a converter with a TCP port - is given as "port": "tcp://10.0.0.5:4001".
VISA resources
| Resource | Route |
|---|---|
| TCPIP0::host::5025::SOCKET | The raw socket, in the agent. |
| TCPIP0::host::inst0::INSTR | VXI-11 over ONC RPC, in the agent: the core port is looked up on the portmapper (port 111), or given as corePort; portmapPort for an unusual portmapper. |
| ASRL3::INSTR | The serial port (COM3, /dev/ttyS2). |
| USB0::vid::pid::serial::INSTR, GPIB0::5::INSTR, TCPIP0::host::hislip0::INSTR | The VISA library through koffi: a vendor's VISA library (Keysight IO Libraries, R&S VISA or another) must be installed. library: "native" forces this route for any resource. |
DAQmx
samples and rate set the finite acquisition every interval (samples: 1 reads on demand, unclocked). An ai tag has channel (Dev1/ai0), min, max, terminal (RSE, NRSE, Diff, PseudoDiff) and reduce (mean, min, max, rms, last); di and do tags name a line (Dev1/port0/line0); ao tags take a voltage. The bindings were written against the DAQmx C API reference and have not yet been run against a device; without koffi or the runtime the source reports that and its tags stay bad.