LIN
- Updated2023-02-17
- 7 minute(s) read
LIN
Reads data from a session as an array of LIN frames. The session must use a LIN interface and a mode of Frame Input Stream, Frame Input Queued, or Frame Input Single-Point.
.gvi.png?_LANG=enus)
Inputs/Outputs

session in
The session to read.

number to read
The number of frame values desired.
If number to read is negative (typically -1), all available frame values are returned. If number to read is negative, you must use a timeout of 0.
This input is optional. The default value is -1.
If the session mode is Frame Input Single-Point, set number to read to either -1 or the number of frames in the sessions list. This ensures that XNET Read (Frame LIN) can return the current value of all session frames.

timeout
The time to wait for number to read frame values to become available.
If timeout is positive, XNET Read (Frame LIN) waits for number to read frame values, then returns that number. If the values do not arrive prior to the timeout, an error is returned.
If timeout is negative, XNET Read (Frame LIN) waits indefinitely for number to read frame values.
If timeout is zero, XNET Read (Frame LIN) does not wait and immediately returns all available frame values up to the limit number to read specifies.
This input is optional. The default value is 0.0.
If the session mode is Frame Input Single-Point, you must leave timeout unwired (0.0). Because this mode reads the most recent value of each frame, timeout does not apply.

error in
Error conditions that occur before this node runs.
The node responds to this input according to standard error behavior.
Default value: No error

session out
An output that is the same as session in, provided for use with subsequent nodes.

data
This output returns an array of LabVIEW clusters.
For a Frame Input Single-Point session mode, the order of frames in the array corresponds to the order in the session list.
The elements of each cluster are specific to the LIN protocol.
For the Frame Input Stream session mode, LIN frames are read in their raw form, without interpretation of their elements using the database. For the Frame Input Single-point and Frame Input Queued session modes, information from the database is used to interpret the LIN frames for ease of use.
The following cluster description applies to session modes Frame Input Single-point and Frame Input Queued.

identifier
The LIN frame identifier.
The location of this ID within the frame depends on the value of event slot?. If event slot? is false, this ID is taken from the frame's header. If event slot? is true, this ID is taken from the first payload byte. This ensures that the number identifies the payload, regardless of how it was scheduled.
Regardless of its location, this is the unprotected ID, without parity applied.

event slot?
A Boolean value that specifies whether the frame was received within an event-triggered schedule entry (slot).
When this value is true, event ID contains the ID from the frame’s header.

event ID
The identifier for an event-triggered slot (event slot? true).
When event slot? is false, this value does not apply (it is 0).

echo?
A Boolean value that determines whether the frame was an echo of a successful transmit (true), or received from the network (false).

type
The frame type (decimal value in parentheses).
LIN Data (64) | The LIN data frame contains payload data. |
Log Trigger (225) | A Log Trigger frame. This frame is generated when a trigger occurs on an external connection (for example, PXI_Trig0). |
Start Trigger (226) | A Start Trigger frame is generated when the interface is started . |
LIN Bus Error (65) | A LIN Bus Error frame is generated when a bus error is detected on the LIN bus. |
LIN No Response (66) | A LIN No Response frame is generated when a header with no response is detected on the LIN bus. |

timestamp
This parameter represents the absolute time when the XNET interface received the frame (end of frame), accurate to microseconds.

payload
The array of data bytes for the LIN data frame.
If the frame payload is used within an event-triggered schedule entry (slot), the first byte of payload is the identifier of the frame in its protected form (checksum applied). This is required by the LIN standard even if the frame transmits in an unconditional or sporadic slot. For this type of LIN frame, the actual data (for example, signal values) is limited to 7 bytes.
For example, assume that frame ID 5 is received in an unconditional slot and an event-triggered slot of ID 9. When you receive from the unconditional slot, identifier is 5, event slot? is false, event ID is 0, and the first payload byte contains 5 with checksum applied. When you receive from the event-triggered slot, identifier is 5, event slot? is true, event ID is 9, and the first payload byte contains 5 with checksum applied. Regardless of how the frame is received, you can use the identifier to determine the contents of the actual payload data contents in bytes 2-8.
The following cluster description applies to session mode Frame Input Stream.

identifier
The identifier received within the frame's header.
If the schedule entry (slot) is unconditional or sporadic, this identifies the payload data (LIN frame). If the schedule entry is event triggered, this identifies the schedule entry itself, and the protected ID contained in the first payload byte identifies the payload.

event slot?
This element is not used. This element is false.

event ID
This element is not used. This element is 0.

echo?
This parameter uses the same semantics as the previous description for Frame Input Queued.

type
This parameter uses the same semantics as the previous description for Frame Input Queued.

timestamp
This parameter uses the same semantics as the previous description for Frame Input Queued.

payload
This parameter uses the same semantics as the previous description for Frame Input Queued.

unused payloads
This parameter is empty. No user input is needed.

error out
Error information.
The node produces this output according to standard error behavior.
Description
The data represents an array of LIN frames. Each LIN frame uses a LabVIEW cluster with LIN-specific elements.
The LIN frames are associated to the session's list of frames as follows:
- Frame Input Stream: Array of all frame values received (list ignored).
- Frame Input Queued: Array of frame values received for the single frame specified in the list.
- Frame Input Single-Point: Array of single frame values, one for each frame specified in the list.