Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Using an external trigger, setting up the parameters

Since I haven't had any luck with advice on setting up a long integration time, I've decided to use an external trigger.  Now my issue is how to set up the acquisition parameters to match what it is I'm trying to do.  Specifically, TriggerMode and TriggerActivation. 

 

I use the function

IMAQdxSetAttributeCW(dxSession, "CameraAttributes::Trigger::TriggerMode", IMAQdxValueType32, xxx)

where 'xxx' is a value from 0-16

 

IMAQdxSetAttributeCW(dxSession, "CameraAttributes::Trigger::TriggerActivation", IMAQdxValueTypeEnumItem, yyy)

where 'yyy' is an enumerated type 0 or 1

I've defined

Dim yyy as IMAQdxEnumItem

 

 

 

Nowhere does it explain (at least that I've found) how to tie the descriptions in the NI-IMAQdx Help file to the integer values needed by the functions.

 

What I want to do is operate in Trigger Mode 1 and a Trigger Activation value of LevelHigh

 

When I pass the enumerated type, do I have to define it completely? Name and Value?  Or can I just define the value and then pass it?

 

Also,

IMAQdxSetAttributeCW(dxSession, "AcquisitionAttributes::BitsPerPixel", IMAQdxValueTypeEnumItem, zzz)

What is the value if I want to take either 8 bits or 12 bits per pixel (haven't decided which one I'd like yet)

 

 

Is there any other parameter, attribute, etc that I need to alter to use an external trigger?

 

I've got a TTL pulse that when 'high' the camera will begin integrating and continue to integrate until I reset the TTL pulse to 'low'.  Hence why I will be using Mode 1.

0 Kudos
Message 1 of 4
(7,276 Views)

Hi Timmkish,

 

I've taken a look at the documentation for the IMAQdx driver in VB6.  Through my searching I found the function IMAQdxEnumerateAttributeValuesCW.  This function will enumerate all of the possible values for the given attribute.  I would create an array of the data type that your attribute accepts then pass the pointer to that array into this function.  Be sure that the array is sufficiently large to fit all of the attribute values.

 

Using this array, you can use your camera's manual to confirm that you have selected the right value for the attribute.  You can do this for all of your attributes.

 

On your second question of passing an enumerated type into a function, you should be able to pass either the name or the value, but the Enumerate Attribute Values function will help you to determine which one is most accepted by the camera, as it will be what is populated in the array.

Stephen Meserve
National Instruments
0 Kudos
Message 2 of 4
(7,259 Views)

I've already looked at that array.  The answer I'm really looking for is where is there an explanation of how integers values (the value that is passed) are tied with the description of what triggering mode they are associated with.  i.e. a LUT

 

Second question.  Is there an acquisition fcn that I can call that basically says 'prepare for an incoming trigger, and when that happens acquire an image'

Right now I'm using a COM port to generate a TTL pulse and the following code will generate a timeout.

 

IMAQdxSnap

COM port HIGH

<pause for integration>

COM port LOW

 

Is there a fcn that will allow me to continue executing the following statements within the code so that the COM port fcn calls will trigger the acquisition?

0 Kudos
Message 3 of 4
(7,255 Views)

Hi Timmkish,

 

The array values correspondence to the triggering modes are determined by the camera manufacturer.  You will have to check the manual and resources for your camera to find out which integer values match up with the triggering modes.

 

On your second question, you can use IMAQdxConfigureGrab and IMAQdxGrabCW.  These functions will acquire images only when the camera sending them, that is, when it has been triggered. Remember that if you want to acquire more than one image (multiple triggers) you will need to place the IMAQdxGrabCW in a loop of some sort.  You may also want to investigate the waitForNextBuffer parameter of the function, which will cause the camera to wait for the next available buffer instead of taking the last acquired buffer.

Stephen Meserve
National Instruments
0 Kudos
Message 4 of 4
(7,251 Views)