Skip to content

ebus-config ​

Sends parameter values to the selected cameras when a message arrives. The values are constants or come from the message or from the flow and global context.

The node has one input and one output.

Properties ​

PropertyDescription
NameLabel of the node in the flow. ebus-config when empty
ParametersList of parameters to send. Add parameter adds a row with the parameter, its value and the source of the value; the trash button of a row removes it
eBUS ServicesState of the services on the host, with the Start eBUS and Stop eBUS buttons
Available CamerasThe devices that the discovery service finds. The Select checkbox marks the cameras that this node configures

The last two panels are the ones of ebus-collector, with the same buttons, and act on the same services and containers: see its Properties. A camera can be selected once its publisher container is running.

Parameters ​

Each row has a parameter from the list below, or Custom… with the name of any GenICam feature of the camera. The value is a constant of the type in the table, a property of the message (msg.) or a context value (flow., global.).

ParameterValue
Width (pixels), Height (pixels): Width, HeightNumber, in pixels
Offset X (pixels), Offset Y (pixels): OffsetX, OffsetYNumber, in pixels
Exposure Time (µs): ExposureTimeNumber, in microseconds
Gain (dB): GainNumber, in dB
Acquisition Mode: AcquisitionModeText, typically Continuous, SingleFrame or MultiFrame
Custom…Text, number or boolean

Which features exist depends on the device. On many cameras ExposureTime and Gain can only be written once ExposureAuto and GainAuto are Off, as the hints of the dialog say.

How the publisher writes a value ​

The publisher of the camera looks the name up in three steps: first the short aliases exposure and exposuretime (ExposureTime), gain, width, height, offsetx, offsety, acquisitionmode, pixelformat, triggermode, triggersource and triggerselector, in any letter case; then the exact name; then any feature whose name matches in any letter case. It then writes the value according to the type of the feature:

Feature typeHow the value is written
IntegerA number; a fractional part is dropped. A value outside the range of the camera is brought to the nearest limit, and a value off the increment goes down to the step below
FloatA number. A value outside the range of the camera is brought to the nearest limit
EnumerationThe name of one of its entries, or the numeric value of an entry when the value is an integer. Any other value is refused, and the reply lists the entries
Booleantrue or false, a number (0 is false), or a text: true (any letter case) and 1 write true, any other text writes false
CommandExecuted, whatever the value
StringThe value as text
  • The range of a feature can depend on other features: the maximum Width of many cameras depends on OffsetX. The value is brought into the range that holds when it is written.
  • A feature that changes the geometry or the format of the frames (Width, Height, OffsetX, OffsetY, PixelFormat, BinningHorizontal, BinningVertical, DecimationHorizontal, DecimationVertical), and any feature that is not writable while the camera streams, make the publisher stop the acquisition, write the value and start the acquisition again, with buffers and shared memory segments for the new frames. No frame arrives in the meantime. A feature that is still not writable once the acquisition is stopped is answered with not writable. The other features are written while the camera acquires.
  • The parameters of one message are written in the order of their names as sent, compared character by character, capital letters before lower case: ExposureAuto comes before ExposureTime, but Gain before GainAuto, Height before OffsetY and OffsetX before Width. Switch the automatic modes off in an earlier message than the values, and send a size and its offset in separate messages when the new combination only fits the camera in one order.
  • The publisher keeps every value it has written, under the name of the feature, but not the commands: after every reconnection it writes all of them again, once, in the order of their names. It forgets them when its container is restarted. When it opens the camera it also sets AcquisitionMode to Continuous, unless a value for AcquisitionMode has been written.
  • Messages that reach the publisher while it is not acquiring (while it opens the camera, or reconnects to it) wait, the last 32 at most, and are written once the camera acquires.

After each message the publisher replies on the status subject of the camera, ebus/<MAC>/status, with the status connected and the detail config applied, or config <name>: <reason> for the parameters it could not write (several are separated by ;). The reasons are unknown parameter, not available, not writable, invalid enum value '<value>' (entries: <entries>), bad value: <error>, unsupported parameter type, or the error that the eBUS SDK returns. The same lines are written to the log of the publisher container (docker logs ebus-<MAC>, with the MAC address in upper case and hyphens). ebus-collector does not show these replies, because it shows no detail for a connected camera.

On the iPORT NTx ​

The iPORT NTx of the Omron V275 is a frame grabber: it has no ExposureTime, Gain, TriggerMode or TriggerSource features, because the exposure is set in its sensor head. exposure and gain therefore answer unknown parameter. Its writable features include Width, Height, OffsetX, OffsetY, PixelFormat, AcquisitionMode and TestPattern; Width and TestPattern are the two that have been written on the device. TestPattern set to iPORTTestPattern makes it emit synthetic frames, and Off stops them: see the section Line-scan devices of the overview.

Input ​

Any message makes the node evaluate its parameters and send them.

PropertyTypeDescription
msg.parametersobjectOptional. Parameter names and values that are added to the ones of the dialog and replace those with the same name. The values are texts, numbers or booleans; values of other types are left out
msg.camerasarrayOptional. MAC addresses of the cameras to configure for this message, in place of the selection of the dialog. Any notation is accepted (aa:bb:cc:dd:ee:ff, AA-BB-CC-DD-EE-FF, aabbccddeeff), and so are objects with a mac property; entries that are not MAC addresses are left out. An empty array means the selection of the dialog

A parameter whose value is missing (undefined or null), an empty text, the text none (any letter case) or a number that is not finite is left out. Texts are sent without the spaces around them, and a text that holds a number ("5000", "-1.5", "1e3") is sent as a number. A numeric row left empty is not left out: Node-RED reads an empty number as 0, and 0 is sent. The remaining parameters are sent together to each camera, on the NATS subject ebus/<MAC>/config.

To switch a camera to software trigger, for ebus-trigger:

javascript
msg.parameters = {
    "TriggerMode": "On",
    "TriggerSource": "Software"
}

The values only reach a camera whose publisher container is running.

Output ​

The incoming message, with the summary of what was sent in msg.ebusConfig:

javascript
msg.ebusConfig = {
    cameras: ["aa:bb:cc:dd:ee:ff"],                 // cameras the parameters were sent to
    parameters: ["Width", "PixelFormat"],           // names of the parameters sent
    params: { Width: 1320, PixelFormat: "Mono8" },  // the same names, with their values
    subjects: ["ebus/AA-BB-CC-DD-EE-FF/config"],    // NATS subjects the parameters were sent on
    timestamp: 1710500000000                        // moment of sending, in milliseconds
}
SituationOutput
The parameters were sentThe message with msg.ebusConfig
No parameter has a valueThe message, unchanged
There is no camera to configure, or the sending failsNo message

The camera does not answer the node: msg.ebusConfig tells what the node sent, not what the camera accepted. What the publisher could not write is in its reply, described above.

Status ​

StatusMeaning
Green dot, N cams | M paramsThe node is ready, with N cameras selected and M parameter rows in its dialog (1 cam, 1 param in the singular)
Grey ring, 0 cams | M paramsNo camera is selected in the dialog
Green dot, sent K (N cams | M params)The last message sent K parameters
Yellow ring, no cameras selectedA message arrived and there is no camera to configure
Yellow ring, no parametersA message arrived and no parameter has a value
Red ring, config errorThe parameters could not be sent

Errors ​

MessageLevelCause
No cameras selected for configurationWarningA message arrived and there is no camera to configure: no camera is selected and msg.cameras is absent or empty, or msg.cameras holds no valid MAC address
Parameter <name>: <reason>WarningThe value of a row could not be read from the message or the context. The parameter is left out
Parameter <name>: unsupported value type <type>WarningThe value of a row is not a text, a number or a boolean. The parameter is left out
No parameter values to applyWarningNo parameter is left to send
Failed to configure cameras: <reason>ErrorA message arrived and Node-RED could not connect to the NATS server

The errors are logged without the message, so they appear in the debug sidebar and in the Node-RED log but do not trigger a Catch node.

The node opens the NATS connection that the nodes of the package share when the first message with parameters arrives, if no other node has opened it yet. When that fails, the next message tries again.