I have a TCP/IP where I send datagrams (in c-code) to LabVIEW (which is the server).
The datagram sends with every data a time stamp in the following way: dd.mm.yyyy hh:mm:ss.zzz, where zzz stands for milliseconds. I would like to see my data in a waveform chart at the LabVIEW frontpanel, but I'm not sure how to get a continuous time stamp from the c-code. I tried it with "scan from string" (as my data enters LabVIEW as a string), and then I made a sum of the minutes (times 60) and the seconds, which works for one minute, but after one minute my time goes of course to zero again which isn't nice for the waveform chart...
Does anybody has a nice idea how to solve this? Any examples?
use "scan from string" with this format code: "%d.%d.%d %d:%d:%d.%d" to get all components from your timestamp. And you can use "Date/Time to seconds" to form all those values into a valid LabView timestamp.
Added attachment to show all this...
Message Edited by GerdW on 02-01-200809:57 AM
Best regards, GerdW
using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
thank you very much for your help. Unfortunately I can't open your vi, GerdW, as I only have LabVIEW 7.1. Maybe you can post it for 7.1 again? I don't know what type of the output I have to choose (right now I have U32 and I can't use the "Date/Time to seconds"). What default value did you set, TonP? When I tried your solution, LabVIEW says that I have too many format specifiers in my "scan from string"? Do you have an idea what my mistake is? And I can't create a constant at the output as I didn't set a default I guess.