High-Speed Digitizers

cancel
Showing results for 
Search instead for 
Did you mean: 

Triggerred Acquisition using a Local variable

Hello,

 

I am using a PXI 8110 controller with the following configuration: 5122, 5421 and 6221 cards. I am developing a closed loop control program for a general PI controller. I would like to trigger my digitizer (PXI 5122) upon a change of variable in the controller program.

 

Basically, I have a timing loop for the controller and another case structure which initiates acquisition. I am attaching the code for your reference. In the code, if the boolean "Start Acquisition is ON" then the acquisition case structure has to start acquiring. Once it acquires 1 million samples at a sampling rate of 25 MHz it should switch ON the boolean "Step". After this is switched ON, the digitizer has to acquire another million samples.

 

Current situation is that, the acquisition loop gets started, acquires a million samples, and switches ON the boolean variable "Step" and finally before acquiring another million points it starts over again and it becomes an infinte loop. I would like the case structure which starts the acquisition loop to run only once. It should not get refereshed for every iteration of the timing loop above.

 

The parameters I use in the front panel for the variables are:

 

Period = 30 ms

Reference = 0

Propertional Gain = 0.05

Integral Gain = 0.05

Tau = 2

Number of Samples = 1000000

 

Thanks for your help in advance.

 

Santosh Kodandarama

 

 

Regards,
Santosh R Kodandarama
Missouri S&T
0 Kudos
Message 1 of 2
(5,810 Views)

Hi Santosh,

 

Since your case structure is only executing once, you could make it a subVI and place it inside of your timed loop.  When your timed loop iterates, it will check for the Start Acquisition to see if it needs to execute or not.  If false, it will do nothing.  Since it only happens once, it will go through the iterations and start your two record acquisition.  I'm unsure why you need the Step variable, you could just use a sequence structure if you are worried about timing. 

 

The case structure you have right now is not in a loop, so the case selector terminal is only checked once before it decides to go into the case or not.  I'm unsure why you are seeing the case structure loop forever, and if you can narrow down where the looping occurs that may help out here.

Kyle A.
National Instruments
Senior Applications Engineer
0 Kudos
Message 2 of 2
(5,793 Views)