"TIME" as an integer..
Rod N
Posts: 28
Does anyone know how to display/convert a masters TIME to a number..?
I need to 'timestamp' some communications between systems and have a measurable number to calculate with.
Any ideas??
I need to 'timestamp' some communications between systems and have a measurable number to calculate with.
Any ideas??
0
Comments
I was sure there was a internal variable that each master uses to interpret the current time, date etc..
I know I could write a function based on the "TIME_TO..." integers but I'm hoping for more precision.
I don’t know of any variable we can get at with Netlinx to obtain the time of day with the precision you’re looking for. Maybe Duet has something?
or if you have the individual values from "TIME_TO_xxx" do this: I don't know how you would get a more precise time though unless you create a timeline and restart (sync it) every day at midnight. Run it at the precision you need and then do math on your timeline.repition or the global variable you use to hold that value.
A need for something similar came up recently and the code below is as close as I could get - but it isn't 100%. To create the millisecond field, I essentially created a repeating timeline that would occur more than once a second. Your testing will show the sweetspot of the timeline results in 60 passes and is repeatable. At its smallest time interval, the master (under no other load) can do this more than 1500 times per second, but that number goes down as load on the processor increases to do the rest of your system program. I was never able to achieve 100 steps (a true millisecond) reliably. There are too many unknown variables affecting the results - but 60 is achievable.
and thanx to Joe and vining