NI-XNET API for LabVIEW and C

XNET Write (State LIN Diagnostic Schedule Change).vi

  • Updated2023-11-11
  • 4 minute(s) read
 XNET Write (State LIN Diagnostic Schedule Change).vi

XNET Write (State LIN Diagnostic Schedule Change).vi

Purpose

Write a request for the LIN interface to change the diagnostic schedule. You can use this XNET Write VI with any input or output session for LIN.

Format

Inputs

session in is the session to use for the diagnostic schedule change. This session is selected from the LabVIEW project or returned from the XNET Create Session VI. The session must use a LIN interface.
diagnostic schedule is a ring (enumerated list) with the following values:

String Value
Null 0
Master Request 1
Slave Response 2


This specifies which diagnostic schedule the master executes:
  • Null: The master does not execute any diagnostic schedule. No master request or slave response headers are transmitted on the LIN.
  • Master Request: The master executes a diagnostic master request schedule (transmits a master request header onto the LIN) if it can. First, a master request schedule must be defined for the LIN cluster in the imported or in-memory database. Otherwise, error nxErrDiagnosticScheduleNotDefined is returned when attempting to set this value. Second, the master must have a frame output queued session created for the master request frame, and there must be one or more new master request frames pending in the queue. If no new frames are pending in the output queue, no master request header is transmitted. This allows the timing of master request header transmission to be controlled by the timing of master request frame writes to the output queue.

    If there are no normal schedules pending, the master is effectively in diagnostics-only mode, and master request headers are transmitted at a rate determined by the slot delay defined for the master request frame slot in the master request schedule or the nxPropSession_IntfLINDiagSTmin time, whichever is greater, and the state of the master request frame output queue as described above.

    If there are normal schedules pending, the master is effectively in diagnostics-interleaved mode, and a master request header transmission is inserted between each complete execution of a run-once or run-continuous schedule. This happens as long as the nxPropSession_IntfLINDiagSTmin time has been met, and there are one or more new master request frames pending in the master request frame output queue.
  • Slave Response: The master executes a diagnostic slave response schedule (transmits a slave response header onto the LIN) if it can. A slave response schedule must be defined for the LIN cluster in the imported or in-memory database. Otherwise, error nxErrDiagnosticScheduleNotDefined is returned when attempting to set this value.

    If there are no normal schedules pending, the master is effectively in diagnostics-only mode, and slave response headers are transmitted at the rate of the slot delay defined for the slave response frame slot in the slave response schedule. The addressed slave may or may not respond to each header, depending on its specified P2min and STmin timings.

    If there are normal schedules pending, the master is effectively in diagnostics-interleaved mode, and a slave response header transmission is inserted between each complete execution of a run-once or run-continuous schedule. Here again, the addressed slave may or may not respond to each header, depending on its specified P2min and STmin timings.
error in is the error cluster input (refer to Error Handling).

Outputs

session out is the same as session in, provided for use with subsequent VIs.
error out is the error cluster output (refer to Error Handling).

Description

You can use the XNET Write (State LIN Diagnostic Schedule Change) VI with any XNET session mode, as long as the session interface is LIN. Because the schedule change applies to the LIN interface, it can apply to multiple sessions.

According to the LIN protocol, only the master executes schedules, not slaves. If the XNET Session Interface:LIN:Master? property is false (slave), this write function implicitly sets that property to true (master). If the interface currently is running as a slave, this write returns an error, because it cannot change to master while running.

Use the XNET Write (State LIN Diagnostic Schedule Change) VI to transmit master request messages and query for slave response messages after node configuration has been performed. Node configuration should be handled using the XNET Write (State LIN Schedule Change) VI. Wire the node configuration schedule defined for the LIN cluster into that VI so that it is the first schedule executed for the LIN. Refer to the description for the XNET Write (State LIN Schedule Change) VI for more information about using it to perform node configuration.

Log in to get a better experience