LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

viewing the logged front panel data

I’m writing into the datalog file, I can see that the data is recording every one second, but when I retrieve the data i.e. viewing the logged front panel there is only one data since the range is from 0 to 0 ([0..0]). Does anyone know why? And how can I fix the problem?
0 Kudos
Message 1 of 4
(2,508 Views)
When you are writing the datalog file, are you properly opening and closing the file? Do you open it once, write to it in a loop until you want to stop recording data, then close it? If you open it, write one record, then close it, make sure you don't overwrite the file every time you open it. Do you see the file size increase the longer you read data?
Are you properly initializing the datalog type with the same cluster when you write and then read the file?
Have you compared the structure of your program to the LabView examples Write Datalog File Example.vi and Write Datalog File Example.vi? To find the examples, from any LabView window, goto Help >> Find Examples >> Search. Under Type a keyword to find:, enter datalog.
0 Kudos
Message 2 of 4
(2,508 Views)
I opened it and loop till I stop the execution without any condition just (using the stop button within labview, can it be the cause of such a problem?
I initialize the same data type with write and read, there wouldn't be a problem since the write and read are two different vis.

Would it be more efficient if data is save in a spreadsheet file rather than datalog?
0 Kudos
Message 3 of 4
(2,508 Views)
You should Never rely on the abort button on the tool bar to stop a VI in a loop writing to a file. The abort stops everything immediately and you don't properly close the file. Instead of using a boolean contant in your loop to get you an endless loop, add a Stop button (a boolean switch) to your front panel. Wire that through an inverter to the Continue terminal of the loop, or (if you're using LabView 6.x) right-click on the Continue terminal and change to Stop if True, then wire the Stop button directly to the terminal. Then pass the file RefNum out of the loop to the Close File function.
For debugging purposes, I do use the Abort toolbar button, but I never create a VI with the Abort as the only means of stopping a VI. Anytime you want to st
op a VI in a loop, you may want to have some control over how it stops. There may be files to close, instruments to shut down, results to process, etc. Even if the VI is very basic or even temporary, just get in the habit of using a Stop button on your front panel rather than a boolean constant to get an endless loop. It's really not that much more work and it gives you control over your VI.
0 Kudos
Message 4 of 4
(2,508 Views)