viAssertTrigger
Purpose
Asserts software or hardware trigger.
C Syntax
ViStatus viAssertTrigger(ViSession vi, ViUInt16 protocol)
Visual Basic Syntax
viAssertTrigger&(ByVal vi&, ByVal protocol%)
Resource Classes
GPIB INSTR, GPIB INTFC, GPIB-VXI INSTR, GPIB-VXI BACKPLANE, PXI INSTR, PXI BACKPLANE, Serial INSTR, TCPIP INSTR, TCPIP SOCKET, USB INSTR, USB RAW, VXI INSTR, VXI BACKPLANE
Parameters
Name | Direction | Description |
---|---|---|
vi |
IN |
Unique logical identifier to a session. |
protocol |
IN |
Trigger protocol to use during assertion. Valid values are: Range GPIB, Serial, TCPIP, USB VI_TRIG_PROT_DEFAULT (0) VXI, GPIB-VXI VI_TRIG_PROT_DEFAULT (0), PXI VI_TRIG_PROT_RESERVE (6) |
Return Values
Completion Codes | Description |
---|---|
VI_SUCCESS |
The specified trigger was successfully asserted to the device. |
Error Codes | Description |
---|---|
VI_ERROR_INV_OBJECT |
The given session reference is invalid. |
VI_ERROR_NSUP_OPER |
The given vi does not support this operation. |
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_INV_PROT |
The protocol specified is invalid. |
VI_ERROR_TMO |
Timeout expired before operation completed. |
VI_ERROR_RAW_WR_PROT_VIOL |
Violation of raw write protocol occurred during transfer. |
VI_ERROR_RAW_RD_PROT_VIOL |
Violation of raw read protocol occurred during transfer. |
VI_ERROR_INP_PROT_VIOL |
Device reported an input protocol error during transfer. |
VI_ERROR_BERR |
Bus error occurred during transfer. |
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 unasserted). |
VI_ERROR_INV_SETUP |
Unable to start operation because setup is invalid (due to attributes being set to an inconsistent state). |
VI_ERROR_CONN_LOST |
The I/O connection for the given session has been lost. |
Description
The viAssertTrigger() operation sources a software or hardware trigger dependent on the interface type.
Software Triggers for 488.2 Instruments (GPIB, VXI, TCPIP, and USB)
This operation sends an IEEE-488.2 software trigger to the addressed device. For software triggers, VI_TRIG_PROT_DEFAULT is the only valid protocol. The bus-specific details are:
- For a GPIB device, VISA addresses the device to listen and then sends the GPIB GET command.
- For a VXI device, VISA sends the Word Serial Trigger command.
- For a USB device, VISA sends the TRIGGER message ID on the Bulk-OUT pipe.
Software Triggers for Non-488.2 Instruments (Serial INSTR, TCPIP SOCKET, and USB RAW)
If VI_ATTR_IO_PROT is VI_PROT_4882_STRS, this operations sends "*TRG\n" to the device; otherwise, this operation is not valid. For software triggers, VI_TRIG_PROT_DEFAULT is the only valid protocol.
Hardware Triggering for VXI
For hardware triggers to VXI instruments, VI_ATTR_TRIG_ID must first be set to the desired trigger line to use; this operation performs the specified trigger operation on the previously selected trigger line. For VXI hardware triggers, VI_TRIG_PROT_DEFAULT is equivalent to VI_TRIG_PROT_SYNC.
Trigger Reservation for PXI
For PXI instruments, this operation reserves or releases (unreserves) a trigger line for use in external triggering. For PXI triggers, VI_TRIG_PROT_RESERVE and VI_TRIG_PROT_UNRESERVE are the only valid protocols.
Related Topics