
3020-XX-UM
ProDAQ 3020 USB2.0 VXIbus Slot-0 Interface User Manual
Page 42 of 60
Copyright, © 2003 Bustec Production Ltd.
3.5 Using VXIbus and Front Panel Trigger Lines
One feature, that differs the VXIbus from other busses, is its ability to use trigger signals to
communicate with instruments in real-time, to share clock signals, etc. The VISA library
implements functions to control those trigger lines from your application.
3.5.1 Using VXIbus Trigger Lines
The VISA standard implements the function viAssertTrigger together with the attribute
VI_ATTR_TRIG_ID to assert and de-assert trigger lines on the VXIbus or sending the
word serial trigger command to message-based devices.
Figure 35 - Sending a Trigger Pulse
Figure 35 shows an example for sending a trigger pulse to a device. The function
viSetAttribute is used (
) to set the attribute VI_ATTR_TRIG_ID to select the trigger line.
In general the trigger ID can be set to VI_TRIG_TTL0 to VI_TRIG_TTL7,
VI_TRIG_ECL0/VI_TRIG_ECL1 or VI_TRIG_SW. For the setting VI_TRIG_SW, the device
is sent the word serial trigger command, the other settings correspond to the VXIbus
trigger lines TTL0-TTL7 and ECL0/ECL1.
To send the trigger, the function viAssertTrigger is used in the example (
) with the
“protocol” argument set to VI_PROT_DEFAULT. The interpretation of this argument
#include <visa.h>
main (int argc, char **argv)
{
ViStatus status;
ViSession rm_session;
ViSession instr_session;
ViChar descr[256];
/* open a session to the resource manager */
if ((status = viOpenDefaultRM (&rm_session)) != VI_SUCCESS)
{
/* error handling as shown in the previous examples !*/
}
/* open a session to the instrument */
if ((status = viOpen (rm_session, “VXI0::2::INSTR”,
VI_NULL, VI_NULL, &instr_session)) != VI_SUCCESS)
{
/* error handling as shown in the previous examples !*/
}
/* defining the trigger line to use */
if ((status = viSetAttribute (instr_session,
VI_ATTR_TRIG_ID, VI_TRIG_TTL0)) != VI_SUCCESS)
{
/* error handling as shown in the previous examples !*/
}
/* send a trigger pulse to the device */
if ((status = viAssertTrigger (instr_session, VI_TRIG_PROT_SYNC)) != VI_SUCCESS)
{
/* error handling as shown in the previous examples !*/
}
/* close the sessions to the instrument and the resource manager */
viClose (instr_session);
viClose (rm_session);
}
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com