RaulAPM

Convert time

4 posts in this topic

Hello.

this is my firs post

is possible to convert the elapsed time of timer to real or int

i need to make some math operation with the elapsed time

thanks

 

Share this post


Link to post
Share on other sites

Use TimeToSec to convert time to UINT.

Then use **_TO_*** (Integer-to-Real Number Conversion Group).

1 person likes this

Share this post


Link to post
Share on other sites

Or you could use the 'Timer' function(100 ms timer) this function has the time as UINT.

Share this post


Link to post
Share on other sites

Hello,

you can create a function (ST language) in Sysmac with this name => INT_TO_TIME

 

code :

// Input is an INT and return in TIME

          NanoSecToTime(In:=INT_TO_LINT(In:= Input) * LINT#1000000);

 

After you can use an INT on a TON :

// TON_Test : TON;          Start_Test : BOOL;          iValue_Test : INT;

          TON_Test (IN := Start_Test,     PT := INT_TO_TIME(iValue_Test));

 

David

1 person likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now