LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Double Date and Time stamp

I have a DAQ program that log's data to a text file once a second.
Once in a while when the program is started the file has the first 2 entry's
are duplicated.
I am pretty sure it's a programming issue. Any suggestions?




0 Kudos
Message 1 of 4
(2,880 Views)

It has to be as you suspect.

Could you attach your vi or a pic of your block diagram??

we could suggest better after we take a look at it

0 Kudos
Message 2 of 4
(2,866 Views)

In an attempt to offer a solution even without the code, if you're using the Wait Until Next ms Multiple, then the first time you run the loop it would duplicate your first "second" in some cases.

Let's say you chose 1000 ms - at the first time the loop runs, the ms counter value is 29584786 so it runs your code using that time and then it only waits for an extra 214 ms before encountering the next 1000 multiple. These two ms times might occur in the same "real world second", as far as the PC is concerened. The simplest solution would be to use the Wait function instead.


___________________
Try to take over the world!
0 Kudos
Message 3 of 4
(2,856 Views)
Thanks, I will give that a shot.

"tst" <x@no.email> wrote in message
news:1160640608552-426614@exchange.ni.com...
> In an attempt to offer a solution even without the code, if you're using
the Wait Until Next ms Multiple, then the first time you run the&nbsp;loop
it would duplicate your first "second" in some cases.
> Let's say you chose 1000 ms -&nbsp;at the first time the loop runs, the ms
counter value is 29584786 so it runs your code using that time and then it
only waits for an extra 214 ms before encountering the next 1000 multiple.
These two ms times might occur in the same "real world second", as far as
the PC is concerened. The simplest solution would be to use the Wait
function instead.


0 Kudos
Message 4 of 4
(2,850 Views)