PDA

View Full Version : URGENT-[dmk 42buc03 + question + LabView]



abikutn
June 17, 2013, 02:22:53
I got my dmk 42buc03. I have a few questions.


How do I know the external trigger is working using the IC image capture SDk (from imaging source on windows 7)
When every trigger occurs, where does the image go ?
If for every trigger there is an image, how do I get to store it on my computer (using LabView) ?
How can I capture 2 or more images continously when a trigger occurs ?


Please provide any working examples with this camera in LabView.

PS:

LabView version : 11.0 (professional )

Stefan Geissler
June 17, 2013, 10:21:32
How do I know the external trigger is working using the IC image capture SDk (from imaging source on windows 7)
There is no special function, that returns true, if the trigger is enabled.

When every trigger occurs, where does the image go ?
This depends on your program. If the property "LiveCaptureContinuous" is set to true, then each incoming image will be saved in the ring buffer automatically.
Please refer to:
http://www.imagingcontrol.com/en_US/support/documentation/activex/prop_descICImagingControl_LiveCaptureContinuous.ht m
http://www.imagingcontrol.com/en_US/support/documentation/activex/prop_descICImagingControl_ImageBuffers.htm

If for every trigger there is an image, how do I get to store it on my computer (using LabView) ?
See above

How can I capture 2 or more images continuously when a trigger occurs ?
You can not. The trigger is intended to expose exact one image at the point of time the trigger pulse occurs.

abikutn
June 17, 2013, 17:06:39
Hello Stefan,




This depends on your program. If the property "LiveCaptureContinuous" is set to true, then each incoming image will be saved in the ring buffer automatically.
Please refer to:
http://www.imagingcontrol.com/en_US/support/documentation/activex/prop_descICImagingControl_LiveCaptureContinuous.ht m
http://www.imagingcontrol.com/en_US/support/documentation/activex/prop_descICImagingControl_ImageBuffers.htm

You can not. The trigger is intended to expose exact one image at the point of time the trigger pulse occurs.

I understand what you tried to explain. So if a trigger event is detected all frames are copied to the ring buffer automatically. After an image has been copied completely to a buffer, an ICImagingControl.ImageAvailable event is sent. But, I dont see anything that is ImageAvailable among the labview properties. Please advise me which property among these should I use to get an image that is captured when an trigger occurs so that I can view it on my system or save it on my system.

Here is a snapshot of the properties:

1576

Abhi.

abikutn
June 17, 2013, 23:36:46
Here is the labview program I developed.

I face two main issues:

1. If I have the trigger input to my camera and click on "Trigger_Control" button I am able to see an Image (Select Triggered output TAB )
2. If I remove the trigger cable to the camera and click on "Trigger_Control" button I am still able to see an Image

How do we know if the camera is actually capturing images with trigger ?

My LabVIEW VI : http://sdrv.ms/14GEyTd

Please advise


Abhi

Stefan Geissler
June 18, 2013, 09:47:44
Hello Abhi,

first of all, I am not a LabVIEW user. Therefore, I would like avoid to have a look into the VI, but I will do, if there is no way around this.

Therefore, please explain, what "Trigger_Control" is.

Thank you in advance!

abikutn
June 19, 2013, 02:13:18
Hello Stefan,

The main goal for me right now is to develop a LabVIEW program that captures images when an external trigger occurs. I read your previous posts regarding this and it seems its a little tricky to realise external trigger in labview, Could you please provide me with a working example of external trigger in labview.

The problem with the example program Trigger.VI is it gives me a Image when the user clicks on External trigger control irrespective of whether the trigger cable is connected or not. At this point the user doesnt know if the camera is actually working with external trigger or NOT.

And you havent still answered how can I get the ImageAvailable EVENT you mentioned in this post earlier. How can I do it with LabVIEW.
If you could give me an exact algorithm for obtaining images on external trigger, It would be greatly appreciated.



Hello Abhi,

first of all, I am not a LabVIEW user. Therefore, I would like avoid to have a look into the VI, but I will do, if there is no way around this.

Therefore, please explain, what "Trigger_Control" is.

Thank you in advance!

My main objective.


I have a motor that moves a translational stage in one direction. Lets say X direction.

After every step of this motor , I call the external trigger program (please see the algorithm of this program below).

My algorithm for the program with external trigger.


External Trigger is a button upon which I tell the camera to capture an image on the next available external trigger and give it to me. I want exactly one Image corresponding to the external trigger event.

My labview program explained.


I call the IC_SetExternalTrigger.VI
I choose the properties ( ImageBuffers.ImageHeight,ImageWidth,ImageBitsPerPi xel,ImageRingBufferSize and MemoryCurrentGrabberColorFormat )
I choose the current index of the buffer and choose the ITEM which gives me the ImageBuffer.
I lock the buffer and close the reference and also get the ImageDataPtr
Based on the ImageDataPtr I get the image with the help of CopyBuffer
I write it and save it to a JPEG image

Thank you.

Stefan Geissler
June 19, 2013, 09:37:38
Do you use NI IMAQ for image processing?

I must know this, because for IMAQ and non IMAQ I have to create different samples for you.

Stefan Geissler
June 19, 2013, 16:09:06
Please see the "imageAvailable.zip". It shows, how to use the the ImageAvailable event with IMAQ library.

For your application:
set "LiveCaptureContinoous" property of IC Imaging Control ActiveX to true
set "DeviceTrigger" property of IC Imaging Control ActiveX to true
set "MemoryCurrentGrabberColorformat" property of IC Imaging Control ActiveX to RGB32
Call "LiveStart"
now an image is provided only, if a trigger pulse occurred.

The ImageAvailable event of IC Imaging Control ActiveX recevies as parameter the buffer index of the last filled image buffer, which contains the new image.
Please refer to
http://www.imagingcontrol.com/en_US/support/documentation/activex/event_descICImagingControl_ImageAvailable.htm

This image buffer must be converted into an LabVIEW picture or NI Image Image, as shown in the IC_Grab*.VIs. So you may can copy the relevant parts from these VIs into the ImageAvailable event handler.

***

If you need more help, please provide a sample VI (preferably LabVIEW 7), that implements at least the basic ImageAvailable Event call. I invested some hours in LabVIEW programming, but I am not able to implement this simple stuff (which is LabVIEW, not IC Imaging Control). Doing this in C++, C#, VB6, VB.NET or even Delphi, this is a matter of a few seconds.

I am very sorry, that I have no working sample for you, but I am not able to use LabVIEW in an easy way.

abikutn
June 19, 2013, 16:46:10
Thank you stefan. I will see what I could do and update the progress with you.

Thanks.

Stefan Geissler
June 24, 2013, 15:35:38
Hello

I created a new sample, that does at least nothing in the ImageAvaialbe event. It shows, how to register the event handler.

I wanted to increment a counter in the ImageAvailable handler, but I failed totally creating it. The VB6 source code would be
Dim i as Integer

Sub Form_load
...
i = 0
End Sub

Sub ImageAvailable
i = i + 1
lblImgeCount.Caption = str(i)
end sub

Maybe someone can show me, how to do the very same in LabVIEW. I spent 5 hours but found no solution. The sample code above in a textual programming will take a few seconds to code.

Stefan Geissler
June 25, 2013, 12:07:44
I got it working now.

The attached sample counts the images provided by the camera. The trigger is enabled by default, but you can show the camera's property dialog by clicking on the "Settings" button. In there is under "Special" tab the software trigger, which can be used to generate trigger pulses.

Hopefully, this sample helps you to detect, when a trigger pulse occurred. The next task is to receive the image.

abikutn
June 27, 2013, 18:27:10
Hello Stefan,

Thank you for the Trigger Count.zip.

Why does the program or camera still capture images even when the trigger cable is OFF ? This doesnt make sense. Have a look at the screenshot below. I figured out that "ICImagingControl.DeviceTriggerAvailable" property is still sending TRUE even if the trigger cable is taken off. Does this property mean the camera is capable of external trigger or is it able to detect external trigger ?

Here it shows the images still being captured when the trigger cable is not plugged in.
1584
Here it shows the camera trigger input is not plugged in.
1586

This really doesn't make sense. Please explain why this happens. In principle, if the camera is in TRIGGER MODE> It should capture images only when there is trigger else not.


I have a few other certain questions:


What should be the minimum width of the trigger pulse to be given to the camera so that it can detect ? Is there any threshold value or minimum pulse width value to be given ?
How can I program it in such a way that it can save the images for each and every trigger that it detects ?
And, how can I get the image to be save onto the computer ?

abikutn
June 27, 2013, 19:17:36
1585

I am using BNC cable with (Trigger positive and Trigger negative) as input to the pins 4 and 3 of the HIROSE trigger input; my trigger peak-peak=3.20Volts and trigger pulse width is 75ns.

Please advise me if these are good enough for the camera to detect the trigger.

Stefan Geissler
June 28, 2013, 10:01:36
Hi

The trigger source should provide a voltage between 0 and 12V. The trigger itself uses TTL power, that means it reacts on a voltage change between 2.7 and 3.2 V.

Regarding saving an image in the ImageAvailble event... This is more complicated. You need parts of the IC_Grab*.VIs to convert the "LastAcquiredImage" Buffer into a LabVIEW image. Do you use IMAQ?

Stefan Geissler
June 28, 2013, 14:16:32
Hello

Attached a trigger sample. The tricks are
- generate a user event
- fire the user event in the ImageAvailable Event
- Add dynamic events to the event structure (right click on it an select "Show Dynamic Event...")

I spent app. 4 hours. This is LabVIEW progarmming stuff only and has no relatation to IC Imaging Control.

I also added a new VI, inherited from the IC_Grab_Picture.vi, that receives an ImageBuffer as parameter and returns a Picture as output. This VI is in the ImageAvailable Event case in the event structure.

The atteched sample VI now gives you a Picture, when an image arrived.

Please make sure: MemoryCurrentGrabberColorform of IC must be set to either RGB32 or Y800. All other will cause an error in the image conversion DLL.

abikutn
October 17, 2013, 02:50:30
Hello Stefan,

I have returned the dmk camera to a new DMK 23UV024. I have no problem with Image tear with this camera so far. Regarding the last answer you gave me with the attachment Trigger2.zip, I have the following issues.

1. It works fine and I can get all the images from the buffer to my computer with no problem.
2. I still am not able to get images using an external trigger.
3. My external trigger is a pulse that has a positive width of 6.25ms (micro seconds). And the pulse height is 2.52V(high) and 2.77V (pk-Pk). Is this good enough to trigger the camera ?
4. The program is working fine. I am struggling to get the camera work with external trigger since past few months, please help me find a solution to this problem.

Thanks.

Stefan Geissler
October 21, 2013, 09:42:34
Hello


. My external trigger is a pulse that has a positive width of 6.25ms (micro seconds). And the pulse height is 2.52V(high) and 2.77V (pk-Pk). Is this good enough to trigger the camera ?

The pulse length could be fine, but the voltage is too low. The camera reacts on a rising (or falling) edge from 0V to 5V, as TTL level. Therefore, the camera wont detect the external trigger.