07-20-2018 08:09 AM - edited 07-20-2018 08:10 AM
Hello,
I am currently trying to combine the data acquisition results from a 28 thermocouple NI cDAQ 9174 and 4 other sensors (2 of which are ifm TA2114 and the others are ifm SM6004). I am running the cDAQ directly to my computer via a USB and the other 4 are being sent through the PLCs to a OPC and finally to the datasocket blocks in labview. In short, the data is successfully coming in and being sent to a database I have set up on another laptop.
The problem: The process is incredibly slow. I am fairly new to LabVIEW and was wondering if there was anything I could do within the code to speed things up. I realize without the sensor set up the program cant be run but perhaps there is something that can be observed. Any help would be much appreciated.
Solved! Go to Solution.
07-22-2018 10:59 AM
Suggestion -- arrange your VIs so that the Error Line only runs left-to-right without doubling back on itself (making it difficult to tell "Who Runs First?").
I've not done much with cDAQ, so I may be completely wrong about this, but I'm used to having three different DAQ devices (cDAQMod1, cDAQMod2, and CDAQMod4) have their own DAQmx Tasks, not all bundled together on the same Task wire.
Your While Loop only does a single DAQmx Read, as the Task is Cleared after the data are read. So the longer you run the loop, the slower the acquisition speed will appear to be (N bytes / longer time = slower rate).
Bob Schor
07-22-2018 09:03 PM
@Bob_Schor wrote:
I've not done much with cDAQ, so I may be completely wrong about this, but I'm used to having three different DAQ devices (cDAQMod1, cDAQMod2, and CDAQMod4) have their own DAQmx Tasks, not all bundled together on the same Task wire.
With cDAQ, the chassis is in control of the sample clock. Most cDAQ chassis have a few clocks, so you can have multiple tasks per chassis. But you can also use that same sample clock (task) with multiple modules.
I have not tried this either, but you can supposedly use a single task for multiple X-series DAQ cards that are in the same PXI chassis (the clocks are somehow automatically routed through the PXI backplane). So the world of a single task per device is slowing going away.
07-23-2018 03:30 AM - edited 07-23-2018 03:49 AM
Hey Franz,
Welcome to the Forum! I looked at your VI and noticed two things:
A possible solution to this limitation is to lower the rate of your readings to 3.5Hz. If this is not suitable for your application, you need more/faster input modules.
Please note:
07-23-2018 04:24 AM - edited 07-23-2018 04:39 AM
@Bob_Schor wrote:
I've not done much with cDAQ, so I may be completely wrong about this, but I'm used to having three different DAQ devices (cDAQMod1, cDAQMod2, and CDAQMod4) have their own DAQmx Tasks, not all bundled together on the same Task wire.
As long as it is only one task, it works. However, Franz, you can shorten the Channel selection even more: By using a selector string like "cDAQ1Mod4/ai0:3, cDAQ1Mod2/ai0:3, cDAQ1Mod1/ai0:15", you can fit all the modules with J type thermocouples into one Create Channel VI (also see: NI-DAQmx Syntax for Specifying Physical Channel Strings). As the other one uses type K, you need to have that one separately.
Even more information on Channel Expansion here: Channel Expansion Explained
Also, this is a caveat in your current code: There is no order specified in which the three Type J Create Channel VIs (no type wired means standard, here it is "J") are processed, so you never know in which order the read VI will output the channels. In case you need the know the order it is a nasty bug. Use the Task wire as well as the error wire to set up an order (like you did with two of the VIs already).
@Bob_Schor wrote:
Your While Loop only does a single DAQmx Read, as the Task is Cleared after the data are read.
Am I missing something or were you fooled by the DAQmx Clear Task.vi's position?
08-20-2018 04:21 AM
I really appreciate the time you took to respond to my problem that helped a great deal. Thank you