Programmatically Routing PXI Trigger Lines Across a Multi Segment PXI Chassis Primary Software: LabVIEW Development Systems>>Professional Development SystemPrimary Software Version: 8.2 Primary Software Fixed Version: N/A Secondary Software: N/A Hardware: PXI/CompactPCI>>Chassis>>PXI-1045, PXI/CompactPCI>>Chassis>>PXI-1006
Problem: Some NI PXI chassis, such as the PXI-1006 and PXI-1045 have multiple PCI bus segments. I can use the trigger routing software embedded in Measurement & Automation Explorer (MAX) to route PXI trigger lines across these segments, but this software does not allow me to change the trigger routes while the program is running. Is there a way to programmatically route the PXI trigger lines across PCI segments while my program is running? Solution: Yes, you can programmatically route the PXI trigger lines across PCI segments by using VISA version 3.1 or later. The method to route the PXI trigger lines is slightly different depending on whether you are using LabVIEW or a text-based API. Text-based API You will need to use the functions viSetAttribute() and viMapTrigger() to programmatically route the PXI trigger lines.
VI_ATTR_PXI_SRC_TRIG_BUS
VI_ATTR_PXI_DEST_TRIG_BUS These two attributes set the segments the trigger is mapped from (source) and to (destination). The parameter attrState is the segment number that is going to be the source or destination. The segments are numbered starting with 1 as the leftmost segment. On the PXI-1006 and PXI-1045 chassis the segments are numbered 1,2,3 going from left to right.
viStatus viMapTrigger(ViSession vi, ViInt16 trigSrc, ViInt16 trigDest,ViUInt16 mode)
The parameters should be set as follows: vi - use the session ID you already have from calling viOpen().
trigSrc and trigDest - pass it a value VI_TRIG_TTL0...7 representing the PXI trigger line you are routing. trigSrc and trigDest have to be the same number. mode - pass it VI_NULL Example: Below is an piece of example code that routes trigger line 3 to the right from segment 1. viStatus = viSetAttribute(viInstr, VI_ATTR_PXI_SRC_TRIG_BUS, 1); viStatus = viSetAttribute(viInstr, VI_ATTR_PXI_DEST_TRIG_BUS, 3); viStatus = viMapTrigger(viInstr, VI_TRIG_TTL3, VI_TRIG_TTL3, VI_NULL); Note: If you are routing outward from the center, you will need to call the viMapTrigger() function twice to route from segments 2»1 and then 2»3. LabVIEW To programmatically route the PXI trigger lines in LabVIEW you will need to develop a block diagram like the one below. This VI contains a VISA Resource Name constant, VISA Open VI, Property Node, and VISA Map Trigger VI.
To change the VISA Class to PXI Backplane, right-click on the VISA Resource Name constant and choose Select VISA Class » I/O Session » PXI Backplane (see notes below for finding the backplane resource name). You will now be able to access the properties Source Trigger Bus Number and Destination Trigger Bus Number with the Property Node. These properties specify the segment numbers that are going to be the source or destination of a PXI trigger line. The segments are numbered starting with 1 as the leftmost segment. On the PXI-1006 and PXI-1045 chassis the segments are numbered 1,2,3 going from left to right. To specify the PXI Trigger Line that is going to be routed, pass a value of 0...7 to the trigger source and trigger destination inputs of VISA Map Trigger VI. These inputs have to be the same number when passing PXI trigger lines on the PXI Backplane. The example above routes trigger line 3 to the right from segment 1. If you want to route Trigger bus 2 outward to the other trigger busses, similar to specifying "Away from Trigger bus 2", you will need to use the above code twice. You will need to first route Trigger bus 2 line 2 to Trigger bus 1 line 2 and then route Trigger bus 2 line 2 to Trigger bus 3 line 2. This will effectively route the trigger bus 2 out to the other trigger busses.
Note: To find the PXI Backplane Resource Name, first, make sure your chassis is identified correctly in MAX. Then, you have two choices for finding the Backplane resource name; you can open the VISA Interactive Control (found in MAX under Tools»NI-VISA), or you can use the VISA Find Resource function. Either way, you should find a resource that says something close to "PXI0::0::BACKPLANE". Enter that for the resource name in NI-VISA. In LabVIEW, you will need to right click on the control/constant and choose "Allow Undefined Names" in order to type the text in. Related Links: KnowledgeBase 2DKAUN00: PXI-1045 and PXI-1006 Trigger and Synchronization Facts KnowledgeBase 32GFMIWD: Routing PXI Trigger Lines Across the Buses of Multisegment PXI Chassis Attachments:
Report Date: 07/21/2004 Last Updated: 08/04/2007 Document ID: 3BK9FL0M |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
