06-22-2011 06:38 AM
LV 2009 (yes, 2009, I'm stuck on that for this project).
NI-DAQmx 8.9.5
Using SIMULATED cDAQ devices: Module 4 is a 9201, module 6 is a 9237
Attached is a VI, below is the code.
The first operation adds 5 plain voltage channels from module 4 to a task.
If I disable the subsequent channel operations, all is well.
I can read channels 0-4, and they are all a large sine wave with a bit of noise on top: the typical simulated signal.
If I enable ONE of the module-6 channels (Custom Voltage with Excitation), then I can read chan 0-3 OK, but chan 4 has turned into just noise. Not garbage (unliimited random stuff) but limited noise: No sine wave. The new chan 5 is good: a much smaller sine wave with noise on top.
If I enable TWO of the mod-6 channels then I can read chan 0-2 OK, but chan 3-4 have turned into just noise. The new chans 5-6 are good.
If I enable THREE of the mod-6 channels, then I can read chan 0-1 OK, but chans 2-4 have turned into just noise. The new chans 5-6-7 are good.
If I change the first op to read only 3 channels, then the same thing happens: the first module 4 channel kills the LAST module 6 channel, etc.
If I change the first op to read all 8 channels, then the same thing happens: the first mod-4 chan kills the LAST mod 6 chan, etc.
There are no errors reported.
Is there something wrong with combining these two modules in one task?
Is there a problem with the simulation?
Blog for (mostly LabVIEW) programmers: Tips And Tricks
06-22-2011 07:42 AM
FWIW - I tried this in LV 2010 with the same results.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
06-23-2011 03:21 PM
When you create multiple tasks, you should have them as separate parallel wires. Don't wire your the task out on the Create Task to the input of another task. Each Create Task should be independent with independent configuring, and then it's start/read/stop operation. Check out Figure 1 in http://zone.ni.com/devzone/cda/tut/p/id/3021 . Although that article deals with synchronization which isn't necessary for you, the parallel tasks is demonstrated nicely.
06-23-2011 03:32 PM
Don't wire your the task out on the Create Task to the input of another task.
Not sure what you mean. Those are CREATE CHANNEL functions I'm calling, and the point of them is to ADD a CHANNEL to an existing (or new) task.
I want ONE task that combines the voltage channels and the strain-gauge channels, and I READ the task to get all the channels together.
If it's not legal to add a channel to an existing task, then I should get an error, and the input TASK INPUT would be worthless.
The weird thing is, it seems to work on the real hardware (with 4 voltage + 1 strain). At least my client hasn't complained and it's an important channel.
But it looks like I can't trust the simulation.
Blog for (mostly LabVIEW) programmers: Tips And Tricks