viAssertTrigger
Syntax
viAssertTrigger(ViSession vi, ViUInt16 protocol);
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.
For a PXI resource, viAssertTrigger is not currently supported. Support is planned for a later release of Agilent VISA.
Note: This function is not supported with the GPIB-VXI interface.
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: 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. |
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 Codes |
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 |
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_TRIGGER description
for details on trigger specifiers.