viAssertTrigger

Syntax

viAssertTrigger(ViSession vi, ViUInt16 protocol);

This function is not supported with the GPIB-VXI interface.

Description

Assert software or hardware trigger. This operation will source a software or hardware trigger dependent on the interface type. For a GPIB device, the device is addressed to listen and then the GPIB GET command is sent.

For a VXI device, if VI_ATTR_TRIG_ID is VI_TRIG_SW, the device is sent the Word Serial Trigger command. For any other values of the attribute, a hardware trigger is sent on the line corresponding to the value of that attribute. For a GPIB device, if VI_ATTR_TRIG_ID is VI_TRIG_SW, the device is addressed to Listen and a Group Execute Trigger (GET) is sent.

For a serial session to a serial device or TCPIP socket, if VI_ATTR_IO_PROT is VI_PROT_4882_STRS, the device is sent the string "*TRG\n". Otherwise, this operation is not valid. For a session to a USB instrument, this function sends the TRIGGER message ID on the Bulk-OUT pipe.

For GPIB, ASRL, USB, and VXI software triggers, VI_TRIG_PROT_DEFAULT is the only valid protocol. For VXI hardware triggers, VI_TRIG_PROT_DEFAULT is equivalent to VI_TRIG_PROT_SYNC.

Keysight VISA applications operating PXI trigger line reservations/routes must be written to behave cooperatively by heeding the response status codes when reserving a trigger bus segment. If your application attempts to reserve a PXI trigger line and receives a returned status code indicating it is already reserved, then your application must conclude that there is another application that has reserved this line, and cooperate by avoiding use of that trigger line.

If a process does not release its trigger reservations or trigger routes, these reservations/routes will persist after the process ends. They will only be cleared when another application releases the reservations/routes, or when the PC is restarted.

Keysight Connection Expert provides a Chassis Triggers view, which allows you to view existing trigger reservations/routes and make new reservations/routes (for the purposes of prototyping or troubleshooting). See the IO Libraries Suite Help (IO Control application) for more information.

Parameters

Name

Dir

Type

Description

vi

IN

ViSession

Unique logical identifier to a session.

protocol

IN

ViUInt16

Trigger protocol to use during assertion. Valid values are:

VI_TRIG_PROT_DEFAULT

VI_TRIG_PROT_ON - asserts the trigger

VI_TRIG_PROT_OFF - deasserts the trigger

VI_TRIG_PROT_SYNC - pulses the trigger (assert followed by deassert)

VI_TRIG_PROT_RESERVE - reserves the PXI trigger

VI_TRIG_PROT_UNRESERVE - releases the PXI trigger reservation

For GPIB, ASRL, USB, and VXI software triggers, VI_TRIG_PROT_DEFAULT is the only valid protocol. For VXI hardware triggers, VI_TRIG_PROT_DEFAULT is equivalent to VI_TRIG_PROT_SYNC. For PXI, VI_TRIG_PROT_RESERVE and VI_TRIG_PROT_UNRESERVE are the only valid protocols.

Return Values

Type ViStatus

This is the function return status. It returns either a completion code or an error code as follows.

Completion Code

Description

VI_SUCCESS

The specified trigger was successfully asserted to the device.

Error Code

Description

VI_ERROR_BERR

Bus error occurred during transfer.

VI_ERROR_CONN_LOST

The I/O connection for the given session has been lost.

VI_ERROR_INP_PROT_VIOL

Device reported an input protocol error occurred during transfer.

VI_ERROR_INV_PROT

The protocol specified is invalid.

VI_ERROR_INV_SESSION
VI_ERROR_INV_OBJECT

The given session or object reference is invalid (both are the same value).

VI_ERROR_INV_SETUP

Unable to start operation because setup is invalid (due to attributes being set to an inconsistent state).

VI_ERROR_LINE_IN_USE

The specified trigger line is currently in use.

VI_ERROR_NCIC

The interface associated with the given vi is not currently the controller in charge.

VI_ERROR_NLISTENERS

No Listeners condition is detected (both NRFD and NDAC are deasserted).

VI_ERROR_NSUP_OPER

The given vi does not support this function.

VI_ERROR_RAW_RD_PROT_VIOL

Violation of raw read protocol occurred during transfer.

VI_ERROR_RAW_WR_PROT_VIOL

Violation of raw write protocol occurred during transfer.

VI_ERROR_RSRC_LOCKED

Specified operation could not be performed because the resource identified by vi has been locked for this kind of access.

VI_ERROR_TMO

Timeout expired before function completed.

See Also

VI_ATTR_TRIG_ID attribute. Set this attribute to the trigger mechanism/ trigger line to use.
VI_EVENT_TRIG description for details on trigger specifiers.