LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

binary file conversion

Attatched is what I been trying
0 Kudos
Message 11 of 34
(2,748 Views)
I seem to be having a similar problem myself. I have a datalogger cRIO logging from a 9205 on two channels and writing the data at 10k/sec to a .bin file. I want to convert this .bin file to a .dat file (or something else I can open simply in matlab as this is the program my supervisor at uni uses). The engineers at NI wrote me a file converter which appears to work but when plotted shows high levels of saturation (at 32K) and I think there is an error somewhere with regards to swaping a 32bit integer for a 16bit integer but I am not sure. If I load it back into the main labview vi where they engineered a 'load data' option the .bin file reads perfect with no saturation. I tried the tutorials for reading a binary file and also the converter someone posted on here but niether seemed to be what I was looking for.

I have attached the file converter and a sample of my data here.

Any help with this very gratefully apprechiated 🙂 I'm using labview 8.5 if thats anyhelp.

0 Kudos
Message 12 of 34
(2,231 Views)

You did not attach a sample of your data. Do you have any documentation on the file structure?

Can you show us how the main VI loads the data? Did you compare the code?

0 Kudos
Message 13 of 34
(2,214 Views)
It would not let me attach a .bin file for some reason.

I have no documentaion on the file stucture, what I was supplied with from NI was a fully automated bit of code that meant I would not need to get involved in the VI's as such but that appears to not be the case following this minor hiccup.

The main VI loads the data inside a 'while loop' as far as I can gather, it has a few read binary file icons in it. I don't really understand the VI at all if I am honest as I have done no labview programming myself it was all written for me by the engineers as agreed when I brought cRIO.

I don't know what you mean by compare the code? I am unable to open it in notepad or anythng like that. It only opens in Labview if I put it in a certain directory and click load.

Thanks 🙂
0 Kudos
Message 14 of 34
(2,206 Views)

Only certain file extensions are allowed as attachments. So put everything in a zip file before attaching.

If you have LabVIEW code that can correctly read it and some other code that cannot, all you need to do is inspect for differences. If you could attach the main VI, I can compare it with the code you posted earlier to see if there are differences.

We should be able to figure out the data structure once we have code that can read it correctly. Most likely you could then even write a matlab program that can read the binary file. 😉

0 Kudos
Message 15 of 34
(2,203 Views)

I wrote a binary file of 2-d array of a cluster(which is a 2-d bitmap) now i want to retrive it. how to do it as the stored data is totally in binary when brought out.

0 Kudos
Message 16 of 34
(1,463 Views)

You really should have started a new thread.  This current one is 6 years old.

 

Can you share some code of how you wrote the file and how you are trying to read it?  You can probably just use the Read Binary File and supply an array of your cluster as a data type.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 17 of 34
(1,456 Views)

CAN I HAVE YOUR EMAIL ID?

0 Kudos
Message 18 of 34
(1,451 Views)

Here is our code

0 Kudos
Message 19 of 34
(1,447 Views)

You need to attach the code to the post.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 20 of 34
(1,438 Views)