From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Threads

How do I run 10 devices simultaneously, get data and close simultaneously?
0 Kudos
Message 1 of 11
(3,704 Views)
A little information on the types of devices would be helpful. Serial, DAQ, GPIB?
0 Kudos
Message 2 of 11
(3,694 Views)
 
Hi TooNew,
 
Nice name 😉
 
From the title of this thread, I assume that you want to create multiple threads doing the same thing, is that so?
 
Since I do not want to assume, then I'll ask a few questions.  🙂
 
1)  Define 10 devices running simultaneously:  do you mean within a certain tolerance in time (1 to 10 ms, or more, 100 ms?) or do you mean real-time (at the very same time)
 
2)  Getting data:  same question as above 1).  Getting the data and doing what?  ie, storing it into an array, what size, ect; or saving to harddrive?
 
Close simultaneously:  same question as 1).  Does it have to close simultaneously?  - probably same behaviour as open, right?  Do you need to open, get data, close, fro the 10 threads, and then repeat the process, such as in a data log application?  Or do you want to run tests on 10 UUT's at approximately the same time so that they start together, run the tests, log data and then close the 10 UUT's at the end..
 
Sorry for asking so many questions, I am simply trying to get a better understanding of what you are trying to achieve in order to provide more accurate advice.  😄
 
JLV
 
 
😄
Message 3 of 11
(3,690 Views)
This test is using 10 cameras connected via USB. I want all ten cameras to start at the same time, take picture at the same time then stop. 
0 Kudos
Message 4 of 11
(3,683 Views)
TooNew,
 
Nice project.  Very interesting indeed. 
 
How do the cameras capture the image?  In other words, is it via sw?  Do they supply any drivers, API, dll's, etc that allows external (you own) sw development?  I suspect that these cameras are controlled by sw which takes care of taking the picture.   If the camera came with drivers that allows to develop your own sw control (or even API's / dll's), then you're on your way to a solution
 
Also start by doing a search on USB, LV & Camera.  I think someone in the past attempted to control a USB carema directly using LV. 
 
Do the cameras have internal buffering for capturing the image?  Can you take an image, then transfer the binary over USB? 
 
The tricky part is synchronizing the capture.  Do you have LV-RT?  If not, then you may have to deal with some small (ms) delay between the captures...  It appears that you want all 10 cameras to capture the image at the exact same time, is that correct?
 
Sorry for yet more questions,
 
JLV
 
LV-RT = LabView-RealTime

Message Edited by JoeLabView on 01-16-2006 12:58 PM

Message 5 of 11
(3,681 Views)
The capture and store will be SW controlled. I do not have LV-RT?
Yes i want to capture the images at the same time or as close as i can get.
0 Kudos
Message 6 of 11
(3,674 Views)

Hi TooNew,

There is an IMAQ add-on to LV that you can use.  It still does not solve the concurrent captures, but lets' find solutions along the way to get you there.

Here is the link to the IMAQ download:

http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=ED6942DF78E34659E034080020E74861

Here is what is does:

With NI-IMAQ for USB Cameras, you can:
- Acquire images from any USB imaging device with DirectShow support
- Choose between one-shot or continuous image acquisition
- Configure cameras programmatically (now includes the ability to programmatically select video modes without a popup dialog)
- Acquire directly into Vision Assistant for easy application prototyping

You will need this dll "ImaqDirectShowDll.dll" (which may be part of the download at the above link)

Here is an interesting thread on USB Camera (and a bit on control of it):

http://forums.ni.com/ni/board/message?board.id=170&message.id=142637&view=by_date_descending&page=1

Below is a link that has an example of a capture (using webcam?), it also has a driver which may be useful.

http://forums.ni.com/ni/board/message?board.id=170&message.id=157943&query.id=41725#M157943

 

BTW, what camera (type of) are you planning to use?

Hope this starts to help,

JLV

Message Edited by JoeLabView on 01-16-2006 03:07 PM

Message 7 of 11
(3,661 Views)
Hi

Not sure I'm on the right thread since my IMAQ USB on portuguese XP is running, but as you say "now includes the ability to programmatically select video modes without a popup dialog" I wonder how, cause I already linked that pin to the iteration value in a while loop (for ~400 cycles) and the captured video keeps the same size (there are plenty of them through the property page).
Also, I'd like to keep the video settings after a VI stops and runs again - it always reverts to the default resolution.

Thanks in advance

Luis Cardoso
0 Kudos
Message 8 of 11
(3,545 Views)

Hello Luis,

We do have a Machine Vision Forum that is monitored by Vision Supporters, you can refer to this forum for future questions about imaging.

As for the rest of your question about selecting Video Modes, can you please provide some more information about what you are doing?  Which VI are you trying to use?  Are you trying to perform a grab or a snap from the camera?  The default resolution is probably something that is stored on the camera, there may be some documentation for setting this property and making that the default.  As for linking the pin to the iteration terminal.  I assume that you're trying to change this property with each frame, and I suspect that this is not something you can change in the middle of the acquisition, so it would not change with each loop iteration unless you stop and start the acquisition each time.

I hope that this helps, if you have more questions, let me know.

Regards,

Angela
Applications Engineer
National Instruments

0 Kudos
Message 9 of 11
(3,502 Views)
Hello Angela,

Basically I started with the example "Grab with property page.vi". Then I put a while loop around it (keeping only the imaq create and destroy out of it), so the loop, slowly but correctly, starts and stops each usb session, each one started with a different video mode integer. However the captured picture always looks the same despite the several sizes I can see if manually select one from the video mode page (attached file). For testing purposes I'm using a Trackercam driver, which generates an image if no real input is given. In the end I'll switch to an USB video digitizer, but I still can't find a way to change their defaults.
In the past I used Webcam Continuous Capture.vi from a library available at http://www.cs.unc.edu/~parente/labview. It provided no video configuration but, once I set the capture mode in virtualdub (I don't know how to access to the video properties unless using similar programs) it would become the "default", and always capture on that size. Now that I can set it manually from inside labview it always returns to some factory default which I don't know how to change or programatically overide.
I may have to accept that my drivers don't respond to the asked video mode, but is that video mode a number as simple as 1, 2 or 3 or 160, 240, 320 or 640 (which I tried w/o success) or is it something more complicated? How can I find which number corresponds to each mode?

Thank you
Luís Cardoso
0 Kudos
Message 10 of 11
(3,486 Views)