LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

path problem with reading binary file

Hi,

My first post. Having some problems reading a binary file. I am attaching read.vi, write.vi, and error.jpg.

Helps and suggestions please.

 

Thanks,

Chuman 

Download All
0 Kudos
Message 1 of 3
(2,378 Views)

There is no path problem. If you write the data as a cluster, you cannot read it as an array later. You need to wire a cluster of the same type.

 

Here's a quick mod of the read code. See if it makes sense to you.

0 Kudos
Message 2 of 3
(2,371 Views)
The datatypes don't match between the reading and writing. You write a cluster of 5 doubles, but try to read an array of doubles. If you remove the "cluster to array" from ReaBin and just wire "data para. " directly then it'll read without an error. You'll have use unbundle instead of index array to get the values out. You'll probably also want to make a type def out of your cluster (this is a real life saver when you start trying to edit code). On a side note if you don't wire any of the index's on index array it default to the values your assigning it in ReaBin. Basically if the first index is unwired it'll default to 0. Any other unwired index should default to the value of the previous index plus one.
0 Kudos
Message 3 of 3
(2,367 Views)