PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to define a trigger to start a switch scanning task

I am writing a program in LabWindows/CVI using DAQmx library which handles PXI-2567 card. I have created a new switch scanning task, by the function DAQmxSwitchCreateScanList, that uses the specified scan list. I would like to start this task synchronously with the signal generated on one of trigger line. I thing, that this is possible using DAQmxSetTrigAttribute function where I can define the trigger type to start the task. Unfortunately, it only allows setting the type of trigger but is not clear for me, how can I set the source and edge type for the signal which will start the task.

 

PXI-2567 StartTrig.png

Best regards,

Miroslaw Koziol

0 Kudos
Message 1 of 6
(5,270 Views)

Hi Miroslaw,

 

If you are interested for a good example to send trigger to switch, you can browse through examples CVI provides and search for SwitchScan-SWTrig

 

This should solve your problem.

 

Kind regards

Ion R.

0 Kudos
Message 2 of 6
(5,255 Views)

Hi Ion,

 

The example SwitchScan-SWTrig do not answer my question how can I set the source and edge type for the signal which will start the switch scanning task. In the mentioned example source and edge type are set only for the advance trigger. Maybe these kinds of settings cannot be done for the switch scanning task but I would like to know that for sure.

 

Best regards,

Miroslaw Koziol

0 Kudos
Message 3 of 6
(5,253 Views)

Hi Miroslaw,

 

Let me see if I understood correctly what you are trying to achieve.

You have a switch scanning task and you want to trigger it with an external signal? Why exactly do you want to do that?


Will handshaking solve you issues? Because before any switching you should be sure that the measurement is done.

At the following link you can find a tutorial and some benchmarking handshaking measurement vs. software triggered.

http://www.ni.com/white-paper/3632/en

 

Kind regards,

Ion R.

0 Kudos
Message 4 of 6
(5,244 Views)

Hi Ion,

 

Below I will try, most clearly as I can, present a problem which I was struggling.

 

I have a system that consists of 3 PXI modules: PXI-4461, PXI-6653 and PXI-2567. One digital-to-analog channel on PXI-4461 generates sinusoidal signal which supply my DUT. I need to measure 2 voltages on DUT by one analog-to-digital channel on PXI-4461 (I know that PXI-4461 has 2 analog-to-digital channels but for various reasons such an approach cannot be applied). Each of the voltages must be measured by the integer number of periods and it has to be done continuously (for example 8 periods of one voltage and 8 periods of second voltage and so on). Therefore, a DDS on PXI-6653 is used to generate the signal which frequency is integer times smaller than the frequency of the supply signal. This signal is routed through the trigger line to PXI-2567 and controls the switch which alternately joins the measured signals to the analog-to-digital channel of PXI-4461.

 

The signal on DA channel must be generated continuously so this task is started and does not stop until the application is closed. Moreover, the generation is started synchronously with the rising edge of the signal generated by the DDS on PXI-6653. It is easy to start this task synchronously to the signal generated by the DDS because on PXI-4461 module a specialized trigger line for analog outputs exists.

 

The measurements done by the AD channel on PXI-4461 are started and stopped by the user of application. The start has to be done synchronously with the DDS signal. This is also not a problem because on PXI-4461 module a specialized trigger line for analog inputs exists. Unfortunately, I do not know how to start a switch scanning task in the same moment of time when the measurement task is started. If I do not do start these two task together I do not know which voltage samples I receive in my application.

 

Therefore, I need to know if is it possible to assign a trigger line to start the switch scanning task and set the source and edge type for this signal.

 

Best regards,

Miroslaw Koziol

0 Kudos
Message 5 of 6
(5,231 Views)

Hi Miroslaw,

 

I still believe the software trigger is the best to use for this tasks.

Basically, whenever you consider you read all the samples you are interested on a measurement point, you  can send a software trigger and start reading from the next measurement point.

 

I've found couple of examples, but they are in LabVIEW, however, the flow of programming will be the same.

 

You can have a look here: https://decibel.ni.com/content/docs/DOC-12515

 

Basically whenever the button will be pressed, there will be a software trigger sent and it will switch the measurement point accordingly to the list.

 

Kind regards,

Ion R.

0 Kudos
Message 6 of 6
(5,203 Views)