VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Running different IO cards at different rates

Solved!
Go to solution

Hi,

 

I have a PXI systems with 2 PXIe-6363 MIO cards and 3 PXIe-4331 strain/bridge modules.

 

Inputs and outputs from one of the 6363 cards are used in a model that runs at a higher rate - 10kHz.

 

Inputs from all other cards are used in other models that run at a lower rate - 2kHz.

 

Is it possible to set up the cards in system configuration to different sample rates? One of the 6363 cards to sample at 10kHz, and the other 6363 cards and the 4331 cards to sample at 2kHz?

 

If I set the system rate to 10kHz, the 4331 cards will not work, since their max rate in hardware-timed single input mode is a bit over 2000Hz.

 

Thank you.

 

Siva

0 Kudos
Message 1 of 7
(2,478 Views)

You can configure other channels as Waveform Task at different sample rates.

Select the execution rate of the model as the sample rate of HWTSP DAQ task to time the PCL, then configure the rest as waveform task. However, the waveform task is mainly for logging purpose only. You would need Waveform-Processing-Custom-Device if you want to map the waveform data to channels.

Senior Technical Support Engineer | CLD CTA | NI


DISCLAIMER: The attached Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system, or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense

Message 2 of 7
(2,469 Views)
Solution
Accepted by mvsiva

Hi Siva,

Yes, it is possible, but is requires some coding on your side. You'd have to write an Asynchronous Custom Device wrapping the fast (or slow) IO and (for fast IO) the model in question. Asynchronous CD's can run faster than the PCL - see https://zone.ni.com/reference/en-XX/help/372846M-01/veristandmerge/asynchronous_cds/

 

I have some code that does it, but I am not allowed to share it, unfortunately... Good luck!

Piotr F.
Hardware Engineer @ ZF
0 Kudos
Message 3 of 7
(2,466 Views)

Thank you. Is the concept similar to what Piotr is suggesting below?

0 Kudos
Message 4 of 7
(2,437 Views)

Hi Piotr,

 

Thank you for your reply. 

 

If using an asynchronous CD for the fast IO, would the MIO card for fast IO be initialized and used within the CD, and does not have to be set up in the Veristand System Definition? Essentially, that hardware is managed entirely by the CD, and not Veristand?

 

Siva

0 Kudos
Message 5 of 7
(2,436 Views)

Hi Siva,

 That's right. You create DAQmx sessions in the Custom Device and manage it there. Depending on how you write the Custom Device configuration, the device may or may not exist in the System Definition (I can think of having a configuration part that allows for adding devices selected from the SDF, for example, but it's not a hard requirement).

 

 In this case you'll have to wrap a model into the same Custom device too, because Veristand will be passing channels around with slower rate.

 

 Also hopefully your model is in LabVIEW - if it's Simulink or something else, Model Interface Toolkit is a bit tricky to compile into an LLB, because there is (was?) a name clash between two VIs in it... 

 

 One thing I remembered is that this approach required reserving a CPU core on my controller entirely for the fast loop purposes - so if you have a 2-core controller, it might not be feasible (leaves you essentially with a single core for other uses). 

 

 The other way around involves making a Custom Device for slow IO and running it with decimation...

 

 The solution proposed by ZY_Ong also involves a Custom Device - however in his proposal, the configuration is managed in Veristand and the data is not acquired single-point (as in my proposal), but in waveforms. It might be feasible if your model allows being fed with batches of data. It's also more CPU-efficient. To be honest, we're in process of converting the old solution with single-point fast loop to the waveform solution, but our "model" is just a bunch of data processing and statistics, not a real plant/process model.

 

 The rest depends on you... 🙂

Piotr F.
Hardware Engineer @ ZF
Message 6 of 7
(2,427 Views)

Hi Piotr,

 

All of that makes sense.

 

My fast model is a simple PID type controller, so I can do that in LabVIEW. For this reason, I am not sure Zy_Ong's waveform solution would fit this application. 

 

My PXI controller has 4 cores, so hopefully that is ok.

 

I'll see how it plays out regarding seeing the fast IO card in the Veristand System Definition.

 

Thank you again.

 

Siva

 

 

0 Kudos
Message 7 of 7
(2,417 Views)