LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

using typecasting function

hello,

I am trying to convert a binary string to a double precision floating number using typecasting function ..How do I set the type of the data required..Is this a constant,indicator or control..?

-innovator81
0 Kudos
Message 1 of 4
(2,820 Views)

Connect the type of data you want to cast to (U32, I16, ect) to the center terminal on the type cast function.  See the attached VI.

More commonly, I use the Unflatten From String function, it is more powerful.  I rarely use typecast.  You must also not the endian type, typecast assumes big-endian, Unflatten From String lets you choose.

More questions?

Chris

Chris Reyerson
Optical Systems Engineer
Arete Associates
Tucson, AZ
0 Kudos
Message 2 of 4
(2,810 Views)


@innovator81 wrote:
I am trying to convert a binary string to a double precision floating number using typecasting function ..How do I set the type of the data required..Is this a constant,indicator or control..?

It is irrlelevant what you connect to the typecast function, it just needs to be of the desired data type: DBL in this case. The value itself is not used. Most often, I use a diagram constant, but you could also use a control if one is there anyway. (An indicator won't work, it needs to be a data source, not a data sink.)


 

0 Kudos
Message 3 of 4
(2,803 Views)
hello,

Yes I have used a constant(a double precision float for the type ) which converts my binary string to double format..it is working fine..thanx


-innovator81
0 Kudos
Message 4 of 4
(2,783 Views)