Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

1394 slow when opening port or changing shutter speed

Hello,  
I'm using 4 Guppy cameras  off 1 firewire board and this is my problem.   When I use imaq1394cameraopen2 it takes 700msec to open the camera port.   When I use imaq1394setattribute it takes about 900msec to change shutterspeed on the camera.   This is way too long.  I'm not sure if this is a hardware or software issue.  I have this same application with same hardware setup in another country and it's much faster than this.  Looking through the forums I got some ideas and tried a couple things that either didn't work or got worse.   I changed the async delay in the registry from 5msec to 1msec, but this didn't make much of a difference.  I also change the packet size of the 4 cameras to 1024 instead of 4096.   This made the cameras about 200msec slower.   Is there something in the configuration file or registry that could cause this problem?     I need some help.
0 Kudos
Message 1 of 56
(5,252 Views)
I had a unexplained breakthrough this morning.  After running a few parts through the machine all of a sudden I saw the camera ports opening at 100msec and setting the shutterspeed attributes took 390msec.   I went into NI's MAX under devices and when I click on each camera device the reaction time is much faster than yesterday.  I believe this tells me there isn't anything in my sourcecode that caused the slow camera access time, because I now notice a difference from yesterday in the speed MAX accessing the cameras.  I still need to find out what caused this, because I'm sure it will come back to bite me again.  Anybody have any ideas why yesterday MAX would be slow to open the firewire camera whenever I click on the Legacy camera device?  But this morning MAX is quick to open the firewire camera device.  Between last night and this morning, I did NOT modify my source code, registries, or camera configuration.   I did NOT modify or change any hardware.   I also did NOT re-boot the computer.  What kind of Gremlins could cause this?
 
0 Kudos
Message 2 of 56
(5,228 Views)
Hi delphi Dan,
 
I am glad that you have things up and running again. I dont think we put anything in the registry that slows down these calls. Was your PC running another task in the background yesterday. Virus scans usually slow down other programs. You should try using the new IMAQdx driver and see if it speeds up things further.
 
To get to the bottom of the issue, you should try starting with only one camera on the card and adding other cameras one by one.
 
Also, the imaq1394setattribute causes the acquisition to stop and change values in memory. This might be the reason for the long execution time. If there is a register on the camera that controls shutter speed then you can write to it directly using the imaq1394WriteBlock function.
 
Jaidev Amrite
National Instruments
0 Kudos
Message 3 of 56
(5,224 Views)

I have more information to help debug this problem.   I double checked and do NOT have virus software or any other software running in background.    I have found a way to make MAX real slow again though.   I re-booted the computer and went into MAX to select Legacy cameras.  NO cameras showed up in list.  So I unplugged Firewire from Hub and rebooted computer again.  Once computer was up and running I plugged Firewire back into Hub.    I then went into MAX to select Legacy cameras and the 4 cameras showed up.  But when I select a camera it is very slow to connect.  I am back to where I was yesterday now.   I suppose if I wait long enough the slow connect problem will heal itself again.    Man, this is frustrating.

 

0 Kudos
Message 4 of 56
(5,222 Views)
Looking through the forum I ran across something interesting.    There is a patch for Windows XP service pack 2 for a firewire  decreased performance issue.  I am using XP with SP2.    Has anyone in NI confirmed that this is a problem?
0 Kudos
Message 5 of 56
(5,216 Views)

Hi delphi Dan,

This might be a reason for the delayed response from the cameras. Here is a KnowledgeBase article that suggests a work around: http://digital.ni.com/public.nsf/allkb/2243D57B9EEF22B686256FB7005E23C1?OpenDocument

Another possible (probably simpler) workaround is this: http://www.pcanswers.co.uk/tips/default.asp?pagetypeid=2&articleid=37466&subsectionid=609&subsubsect...

Please let me know if one of these hacks works for you.

Thank You,

Jaidev Amrite

National Instruments

0 Kudos
Message 6 of 56
(5,194 Views)
Dan,

I might be able to offer some advice. I imagine that you forgot to restart the driver when you changed the settings. When you changed the AsyncTransferDelay from 5ms ot 1ms, did you
a) restart your computer?
or
b) Close all your programs and unplug all your cameras before replugging them?

The registry settings are loaded when the first device instance is loaded. That means when the system first boots up or when the first device is plugged. It might be that you changed the registry but inadvertently did not restart the driver.

The AsyncTransferDelay is an artificial mechanism to delay register access on the camera to remain backwards compatible with older camera firmware. From my tests with the Guppy, I can recommend that you could drop the delay all the way down to 0ms as the camera is quite capable of handling back to back register transactions. Be sure to fully restart the driver to notice the effects.

Hope this helps,

JohannS
0 Kudos
Message 7 of 56
(5,124 Views)
This is where I am at with this problem.  The slowness is still a problem with my equipment in Mexico using Windows XP Sp2.   I have now duplicated the problem at my bench with a Windows XP Sp2 setup.   I created a very simple VB project that goes through a For-Loop and changes shutter speed a bunch of times.  I log the time it takes to change shutter speed.  It takes around 700msec for each change of shutter speed. 
 
JoanneS -  I did what you said but it didn't make a difference.
 
JamRite - I looked at the 2 links these were the results.  Making the change in the registry didn't work.   After installing the Prosilica patch things got worse.  The camera wouldn't even show up in MAX.   I noticed an error on  the PCI firewire board in device manager.  So I uninstalled and reinstalled to get rid of error.  I rebooted and went back into MAX, but still not cameras show up.   I then deleted all associations to Guppy camera in registry and 1394/data/ directory.  This normally gets me back to square one with installing the legacy driver in MAX.    Camera still won't show up in MAX.
 
Any ideas?   
 
These are my next steps
1) Uninstall MAX IMAQ and reintall IMAQ to see if the camera will show up again in MAX  If still doesn't  Then
                2) Go back to initial
 
0 Kudos
Message 8 of 56
(5,048 Views)
This is where I am at with this problem.  The slowness is still a problem with my equipment in Mexico using Windows XP Sp2.   I have now duplicated the problem at my bench with a Windows XP Sp2 setup.   I created a very simple VB project that goes through a For-Loop and changes shutter speed a bunch of times.  I log the time it takes to change shutter speed.  It takes around 700msec for each change of shutter speed. 
 
JoanneS -  I did what you said but it didn't make a difference.
 
JamRite - I looked at the 2 links these were the results.  Making the change in the registry didn't work.   After installing the Prosilica patch things got worse.  The camera wouldn't even show up in MAX.   I noticed an error on  the PCI firewire board in device manager.  So I uninstalled and reinstalled to get rid of error.  I rebooted and went back into MAX, but still not cameras show up.   I then deleted all associations to Guppy camera in registry and 1394/data/ directory.  This normally gets me back to square one with installing the legacy driver in MAX.    Camera still won't show up in MAX.
 
Any ideas?   
 
These are my next steps
1) Uninstall MAX IMAQ and reintall IMAQ to see if the camera will show up again in MAX  If still doesn't  Then
                 2) Go back to initial
 
0 Kudos
Message 9 of 56
(5,048 Views)
This is where I am at with this problem.  The slowness is still a problem with my equipment in Mexico using Windows XP Sp2.   I have now duplicated the problem at my bench with a Windows XP Sp2 setup.   I created a very simple VB project that goes through a For-Loop and changes shutter speed a bunch of times.  I log the time it takes to change shutter speed.  It takes around 700msec for each change of shutter speed. 
 
JoanneS -  I did what you said but it didn't make a difference.
 
JamRite - I looked at the 2 links these were the results.  Making the change in the registry didn't work.   After installing the Prosilica patch things got worse.  The camera wouldn't even show up in MAX.   I noticed an error on  the PCI firewire board in device manager.  So I uninstalled and reinstalled to get rid of error.  I rebooted and went back into MAX, but still not cameras show up.   I then deleted all associations to Guppy camera in registry and 1394/data/ directory.  This normally gets me back to square one with installing the legacy driver in MAX.    Camera still won't show up in MAX.
 
Any ideas?   
 
These are my next steps
1) Uninstall MAX IMAQ and reintall IMAQ to see if the camera will show up again in MAX  If still doesn't  Then
                 2) Go back to initial hard
 
0 Kudos
Message 10 of 56
(5,051 Views)