09-17-2010 09:35 AM
hello all,
I have a simple program... 2 analog inputs cmg in from a single DAQ device... ai0,ai1.. i have created two seperate tasks, channels and all, but both the structures run
under the same while loop, and hence, the program gives me an error at the DAQ input"The specified resource is reserved. The operation could not be completed as specified.
"
I have attached the VI as well... how should I code this? I dont want the 2 channels operating simultaneously... they should have individual control... should I go for an event structure/???
09-17-2010 09:56 AM
They have to be in the same task. You have a single DAQ card with a single A/D converter and a single convert clock. There is simply no reason you can't combine both channels in your example.
09-17-2010 10:06 AM
Here is how you do it. You need to set your global Virtual channels into an aray. Then flatten then for the task. Then input to the start.
09-17-2010 10:07 AM
Here is the 8.0 version. I did not see that before I posted it.
09-17-2010 10:58 AM
Hey, thanks alot...:) how did you get it to run/??I tried to select two channels to the input... but couldnt get any waveforms on the chart...
should I change the channel constant to control/???I am attaching the snapshot...please see...
09-17-2010 11:47 AM
I do not have your channels on my computer so you will need to set then in the array or change it to a control and add then to the array.
09-17-2010 12:21 PM
An alternative to using an array of channels and the Flatten to String vi, you can wire in a string to the Create Virtual Channels vi with the channel names separated by commas, such as "Dev1/ai0,Dev1/ai1,Dev1/ai2" or you could use a colon to notate a range of channels, such as "Dev1/ai0:2". This is the same as having an array of the 3 channels and flattening to a string.
09-17-2010 02:01 PM
alrite guys, thanks a lot for your advice... i shall try it out now and let you know...
09-17-2010 02:05 PM
@aeastet wrote:
I do not have your channels on my computer so you will need to set then in the array or change it to a control and add then to the array.
i did try tat.. but could not see anything on the graph... did you get this code to run//?//?/
09-17-2010 02:19 PM - edited 09-17-2010 02:20 PM
hello all,
SORRY to bump again into the thread... I could get the previous VI to work.... Now i went ahead and build another VI in which
i am reading analog and digital I/O from 2 different DAQs in the same while loop...
I RAN THE CODE, the analog input ran properly, however got and error in analogoutput and the digital output as
"Internal Software Error occurred in MIG software. Please contact National Instruments Support"
Please check the VI i have atached and can please tell me what is wrong in it/??/