Example Code

Labview BIN (.bin) data format to TEXT (.txt) using Java

Code and Documents

Attachment

Download All

The Java Program converts LabView's binary file (efficient due to speed and storage) to TEXT file.

I assumed time-sequenced data from the channels are stored in the input file and the data type of the Input binary file is 1 among boolean, byte, char, double, and float. User will be asked to select which datatype was used in the input file.

How to run?

i) JAR: Download & click directly to run.

ii) CLASS:

In Windows 7: Right click 'My Computer' > System Properties' Advanced tab > Environmental variables:

Edit following two paths:

classpath C:\Program Files\Java\<jdk folder>\lib ;

path C:\Program Files\Java\<jdk folder>\bin

Now place the class file under <jdk folder>\bin (e.g.)

From Command Prompt (Under Accessories you'll get it --> go to <jdk folder> \bin

And then type:

java Read_BIN_file

https://decibel.ni.com/content/servlet/JiveServlet/download/22475-12-47161/snapshot.png

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
Knight of NI
Knight of NI
on

I find this very interesting. Not because it's useful, but because it seems to be nothing more than you trying to get people to download this trial version of a Java class so people will pay for the full version. Considering that there is NO standard for the .bin file, I find this class to be virtually useless. Also considering that the format is different if you have floats vs integers (there are 3 different kinds of floats and 4 different kinds of integers), I also find this class to be virtually useless. I also wonder why you would be posting Java code on a National Instrument site. Answer: You're trying to make a sale.

manzur
Member
Member
on

This is the start. Once I can produce the text file, I do not need to handle tdms (NI's one java api convert from bin to tdms) and I do not need to use NI's data analysis tool like diadem, power suite, etc. I can go with generic or my suitable tool. Soon I will add features to handle different type-variants and more options (# of channels, data sequence pattern) based on user-remarks/comments.

A.Rohde
Active Participant
Active Participant
on

-- removed --

manzur
Member
Member
on

Many people prefer to use data capture in Labview FPGA/Real time controller and data analysis or reporting in other platforms. My code might suite that need.

elkag
Member
Member
on

I can see this program having some use, even to us hard core LabVIEWers.  I picked a bin file at random that was on my computer and it converted it immediately.  Always good to have more tools at your disposal.

elkag
Member
Member
on

Another nice utility in this same vein is the TDMS to Excel converter that NI recently made available.

Contributors