Signal Output Single-Point Mode
- Updated2023-09-14
- 3 minute(s) read
Signal Output Single-Point Mode
This mode writes signal values for the next frame transmit. It typically is used for control or simulation applications, such as Hardware In the Loop (HIL).
This mode does not use queues to store signal values. If nxWriteSignalSinglePoint is called twice before the next transmit, the transmitted frame uses signal values from the second call to nxWriteSignalSinglePoint.
Use nxWriteSignalSinglePoint for this mode.
You also can specify a trigger signal for a frame. This signal name is :trigger:. <frame name> , and once it is specified in the nxCreateSession signal list, you can write a value of 0.0 to suppress writing of that frame, or any value not equal to 0.0 to write the frame. You can specify multiple trigger signals for different frames in the same session.
Example
In this example network, frame C is a cyclic frame that transmits on the network once every 2.0 ms. Frame E is an event-driven frame that uses a transmit time (minimum interval) of 2.5 ms. For information about cyclic and event-driven frames, refer to Cyclic and Event Timing.
Each frame contains two signals, one in the first byte and another in the second byte.
The example uses CAN. The following figure shows a timeline of a frame transfer on the CAN network. Each frame contains its name (C or E), followed by the value of its two signals. The timeline shows three calls to nxWriteSignalSinglePoint.
The following figure shows the data provided to each of the three calls to nxWriteSignalSinglePoint. The session contains all four signals.
Assuming the Auto Start? property uses the default of true, the session starts within the first call to nxWriteSignalSinglePoint. Frame C transmits followed by frame E, both using signal values from the first call to nxWriteSignalSinglePoint.
If a transmitted frame contains a signal not included in the output session, that signal transmits its default value. If a transmitted frame contains bits no signal uses, those bits transmit the default payload.
After the second call to nxWriteSignalSinglePoint , frame C transmits using its values (3 and 4), but frame E does not transmit, because its minimal interval of 2.5 ms has not elapsed since acknowledgment of the previous transmit.
Because the third call to nxWriteSignalSinglePoint occurs before the minimum interval elapses for frame E, its next transmit uses its values (3 and 4). The values for frame E in the second call to nxWriteSignalSinglePoint are not used.
Frame C transmits the third time using values from the third call to the nxWriteSignalSinglePoint (5 and 6). Because frame C is cyclic, it transmits again using the same values (5 and 6).