05-10-2012 05:02 AM
Hi, The below image show me converting the time into a timestamp (and substituting the date from a different time stamp.
This works fine except for the miliseconds. you can see here the milliseconds are defines as "%2d" and this does not work. If I replace this with "%2u" or "%3u" then the VI will error (vi attached)
what am i doing wrong
Cheers, Alec
Solved! Go to Solution.
05-10-2012 06:17 AM
Hi,
This should be enough
Hope this helps
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
05-10-2012 07:26 AM
OK, NEARLY! and Thanks 🙂
The problem now, is the number i am inputting is milliseconds, and the time stamp number is fractions of a second.
ie. "1" and "100" both translate to 00:00:00.100
anyone know how to translate this?
how would i make the time "00:00:00.001"
05-10-2012 07:31 AM
Sorry I don't understand what you're asking for...
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
05-10-2012 07:50 AM
using this vi. if you set miliseconds to 1, the (and the time is set to say 12:30:15 (12hrs, 30min, 15sec) then you get 12:30:15:1.
What do i need to do to set the time to "12:30:15.001"
so not 0.1 but 0.001
05-10-2012 08:04 AM
Hello,
It sounds like your formatting string is off. In the last part of the first string in TiTou's example, note that the string is .%03d rather than just .%d
This makes a big difference in the final result. I tried TiTou's code myself and entering 1 in the milliseconds produces .001 as expected.
Best wishes,
Steven I
05-10-2012 08:06 AM
Oh...
so if it's 1 you want .100
so if it's 10 you want .010, right?
and if you have 100 what do you want? .001? if not, what would give you .001?
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
05-10-2012 09:39 AM
well no.
if its 1 i want 001, if its
if its 10 i want 010
if its 100 i want 100 ...
05-10-2012 09:57 AM
well... is this not what you get with the VI I posted in my first answer?
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
05-10-2012 10:01 AM
no,
if you enter 1 you get .1
if you enter 10 you get .1
if you enter 100 you get .1
if you enter 5 you get .5
if you enter 15 you get .15
if you enter 150 you get .15
i cant see how you can get .005