05-13-2026 05:19 PM
I'm looking to create a string that represents a timestamp and pass it to LabVIEW. Understand that Timestamps in TestStand are strings. I can generate one to pass to LabVIEW with
Date() + " " + Time()
No problem. However, I need millisecond resolution from the time.
I then use
Date() + " " + Left(Time(False), Len(Time(False))-3) + "." + Str(Locals.ms,"%03.0f") + " " + Right(Time(False),2)
But it looks like the labview adaptor is nuking the milliseconds still..
But holy crap.. isn't there an easier way to create a valid timestamp for LabVIEW? I mean without making the timestamp w/in labview and passing it right back into it?
This just seems clunky to me.. I'm hoping i'm missing something stupid on something I would think is a common thing.
Solved! Go to Solution.
05-13-2026 08:24 PM
Try the solution from How to get milisecond out from time function? post
05-14-2026 06:47 AM
That was it. I was stuck searching for "timestamp"
Boy, I wish there was a function LabviewTimestamp()
Seems like a lot of work just to recreate a native LabVIEW structure.
Thanks!
-josh
05-14-2026 07:50 AM
For completeness (incase anyone in the future gets here via a search), the link only gets you 80% there. It would append the millisecond values AFTER the AM or PM string. I basically ended up building the string from scratch
Locals.Time.timeString=Time(False,Locals.Time.hours,Locals.Time.mins,Locals.Time.sec,Locals.Time.ms),
Locals.Time.AMorPM=(Find(Locals.Time.timeString, "AM") >= 0 ? "AM" : "PM"),
Locals.Time.timeString=Date() + " "+ Str(Locals.Time.hours,"%02.0f")+":"+Str(Locals.Time.mins,"%02.0f")+":"+Str(Locals.Time.sec,"%2.0f")+"."+Str(Locals.Time.ms,"%03.0f")+" "+Locals.Time.AMorPM