10-26-2010 12:48 PM
Hi there,
I have a vi that uses serial-to-usb connections, to acquire data and control external machines. I added a "subcode" to use a webcam for monitoring, it worked fine. then I added another "subcode" to communicate with a USB6009 daq to acquire an analog voltage. So now I can either acquire video from the webcam, or acquire voltage from the daq, but not both. And it's not me who decides what to acquire, it is the vi, the first run it acquires video and ignores the daq (voltage graph is empty), when I abort and run the vi again, it ignores the webcam, and acquires from the daq.
All this happens with no errors.
P.S. the first time I ran this VI it worked properly with video and daq, and that was the only time!
Anyone knows what's happening?
10-26-2010 01:15 PM
Update: If I separate the webcam module and the daq module in two different VIs and run these two VIs at the same time I have no problem.
Only when they are in a single VI daq does't work.
10-27-2010 05:26 PM
Can you post your code? I'd be curious to see if your 'subcode'-which appear to be subVIs are essentially fighting for resources.
10-28-2010 11:38 AM
hi StephanieO
Unfortunately I cannot post the complete code (NDA agreement) but I will post different parts of these modules, that should give you an idea about the libraries I used.
11-10-2010 11:31 AM
Still no answer for this thread.
However I noticed something strange, when I run the VI, the program prompts to choose a camera, as usual, and the daqmx VI runs for about 1 sec (I can see it on the graph, it stops acquisition after 1 sec), and the camera feed works normally. I tried to disconnect the daq to see what would happen, I had nothing (no errors) and the vi kept working as if nothing happened, when I reconnected the daq, while the vi was still running, the daqmx module started working and acquiring data, and the camera feed was still working also.
Anyone have any idea about what's happening?
Any help is much appreciated.
11-10-2010 12:42 PM
Hi,
I think I got a similar problem with an application using a DLL. I was able to run my VI the first time and the times after, the behavior of the DLL's function wasn't correct until I closed LabVIEW completly ("Including Getting Started" Menu) and start the application again.
I tried to close DLL references on closing but it didn't helped me.
After that, I tried to build an executable version of my VI and my problem kinda solved by itself.
No one could tell me why.
However, when you close an exe, you are sure that all references and data saved in memory are cleared, so I tried that option.
I don't know how LabVIEW manages references and data in memory between different "runs" with a VI that use a DLL, however, having my VI as an exe instead solved my problem.
Maybe you could check this out.