08-11-2005 01:16 PM
08-12-2005 01:32 PM - edited 08-12-2005 01:32 PM
Hi Peter-
It sounds like you are off to a good start with LabVIEW and NI-DAQmx. Let me see if I can address your questions:
1. The parallel architecture is not appropriate for DAQ operations. The card can only run a single input operation at a time, so you are sacrificing task setup and programming time by seperating your tasks into seperate loops. The NI-DAQmx driver will also create an error and will not operate further if there is conflict between parallel loops in trying to access the analog input circuitry of the board at the same time. You would be better advised to combine all the operations into a single loop. It sounds like you're using the DAQ Assistant, so it shouldn't be hard to simply add more channels to a single DAQ Assistant Express VI. I have attached a quick example that shows how to split the outputs to multiple graphs
2. The gaps are likely caused by the occurrence of errors between "competing" loops. Unless you are passing error data between the loops they may fail independently and produce gaps in operation that are otherwise inexplicable.
3. If you are using NI-DAQmx 7.5 (actually NI-DAQmx 7.4 or later) you can be assured that the readings are set to scan between channels as quickly as the hardware can physically produce accurate readings. If you would like to slow down this behavior (i.e. increase the interchannel delay) you can set the Convert Clock rate manually in a the DAQmx Timing Property Node using the Convert Rate property:
4. A great discussion of Convert and Scan Clock can be found in this KnowledgeBase. To summarize, the Scan Clock rate runs at the sampling rate you request and initiates a scan of all the channels in the task. The Convert Clock runs several times faster (as described in the article) and actually clocks individual readings from each channel in a scan.
Hopefully this helps-
Message Edited by Tom W. on 08-12-2005 01:32 PM
08-12-2005 02:37 PM
Hi Tom,
Thank you first for your reply. I've retested my program based on your recommendation and it worked! But now I have a dilemma. As I mentioned before, I will be using this NI system to monitor multiple independent systems (machines if you will). I maybe wrong since there might be a workaround that I didn't know, but I think what you're recommending (put all into one while loop) creates data dependencies. For example, if ai0 measures pressure for MachineA and ai1 measures pressure for MachineB, and something in the program for MachineB has an error, I don't want the whole While Loop to stop monitoring MachineA or other subsystems. Do you have recommendation on how I can accomplish this? I've thought about ONE big loop with one DAQmx in it feeding data into multiple separate While loops (these sub while loops are inside the big while loop) but I'm not sure how I should set the timing for each while loop. Thanks again for the help
08-15-2005 09:32 AM
Hi Peter-
If you use the DAQ Assistant to monitor signals from several channels and one signal drops off or is incorrect you do not need to worry about the other channels- they will continue to monitor the signals and incorrect data will only be returned for the channels that are not functioning properly.
Your suggestion to split the operations into several loops within one large overall loop can be somewhat ill-advised because of the fact that you have little control over the overall program functionality- if one of the "small" loops fails inside the large loop you will have to stop all of the other loops before you can restart the failed loop because of the nature of While loop operation in LabVIEW.
I would recommend that you combine all readings into a single DAQ Assistant and simply split the signals as we discussed previously. This will be the easiest method and certainly the most reliable.
Hopefully this helps-
08-15-2005 09:50 AM