LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

écrire en binaire

Bonjour, 

 Je volais enregistrer les données acquises dans un fichier tableau en binaire, mais j'ai un problème que ces données ne sont pas enregistrées dans le bon ordre dans ce fichier. j'ai un doute sur la position d'écriture pour chaque itération. ci-dessous mon vi d'acquisition et ce que je lis dans le fichier enregistré.

Merci d'avance pour votre aide. 

DK78_0-1711821107322.pngDK78_1-1711821348576.png

 

 

0 Kudos
Message 1 of 6
(568 Views)

We can't really debug images and you are not even showing how you read the file later. Is this another LabVIEW program or something else?

 

Please attach your VIs for writing and reading. Maybe you want to transpose the 2D array before writing? 

(You also don't need to set the file position before every write, it will continue appending anyway).

0 Kudos
Message 2 of 6
(533 Views)

Bonjour 

merci votre retour, veuillez trouver ci-joint mes vi.

bonne journée

Download All
0 Kudos
Message 3 of 6
(524 Views)

You did not attach the VI where you are writing the data. (your "sans titre 6" has nothing to do with the problem.)

You are reading the file as 1D data without size header but you write it as 2D array chunks with size headers. This does not match at all!

 

If you know how many channels you have, All you need is read it as 1D array and reshape. None of your convoluted code is needed. Since your x-values are equally spaced, you don't even need an xy graph.

0 Kudos
Message 4 of 6
(507 Views)

See if this can give you some ideas.

 

Since you are doing little endian, I assume you want to read that with some other program later (not LabVIEW), so I left it as flat binary data. You could or example write the number of channels as I32 at the beginning of the file and then read it later to decide how to reshape.

 

altenbach_0-1711901539474.png

 

0 Kudos
Message 5 of 6
(503 Views)

Bonjour ,

merci beaucoup pour votre solution, bravo. ça m'a bien aider pour mon application.

un grand merci 

0 Kudos
Message 6 of 6
(483 Views)