LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with adding voltage ai channel to an existing task - LabVIEW

I am using the Cont Acq Strain Samples (with Calibration).vi which ships with LV as the basis for a vi I need to monitor n channels of strain gauges (1/4 bridge type I) combined with another channel of a user defined voltage channel (pressure, temperature etc).  Everything works fine when I use the strain null option but I am having problems when I include the shunt cal option.  I am defining the strain channels then building the strain task using DAQmx Create Virtual channel.vi followed by the strain null opton then the shunt cal option (so far just like the example).  I then have the option to add a user defined voltage input, again using the DAQmx Create Virtual Channel.vi, (selected from a list of predefined configurations).  Everything is fine so far.  I then send the task to the sample clock vi (continuous samples) and then to the DAQmx Start Task.vi then into a while loop where the DAQmx Read (Analog 1D Wfm Nchan Nsamp) resides.  I then display (and record) the acquired waveform signals at a fairly low rate.  If I am only doing the strain null on the strain channels everything is fine but if I have included the shunt cal on the strain channels, the data becomes mixed up or is in some way corrupted that I have not put my finger on yet.  I get no error messages.  Additionally, if I don't include the additional voltage input task and only use strain channels everything is fine.  I have looked at the shunt cal vi's and cannot see any way that adding another channel to the task list can cause this problem.  I am emphasizing that the strain null and shunt cal are done prior to including the voltage ai channel to the task.  I am using an SCXI-1520 (for strain gages) and an SCXI-1121 (oher signals) with a SCXI-1600.   I have also attached the .llb for this.  I am probably missing something basic but sometimes those basic misconceptions can be the hardest to find.  Any ideas?
0 Kudos
Message 1 of 2
(2,436 Views)
Yep, something basic.  Apparently in the Shunt Cal subvi the task is executed to acquire a set of actual strain readings which are then used to calculate a percent of theoretical strain values.  Anyway, the task is started and then stopped (not deleted).  Apparently it is taboo to add a channel to a task that has already been executed, which I think makes sense.  I'm just not sure why I didn't get an error message istead of the thing going along its merry way while spitting out garbage.  To correct this I simply broke the shunt cal vi up and executed the part that ran the task after adding the non-strain channel to the task.  Works fine now.
0 Kudos
Message 2 of 2
(2,422 Views)