Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

USB 6009 lock-ups?

Hello,
 
I'm having a strange problem with my newly aquired USB 6009. I've written an app to read the temperature from a temperature controller using the 6009 and that all works fine. However, the problem comes when I port this code into another application. The code is intended to run in a parallel loop to the main execution loop, to continuously read the temperature whilst other data is captured and process (all done in the main loop). Both applications run quite happily when separate. When I bring them together the applications sometimes, but not all the time, refuse to quit and just lock up. I have no idea what is happening as it is not a case of one loop remaining running (I've tried separate stop buttons) and they will run together quite happily. The problem only comes when I hit the button that terminates the main loop (this also triggers the other loop to stop - I'm sure this bit works as I've used the same method in another vi).
 
The main loop should, in theory, just close. The loop with the USB reads (using DAQmx Base) will stop and then clear the task (DAQmx Base Clear I think). Sometimes the DAQmx Base Clear runs and the program stops fine, other times it runs and the program locks, other times it locks as soon as I hit the quit button.
 
Any thoughts as I'm completely stumped on this one? Like I say, apart from the one button triggering both loops to terminate there is no link between the two loops.
 
My only thought is it could be a USB issue as the PC also has a USB keyboard and mouse. I know from my home experience, when for instance plugging in my camera, it can cause the USB to lock if, say, my USB modem is running.
 
 
0 Kudos
Message 1 of 12
(4,129 Views)
Apologies for the double post - my PC glitched as I hit send and managed to post twice! Not a good day...
0 Kudos
Message 2 of 12
(4,123 Views)
You say, "The code is intended to run in a parallel loop to the main execution loop". Do you mean that it is multi-threaded? The DAQmx Base ReadMe says, "All APIs:
NI-DAQmx Base is not multi-thread safe. In LabVIEW, use the error cluster to force execution order. In C, use only one thread to make API calls; especially for task/channel creation and deletion."

Is that relevant?
John Weeks

WaveMetrics, Inc.
Phone (503) 620-3001
Fax (503) 620-6754
www.wavemetrics.com
0 Kudos
Message 3 of 12
(4,117 Views)

Yes it is multi-threaded Smiley Mad

I didn't realise there was a problem with this so I guess a bit of a re-think is called for. Oh well... thanks for that.

0 Kudos
Message 4 of 12
(4,109 Views)
Hmmm... where did you find this info again? I've checked the readme and it doesn't mention it in there. Also been onto NI and they can't find it either, plus they don't know what the problem is
0 Kudos
Message 5 of 12
(4,101 Views)
John: Can you tell me where you have come across the information that states Base isn't thread safe? I can't see it in any readme.
0 Kudos
Message 6 of 12
(4,100 Views)
Found it. Looks like its in the MAC and linux readme but not Windows, although it should as it's the same for Windows.
0 Kudos
Message 7 of 12
(4,099 Views)
Yes, I use DAQmx Base on Macintosh and Windows. I do most of my real work on the Macintosh, so that's where I was when I quoted the Readme.
John Weeks

WaveMetrics, Inc.
Phone (503) 620-3001
Fax (503) 620-6754
www.wavemetrics.com
0 Kudos
Message 8 of 12
(4,092 Views)
Yup - got a bit confused as there's no mention of it in the Windows readme. Oh well...
 
As a quick note, I've managed a work around by basically creating two vi's and passing the data to a global that both then reads. This seems to have sorted it, although it's not really how I'd like things to work.
0 Kudos
Message 9 of 12
(4,078 Views)

To DPS

I have read this thread and a bit confused now.

Is it possible to use AI and AO (or AI DO)in the same VI simultaneously?

Can you give us a sample of code how you overcome the problem?

I was using FieldPoint hardware before a bit so I have no experience abou DAQ programming so I would appreciate any comments and help.

Thanks. Sergey.

0 Kudos
Message 10 of 12
(4,045 Views)