LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read Binary Issue

Dear all,

I am reading a binary file using Read Binary Function.

In the read binary function, there is a field "count" which is the nuber of data elements to read.

I am retrieving data in string format and i have no prior information about the number of elements in the File.

 how can i know the number of elements in the file ?

 

Thanks,

Ritesh

0 Kudos
Message 1 of 2
(2,276 Views)

In the case where you're getting a string, the count would refer to the number of bytes (characters) that you want to read.  What you wire to the data type input affects how count is used and what you get. If you leave data type unwired and wire count you'll get a string.If you wire something to data type and wire a value to count then you'll get an array of data type. E.g., wire a U32 to data type, and 5 to count and you'll get an array of 5 U32 numbers. Wire a cluster to data type and 6 to count and you'll get an array of 6 clusters.

 

Note: If you're reading it as a string, you can also just use Read Text File with the "Convert EOL" option turned off.

0 Kudos
Message 2 of 2
(2,261 Views)