Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to calculate time difference using calculator in VBAI

Is anyone know how to use calculator step to calculate the time difference?

 

Or is there any other way to calculate time difference without using calculator?

 

Thank you

0 Kudos
Message 1 of 3
(1,204 Views)

You can use the Tick Count from the "numeric" palette in the calculator.

 

Set your time reference when needed by setting an inspection variable (T0 here) with Tick Count value  :

SamiF_0-1639037619396.png

 

And another calculator with the T0 inspection variable as an input to calculate the difference :

SamiF_1-1639037746255.png

 

 

Sami

 

0 Kudos
Message 2 of 3
(1,174 Views)

Hello!

 

The Format Into String VI enables you to calculate the time difference between two dates in weeks, days, hours, and/or minutes.


Firstly, place the VI on the block diagram, and right click the output “resulting string” and select Create > Indicator, then place a Subtract Function and two Time Stamp Constants. Connect them so as you are subtracting a specific date/time from your reference date/time and connect the output of the Subtract Function to input 1 of the Format Into String VI. Then finally, place a String Constant on the block diagram and connect it to the VI through the "format string" terminal, and you can also customize your string format by using Time Stamp Format Codes.

0 Kudos
Message 3 of 3
(1,141 Views)