LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why can´t I wire the offset input in the Write File Function when I use datalog files ?

Hi !

I have a datalog file, in which I save variant data several times in diferents VIs, I runs these randomly, and I would like rewrite only a part of the file, but I can´t wire the offset input in the Write File function to indicates the begins and save the data in the point that I want.

I need your help 🙂 thanks.
0 Kudos
Message 1 of 3
(2,846 Views)
Hello.

I THINK that the reason why the offset input is disabled when you are working with datalog files is that you do not know how many bytes each entry of the data structure will ocupy.

When you have a binary file where you store, for example, an array of double precision floating-point numbers, you know that each number ocupies 8 bytes, so you know that when you want to read the 21st number of the array you need to skip the first 160 bytes (20 numbers x 8 bytes/number).

However, with datalog files you can store very diverse data structure, usually including strings, like in your case, which means that you do not know how many bytes to skip to be able to read or write to some particular variable of your data structure.

If what you want to do is to not overwrite the contents of an existing file, but to append to it, what you probably will have to do is read the whole contents, append to the data in your program, and write it all again.

Hope this helps,

Alejandro
0 Kudos
Message 2 of 3
(2,829 Views)
Because datalog files are append only. You can't replace a record at a random place, just add it at the end.


LabVIEW, C'est LabVIEW

0 Kudos
Message 3 of 3
(2,814 Views)