11-22-2016 05:38 AM
Hi,
I'm trying to develop a VI containing a fast timed loop doing some internal calculations and a DAQ Assistant to output one of those values to an NI9263 in a cDAQ9188 chassis. I'm having problems with the output step slowing down the loop.
I've attached examples of some of the things I've tried, with a much simplified model in the fast timed loop (there's more in my loop, but it's not relevant to the question):
I've also tried including the DAQ Assist in the main loop (which slows it down) and in an internal while loop with a timed execution (faster, but it's noticeably slows on the output steps).
I think what I really want is a LIFO queue, or a single length queue that drops previous value when full. Are either of those possible? Is there something else I should be doing?
Sorry - this is my first VI. If I'm making silly design decisions, suggestions for alternatives would be most welcome too.
Thank you, Paul
11-22-2016 06:36 AM
Before trying anything else, learn how to program DAQmx properly. DAQ Assistant is not an efficient approach, good for slow tasks and prototyping, but not for serious applications.
11-22-2016 06:38 AM
EngineerPaul wrote: or a single length queue that drops previous value when full.
If you only care about the latest value being written to your analog output, then the options I would consider (in no particular order) would be a Global Variable, Notifier, or a Channel (if you have LabVIEW 2016).
However, from what I am seeing in your code, you would be better off with a cRIO and let the FPGA do all of this work.
11-22-2016 07:07 AM
In addition to the sources that Blokk indicates, my all-time favorite (which isn't on his list, don't know why) is Learn 10 Functions in NI-DAQmx ..., which clearly shows you how to go beyond the DAQ Assistant and simplify, speed up, and rationalize your DAQ code.
Bob Schor
11-23-2016 05:32 AM - edited 11-23-2016 05:33 AM
Thank you all for the suggestions.
A cRIO would be lovely but, sadly, I have to make do with what I have - I'm only developing something to control some lab test equipment for a short-term test campaign: the budget is limited and the timescales are short.
Thank you for the suggested reading - I'm make time to read those, and continue working through the core courses.
I'm certain that any one of the suggested solutions would have worked. In the end, I discovered the lossy queue block, so I've used that with a single element queue. Almost certainly not the most elegant or efficient solution, but sufficient for my test rig, I think.
Once again, many thanks! Paul
11-23-2016 09:22 AM
@EngineerPaul wrote:
A cRIO would be lovely but, sadly, I have to make do with what I have - I'm only developing something to control some lab test equipment for a short-term test campaign: the budget is limited and the timescales are short.
Being the engineer I'm sure I'm preaching to the choir, but that reminds me of a modified conversation I have with management.
Stable
Short timeline
Low Cost
...
Now pick two.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord