Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Need labview VI to grab and save triggered sequence firewire camera

I need to use Labview 8.5 to trigger a Firewire 1394 camera and save sequence of images to hard drive.  I am new to Labview, but created the VI routine shown below to operate the Toshiba Fire Dragon color camera.  I may have left out some wires in the VI. The VI works properly when slowed down in flashlight mode which is indicated by dim images due to the 1 ms time gate.  However, when I run the VI at full speed, the images are bright which indicates that the camera shutter is not limited by the gate.  Any suggestions? 
 
Thanks,
 
Ward
0 Kudos
Message 1 of 12
(8,842 Views)

Hi Ward,

If you are going to be developing applications to interface with firewire cameras from LabVIEW, I would highly recommend moving to IMAQdx instead of using the IEEE 1394 Legacy driver. IMAQdx is our most current driver and replaces the Legacy NI-IMAQ for IEEE 1394 driver in handling the low level interfacing with the firewire bus.

I took a look at the specs for the FireDragon camera here:

http://www.toshiba-teli.co.jp/english/ise/firedragon/pdf/FireDragon-color.pdf

The shutter mode, as well as the other camera attributes, should be settable through the “camera attributes” tab in Measurement & Automation Explorer (MAX). Have you tried changing the shutter settings in MAX, and then tried a snap there to test out the settings and see how it affects your image?You may have to adjust the acquisition rate along with the shutter speed to achieve the exposure and hence the brightness that you require.

These camera attributes that are accessible in MAX are also accessible in LabVIEW through the use of property nodes. Once you wire the camera session to the property node, you will be able to select “camera attributes>>attribute” and then right click on “Attr” to create an enumerated constant that will allow you to select which camera attribute you would like to set.

I’m also a little confused by what you mean by “1 ms time gate”. Are you referring to the trigger signal sent to the camera? I thought this would mean 1000 fps, but that doesn’t seem right, so I wanted to check and see what exactly you are referring to. If you are still having problems after adjusting the camera attributes, please post back and let me know what problems you are still running into, and I’ll try to help out.

___________________

Nate Holmes
Applications Engineer

0 Kudos
Message 2 of 12
(8,822 Views)

Nate,

 

Thanks for the response.  When I initially installed the firewire driver on the laptop (XP), I had to use an older driver to get the full 800 Mbps speed.  However, the NI driver is different.  I will see if I can find and install the newer NI 1394 driver.

I am using the triggered mode ( mode 1) with an external trigger input to the camera to control the exposure time.  This mode works fine with other VI's that I have tried such as "Triggered Grab" which was in the sample files.  However, this VI does not save any video or images.  I tried to combine 2 different sample VI's to produce a VI which will allow the camera to be triggered externally and then save a sequence of images to the hard drive.   This was the file I attached.  It apparently did work with an external trigger of 1 ms duration and produced a dim image because of the reduced exposure.  This was in the slow { flashlight) mode.  However, when I ran the VI in normal full speed mode, the image was bright indicating that the camera was not shuttered at 1 ms. 

The camera works fine using MAX and I can snap a still frame or view live video.  However, there is no control for an external trigger in the options.  Perhaps the new driver may provide this.

Ward

0 Kudos
Message 3 of 12
(8,817 Views)
Hi Ward,

Sorry that it's been a couple of days, I had to get some hardware together to test your VI. Unfortunately, I was unable to reproduce your problem with the dim images in highlight execution mode, but bright images when running the VI normally. I have made a few minor modifications to the VI that you sent so I could  modify the video modes. I used a Basler A601f firewire camera and triggered every 1ms with 1ms pulse width. I was able to save the images fine, and the images showed no difference between a grab in MAX, and acquiring with the VI in either normal or highlight execution mode.

I do not see how running in highlight execution mode could be changing the exposure time, because all of the acquisition is handled in the IMAQ Sequence.vi. SubVIs will run at normal speed unless you step into them in highlight execution mode, even though the main VI is running at a greatly reduced rate.

You may want to try exposing and changing the shutter properties of your camera with the IMAQ property node much the same way that I modified the Video Format , Mode, & Rate.

Best Regards,

~Nate H.
0 Kudos
Message 4 of 12
(8,776 Views)
Opps, Here is that VI.

~Nate H.
0 Kudos
Message 5 of 12
(8,775 Views)
Nate,
 
Thanks for the help.  I changed the driver in MAX to "NI-IMAQdx IIDC Digital Camera"  Now I can set the shutter parameters in MAX and grab video with the shutter working properly. 
 
I tried the Rev 1 VI that you created and could not get it to work with my camera.  Do I need to change on one of the blocks?  I get the error "Ni-IMAQ IEEE (Hex 0xBFF68010) Invalid format".
 
My VI still works the same way as before.  The shutter reduces the exposure in Highlight mode so that the image is dark, but the image is bright in normal run mode. 
 
Thanks,
 
Ward
0 Kudos
Message 6 of 12
(8,760 Views)
Ward,

You will have to change the VIs in your application from the NI-IMAQ IEEE 1394 driver VIs to the NI-IMAQdx driver VIs. I'm going to take a look at it myself and post back with the modifications once I verify again on my hardware here.

Best Regards,

~ Nate H.
 
0 Kudos
Message 7 of 12
(8,742 Views)
Hi Ward,

Sorry it's taken me so long to respond. I replaced the IEEE 1394 VIs with the corresponding DAQmx VIs, but the way that triggering is set up has changed between the drivers. In the IMAQ IEEE 1394 driver you could use the Configure Trigger VI, but now in IMAQdx trigger settings are controlled from property nodes. See the example "Triggered Grab" from the NI Example Finder under Hardware Input and Output>>IMAQdx>>Signal Input and Output for an example of how to modify trigger settings with the IMAQdx driver.

I started with this example, and then I modified it with pieces of your code. Hopefully it will give you a starting point to get your application working.

Best Regards,

~NH
0 Kudos
Message 8 of 12
(8,672 Views)

Nate,

Thanks for the help.  The new VI works with my camera to trigger and capture a sequence of images.  I tried trigger times ( exposure times) of 1 ms and 4 ms as shown in the picture attached of the file thumbnails.  There were 5 images at 1 ms and 4 images at 4 ms exposure and it is clear that the 1ms exposures were much darker as expected.  

 

Ward

 

0 Kudos
Message 9 of 12
(8,642 Views)

Dear Ward,

I'm glad that the VI works! As to the brightness of the image with a 1ms exposure time:

 How do you know what the expected brightness for a 1ms exposure time with your specific lighting conditions and camera is? Have you acquired an image under the same conditions with the same exposure that was much brighter? If this is the case, then you might look at adjusting the brightness setting under
"Camera Attributes " in MAX.

Hope this helps,

~NH


0 Kudos
Message 10 of 12
(8,632 Views)