Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

trigger an IMAQ device with an RTSI trigger from a DAQmx

Hi all,

 

I am generating a number of samples (which control movement in another part of my code) via DAQmx functions.  This works fine, but I would like to synchronise these movements and use them as triggers for capturing frames of a camera (PCIe-1427). 

 

My DAQmx channel is configured to write to a RTSI0 line and I have verifed that the outputted frequency is correct by oscilloscope. I am using IMAQ configure Trigger3.vi and am setting the type to RTSI.  However, I would like my camera to capture the same number of times as there are samples being generated (set by me).  In essence I would like my the samples and the image capture synchronised. 

 

Attached in a screenshot of my code.  Although there are other posts related to triggering of images, I wish to trigger an image capture with samples created within the code.  Is this possible?  Am I going about this is the right way?

 

Any help would be greatly appreciated!!

 

Miika

 

Ps. In MAX, I have set Tirgger Mode to Internal, Trigger Source to CC1, I have unticked the CC Lines source box and CC1 is set to External trigger 0.

0 Kudos
Message 1 of 7
(3,636 Views)

It seems like you have the IMAQ code set to trigger the start of the acquisition via RTSI, but from what you described you seem like you want to trigger each buffer individually. Perhaps just change the trigger constant from triggering the start of the acquisition to triggering each buffer?

 

Eric

0 Kudos
Message 2 of 7
(3,635 Views)

Hi Eric,

 

Thanks a lot for your reply.  I implemented what you suggested and although the code now seems to work (all 3 parts), they are out of sync.  I also have an optical switch in the mix! 

 

What I would like is for any one position**, the switch to switch between my two optical channels and also acquire an image of what each optical channel 'sees' at each position.  I have outputted the CO Pulse Frequency to my camera via RTSI (as described before) to my camera and to my switch (/Dev1/Ctr0Out) via the DAQmx channel node.

 

Besides declaring the trigger type to be RTSI as in the attached figure, I control the number of images by nested for loops for the number of A and B-scans desired. 

 

Please help!! Smiley Sad

 

**The number of samples generates the number of scanning positions - I keep track of these by calling then B-scans and A-scans, I am raster scanning mirrors.

0 Kudos
Message 3 of 7
(3,601 Views)

Hi Miika,

 

I realise it's been a week since the last post.  Are you still looking for help with your RTSI triggering or have you managed to solve the problem now?

 

Best Regards,

Oli
LabVIEW Student Ambassador
National Instruments UK
0 Kudos
Message 4 of 7
(3,562 Views)

Hi Oli,

 

Thanks for the reply.  Although I've now verified that the camera is being triggered (hardware 'external' trigger from counter output to TTL Trigger lines - no RTSI) I am still having difficulty obtaining an image per position.  To recap, if I have a counter output of frequency N, I would like N images (these samples correspond to mirror positions, I want to capture images at each position). 

 

I posted a frame timeout query here: http://forums.ni.com/t5/LabVIEW/Timeout-error-using-grab/m-p/1960051#M650437

 

and am currently trying to work though those issues.  If you would be so kind as to take a look and possible proffer some help, I would be very grateful.

 

Kind regards,

Miika

 

 

0 Kudos
Message 5 of 7
(3,559 Views)

Hi Miika,

 

Having a look through that other post, it looks like my colleague Alex is already on the case.  I'll go and have a chat with him, he will probably be able to reply to your last questions some time today.  It will be more efficient for one of us to work on the issue as we might overlap what we are suggesting if we both troubleshoot at the same time.

 

I'll give Alex my thoughts so he can work that into his reply.

 

Best Regards,

Oli
LabVIEW Student Ambassador
National Instruments UK
0 Kudos
Message 6 of 7
(3,550 Views)

Great, thanks Oli!!

0 Kudos
Message 7 of 7
(3,549 Views)