Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

IEEE 1394 Camera Trigger Mode 1 Problem

Solved!
Go to solution
Hello!

Yes I agree with you that this is stupid problem, because you can't do anything while you have enabled triger mode. This is wery unpractical.
Please, do something on that problem. Please, NI explain me how shpuld we use this mode?

Regards!
0 Kudos
Message 11 of 32
(4,070 Views)

Hi danilo,

    Thank you for your patience.  Currently this functionality is not available.  It has been suggested a few times, and I will let R&D know that it is requested by our customers, but the best way to ask for a product or feature is to make a product suggestion.  You can do so here: http://digital.ni.com/applications/psc.nsf/default?openform

    Also, there is a possible workaround by creating similar behavior with a case structure.  If you place a case structure inside of a loop, the case structure can have two cases; one for triggered acquisition and one for normal acquisition.  By having a short timeout on the trigger, the user can select which case to go to - whether the acquisition waits on a trigger or not.  It's not identical but it may work for you.  Thank you again!

-Allison S.

Applications Engineering

-Allison S.
Calibration Services
Product Support Engineer
0 Kudos
Message 12 of 32
(4,052 Views)
Hello!

Thanks for reply.

I can understand that. But in case that I start in triger mode and than I have to make some change on application parameters I have to wait on started triger and then I can do the thing wich was important for me. Sometimes you'd like to stop triger mode after triger mode was started. At the moment I have to use CTRL+ALT+DELETE to stop my aplication.

This is wery problematic and this limits usability of this control al lot. By my opinion this is a bug.

Best regards!


0 Kudos
Message 13 of 32
(4,044 Views)
Solution
Accepted by danilo
The VB implementation is very synchronous by nature. That means once you have started calling GetImage or Grab, you are waiting for a buffer. Until a buffer arrives or a timeout occurs, there is no way to stop the acquisition. So in order not to block in this synchronous environment, try not to call GetImage unless you have to. Here is my suggestion.

Configure your acquisition the same way you would normally do. Next you start the acquisition loop. Instead of calling (and blocking) into GetImage or Grab, try polling the last transferred buffer number. This is done by calling GetAttributeCW with the attribute IMG1394_ATTR_LAST_TRANSFERRED_BUFFER_NUM. If the buffer number has changed since the last poll, then go ahead and call GetImage or Grab and do processing as normal. If the buffer number has not changed, then sleep for a short duration (1ms). The short sleep is very important as not to spin your CPU waiting for a frame to arrive. This way you will be able to handle frames when they arrive, but also be able to exit immediately when you want to.without driving a trigger.

Hope this helps,

JohannS
0 Kudos
Message 14 of 32
(4,031 Views)
Hello!

So if I understand you corectly the trigering will be anyway done by external triger into internal buffer of camera. Then after the image is acuired the buffer number will increase.
I'll try that and see what will hapen. I hop that will help me to solve this problem, but I have to test it first.

Thanks for oyur solution.

Best regards!


0 Kudos
Message 15 of 32
(4,017 Views)
Hello!

This solution with IMG1394_ATTR_LAST_TRANSFERRED_BUFFER_NUM. looks good, bot I have AVT Marlin camera F-145C2
and it always says that this is unreadable atribut. Any other idea?

Regards!

Danilo
0 Kudos
Message 16 of 32
(3,948 Views)
Hello!

Sorry it works ok.

Thank you.

Regards!

0 Kudos
Message 17 of 32
(3,946 Views)
Hello!

Now I have diferent problem! I have specified this acquisition as we talk earlier.

  lintErrorCodeIMG = imaq1394ConfigureAcquisitionCW(sid, 0, 100)
  lintErrorCodeIMG = imaq1394StartAcquisition(sid)

The problem is that now I can acquire only 100 pictures and then system stop. How
should I initiate image acq that I can acquire unlimited number of pictures?

Regards!

0 Kudos
Message 18 of 32
(3,799 Views)

Danilo,

    If you go to Start >> Programs >> National Instruments >> Vision >> Documentation there is a help file for IMAQ 1394 functions.  Within it you can search for these functions and find out exactly what they do.  For the imaq1394ConfigureAcquisitionCW() function, there is an explanation for the parameters.  The second and third parameters determine how your camera acquires images.  As it says in the help, "continuous parameter: Set this parameter to 1 for a continuous acquisition. bufferCount parameter: For a non-continuous acquisition, this parameter specifies the number of images to acquire. For a continuous acquisition, use this parameter to specify the number of buffers the driver uses internally."  So if you set the second parameter to 1 it will acquire continuously, instead of stopping after a certain number.  Let me know if you have more questions!

-Allison S.
Calibration Services
Product Support Engineer
0 Kudos
Message 19 of 32
(3,785 Views)

Hello!

 

Problem still exist. Now the situation is folowing. I have set up buffer to 21 pictures. Then I acquire 21 pictures normally with trigering and then 

for next 21 acquisitions there is no image acquired and then after 21 ignored images, normal acquisition proces is operating normaly. After that 

all this is repeating...

 

Please any info?

 

Regards!

 

 

0 Kudos
Message 20 of 32
(3,182 Views)