04-15-2013 10:17 AM
I am having an issue with programming my usb 6009 in labview. I am attempting to continuously read analog inputs while also having an event driven digital output within the same program/vi. Basically, I need to continuously sample the analog inputs while having a user defined event (button control) to signal the digital inputs to turn on then off after a specified period of time. The digital output event needs to be independent of the analog sampling scheme. I have been throwing the 'resource already allocated error' in most of the vi's I have written trying to accomplish this. Is this programmatically possible with the usb 6009? I am at my wits end trying to accomplish this and any help would be greatly appreciated (by myself and my boss). Thank you for your replies in advance.
RJ
Solved! Go to Solution.
04-15-2013 10:37 AM - edited 04-15-2013 10:39 AM
it's posiible..what exactly do you need? can you post your vi...
04-15-2013 10:39 AM
I am not familiar with what you are asking. Here is a simple test VI I am working on to test my theory. It is throwing an exception right now.
04-15-2013 10:49 AM
Here is the same VI modified with some documentation to better explain. The second while loop drives the digital output, port0 will be given a 00000001 1D array which will bring line 1 high. Then I need to go and read some values from the associated analog input that is continuously being sampled in the other while loop. Is it starting to make sense? My apologies if I am being vague.
04-15-2013 10:54 AM - edited 04-15-2013 11:07 AM
04-15-2013 10:55 AM
It is now, please see updated VI.
04-15-2013 11:27 AM
Wow, I see you are reading from the analog input without creating the channel. I will try this approach and post my results. Thank you.
04-15-2013 11:31 AM
Apok,
What is the VI in the upper left that you are using?
04-15-2013 11:34 AM - edited 04-15-2013 11:54 AM
@surferEE wrote:
Wow, I see you are reading from the analog input without creating the channel...
What is the VI in the upper left that you are using?......
you still have to create a channel...that's just what it looks like when you want to unpack n generate code from the Daq express, have a look at the NI Example Finder under 'Hardware Input and Output' under Daqmx section(Analog Input/Voltage-Sw-Timed Input.vi and Digital Output/Digital-Sw-Timed Output.vi) ..it should follow as 'create channel(ouside loop), start task(outside loop), read and or write(inside loop) and 'clear task (outside loop)
04-15-2013 11:57 AM
I created the channel now I am not getting any readings on AI0-2. I have attached the VI. Thank you for your help Apok!