Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

VB and timer triggering

Greetings from Croatia.

 

Im having problems regarding some basic timer features in Vision Builder (version 3.0) or to say lack of them. Im completing my final thesis on Universitiy of Mechanical Engineering and Naval Architecture. Im doing research regarding accuracy and precision of vision system when measuring speed of moving objects on assembly or delivery line.

 

For testing purposes I have used our testing equipment which we have in our lab, assembly line, camera with NI CVS-1456 module and NI Vision I/O Terminal Block. Camera is placed above assembly line and is capturing objects traveling along line. There are two optical sensors on the line that are used to detect objects traveling on the line. I need to measure speed of object traveling along the line.

 

So when object activates first sensor ISO input is trigered on NI I/O board and then TTL output activates image aquisition. After delay that is programed in VB second image is captured. So after measuring distance between specific geometric feature of object on captured pictures, VB script calculates speed from known time (time delay between shooting), and known length (distance that object traveled between capturing sessions).

Whole process is triggered using first optical sensor. Now the second. Second optical sensor is placed further on the assembly line for better results. Second sensor is used to detects actual time that elapsed after the first sensor was triggered. So what we have? Time that elapsed between triggering sensors and known length between them. Using that data actual speed can be calculated and compared to speed that VB calculated. 

 

Now the problem. Whole first session, that is, capturing images and calculating speed in VB is working  but problem is with other sensor. I cannot get VB to use my second sensor to triger something so I can use it to get information what time elapsed from first triggering. I have tried using calculator and global variables and use system current time, but it is not accurate enough, only seconds are available. I need something more accurate, at least miliseconds.

So is there anything I can do to start and stop timer or something using sensors.

 

I think for now only thing that can solve the problem is to write LabView script and run it in VB as a inspection step.

 

 

Thanks in advance, Tomislav.

0 Kudos
Message 1 of 4
(3,732 Views)

Hello Tomislav,

 

When you said that you tried using calculator and global variables and use system current time, do you mean Set Variable>System Variables>Current Time in VBAI? If that is the case, you are only going to have seconds. If you want t have sometime with higher resolution(up to milliseconds), you would then need to use LabVIEW.

 

Andy Chang
National Instruments
0 Kudos
Message 2 of 4
(3,705 Views)

Yes you are correct, that was something I tried. Also I tried to use other times that are available in global variables list. As You said resolution is only in seconds and that is not enough. So, to make it clear, there is no timer in VBAI (not including delay function)?

I must admit that I am kinda suprised that VBAI has no at least basic timer fuction, it is the tool that is commonly used in automation processes.

 

Andy, can you please give some advice how to implement timer using LabView. All I need is to start timer an stop it using trigger input. I know about saving a VI for distribution and running it in VBAI, Im just trying to make simple script in LabView and it is kinda confusing because Im using it for the first time.

 

Thanks.

0 Kudos
Message 3 of 4
(3,682 Views)

Depending on if you are using IMAQ/IMAQdx/IMAQ1394, you can find examples on Trigger and grab image from LabVIEW example finder. Just go under Hardware Input and Output>IMAQ>Signal Input and Output and you would see a list of examples on how to start/stop timer using trigger input.

Andy Chang
National Instruments
0 Kudos
Message 4 of 4
(3,667 Views)