LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read binnary data using C#

Hi all,
I used Visual Studio 2003 to develope an application on PDA to reading the input and output da ta of Labview. The goal is convert an binary file to an xml file like this :

<?xml version='1.0' standalone='yes' ?>
<LVData>
<Version>7.1</Version>
<Cluster>
<Name>Results</Name>
<NumElts>17</NumElts>
<I32>
<Name>AssayDeviceID</Name>
<Val>32767</Val>
</I32>
<I32>
<Name>AssayID</Name>
<Val>9486</Val>
</I32>
<I32>...............

Please give me some advices to solve this.
Thanks.
0 Kudos
Message 1 of 4
(8,631 Views)
 

Where is this binary data coming from?
What is its format?
Do you have a sample of such a file and the desired XML file?
Where exactly does LV fit in here?
Do you have to save the data as binary in the first place? You can either save it as simple ASCII or as XML (if the XML VIs work on the PDA module, I never checked), which will be easier to process.

Anyway, if you want to know how LV binary data is represented, you can read this paper on how LV stores data in memory. There used to be a more detailed version (I think) which shipped with LabVIEW as a PDF file.


___________________
Try to take over the world!
0 Kudos
Message 2 of 4
(8,620 Views)

Hi ,

I just know these files coming from labview application running on PDA, I don't know even the screen shot of the labview application.

I used xvi32 editor and found that the files begin with DTLG characters.

And the desired output format is  XML, you can see attached files below:

.............

<Name>Item</Name>
<Val>0.87134</Val>
</SGL>
<SGL>
<Name>Item</Name>
<Val>0.42389</Val>
</SGL>
<SGL>
<Name>Item</Name>
<Val>0.82780</Val>
</SGL>
<SGL>
<Name>Item</Name>
<Val>0.28127</Val>
</SGL>
<SGL>
<Name>Item</Name>
<Val>0.69750</Val>
</SGL>..............

The  assay 38.xml is the input  XML file and i must convert it to the  Job file.  Job  file is the input of labview, and the  PDA Result  file is the  output.

If you know any relative information about these files of labview, please help me.

Thank you very much.

Download All
0 Kudos
Message 3 of 4
(8,601 Views)

I still don't understand exactly which files you're getting from where and which files you need to produce, but you definitely have a problem here. The structure of the file was determined by whoever wrote that program and reverse engineering it from the binary data would probably be quite hard.

Assuming the XML file shows the structure of one of the files, that would make it much easier (you simply have to reconstruct the cluster, which is similar to a struct), but since you have to do this in C#, you will have to use the manual I pointed to earlier, which would make it harder, instead of simply building the cluster. As far as I remember, the PDA module does not allow compiling DLLs, so you can't even write a piece of code which will do this reading for you.

Your best bet is to find whoever wrote the original program (or at least find the program itself) and use that to reconstruct the cluster.


___________________
Try to take over the world!
0 Kudos
Message 4 of 4
(8,582 Views)