LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with code

Hi,

I am a new-entry to this community and this is my first approach to Labview.

The code is aimed to import a file.dat from an existing directory and convert it to a datalog file but I can't make it work. Because I've no experience with Labview, it is difficult for me to find the error.

 

Attached is the file.vi and a test file.dat.

Thank you to anyone who can help me!

 

Martina

0 Kudos
Message 1 of 7
(880 Views)

The only hard part is knowing the record type, which you apparently do, so try something as follows to read all 11k+ records.

 

Note that there seems to be some corruption in the last two records. (LabVIEW also needed to update the file format)

 

altenbach_0-1685359099078.png

 

0 Kudos
Message 2 of 7
(837 Views)

Could you please attach you file.vi here?

 

Thank you

0 Kudos
Message 3 of 7
(819 Views)

Martina,

 

     Could you please open your OpenUT.vi in LabVIEW 2023 (which you seem to be using) and do a "Save for Previous Version" and specify LabVIEW 2021?  Many "seasoned" LabVIEW users do not update with each new version (I'm mostly using LabVIEW 2019, but do have 2021 installed, as well).

 

     Do you also have access to the program (LabVIEW, or otherwise) that created the test file, "seq_lam1.dat"?  Knowing (instead of "guessing") the format of the data file would go a long way to ensuring we are reading the file correctly.  If so, you should also attach it, preferably for LabVIEW 2021 (or 2019).

 

Bob Schor

0 Kudos
Message 4 of 7
(804 Views)

Both versions are attached!

 

Concerning the program that creates the test file, I am trying to reconstruct each package because the project is very large and was not done by me!

 

Thank you,

Martina

Download All
0 Kudos
Message 5 of 7
(796 Views)

@Martina_P02 wrote:

Could you please attach you file.vi here?


There are three functions from the datalog palette and a few diagram constants. Once the datalog type is wired, right click the output terminal of the read function and "create indicator". Shouldn't take more than a minute to recreate from scratch. It would take much longer for me to fire up the VM that has LabVIEW 2023.

0 Kudos
Message 6 of 7
(773 Views)

Do you know how old that file is? Must be ancient! (LabVIEW 4?)

 

Newer LabVIEW versions require it to be rewritten because of that. Do you know what generated the datalog file and what kid of data is in it?

 

Who wrote the crazy code you have attached? Was that upconverted from a very old LabVIEW version (some of it looks like mutation code, but I am not sure)?

 

altenbach_0-1685377857475.png

 

0 Kudos
Message 7 of 7
(748 Views)