LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

logging issue - qmh

Hello All,

 

i have one issue with logging of some data in txt file.

 

First of all, i'm using QMH to pass data cluster from lin comunication loop to logging subVI. This is all ok.

Logging works just fine at first look, but from time to time i have missing line in log file.

milan87_4-1691150438459.png

logging subvi

milan87_0-1691149852455.png

It doesn't matter if i set sampling time 1s, 2s, 3s, or what ever... there is always some line missing.

milan87_1-1691149955698.pngmilan87_2-1691150072515.pngmilan87_3-1691150157042.png

 

In all these examples there is missing one second i will say.

 

At first, i thought that logging is to slow, but it isn't, actually it is quite fast.

Also QMH should be fast enough for this timings.

Only thing that cross my mind, is when new data is received by qmh, then case structure go out from 'logging' case for the new data in another case 'received data'.

If anyone can help, i will appreciate.

 

Thanks

 

0 Kudos
Message 1 of 5
(728 Views)

Please tell us what Version of LabVIEW are you using?  32-bit or 64-bit?  What year?  What "edition" (Base, Full, Pro)?

 

We need to see (and be able to manipulate, even test-run) your LabVIEW code, pictures of parts of code just won't cut it.  Since all of the long-time LabVIEW Developers will be able to handle LabVIEW 2019 (and maybe up to 2021) code, but might not have the "latest version" installed, best is if you are running in LabVIEW 2022 or 2023, you "Save for Previous Version" and specify, say, LabVIEW 2019 (unless you know you are using a newer "feature").

 

We need the VIs that are involved with the problem.  Best is to attach the entire Project, easily done by right-clicking the Project Folder, "Send To:", "Compressed (zipped) folder", and attaching the .zip file.

 

Be sure to tell us what VI(s) to look at.

 

Bob Schor

0 Kudos
Message 2 of 5
(711 Views)

It's probably a combination of 2 things:

 

1. Your sampling intervals aren't *exactly* 1 second (or 2, or whatever).  They are probably just a little longer than that.  Are you maybe putting your 1 second wait in series with the other work your capture loop is doing, making the loop rate take just a little longer than the nominal wait time?

 

2. The resolution of the time you log is quantized to the nearest second.  Quite likely you're seeing the occasional effects of rounding.  One sample time is at 2.47 seconds and rounds down to 2 in your file, then the next sample time is 3.51 seconds and rounds up to 4 in your file.  It looks like a 2 second gap and a missed sample, but only because of the rounding.  If you were to store with 2 places after the decimal, you might find that the intervals are pretty regular, maybe something like 1.03 seconds.

 

If the # lines between these "time gaps" is fairly close to regular, that'd be a pretty good clue that I'm pointing you in a useful direction.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 3 of 5
(710 Views)

Hi milan,

 

The issue may originate from the way you are timing the sending of user event "received data (clustered)", so you must look upstream in your process. If the loop that produces the events actually has a period of e.g. 1.2 s instead of 1s, the logging will miss a second every 5 iterations.

 

How is the producer loop timed ? You shouldn't use "Wait (ms)", but rather "Wait until Next ms Multiple".

 

Regards,

Raphaël.

0 Kudos
Message 4 of 5
(708 Views)

Hey guys,

 

i'm not allowed to sharte code.

But regarding upstream data process, i will try to explained what's going on.

In main program i have 4 loops (UI, Lin communciation, decode, log).

LIN communication receive frames and send to decode loop.

After decoding, data cluster is sent to log loop (as user event).

Log loop has VI which i showed at first place. (producer to receive data cluster, and consumer to save to file)

milan87_0-1691390707718.png

milan87_1-1691390723628.png

 

Communication between this loops are done by QMH.

 

Because Log Vi has event sturcture, i send him user event data cluster.

So i thought if i send once a data to log VI, this data will logged continuesly .

So timing in upstream timing should be no problem. Or am i wrong?

 

 

0 Kudos
Message 5 of 5
(612 Views)