The Daily CLAD

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Flatten Numerics to String

SercoSteveB
Active Participant

What is Array Output following execution of the VI?

Flatten to String 06_12_2015.png

Flatten to String Answers 06_12_2015.png

Comments
crossrulz
Knight of NI

D


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Not applicable

D.

SOM19
Member

D

LordNobady
Member

D


Learning LabVIEW since January 2013
MrStevenUND
Member

D

mini09
Active Participant

D

SercoSteveB
Active Participant

Answer: D.  Nice one crossrulz, DavidCorney, SOM19, LordNobady, MrStevenUND & gnshmrthy.

Flatten to String is converting each successive byte of the data in into a character.  The number of bytes in each of the different numeric types is built into the array.

sahils
Member

Can I get a little more explaination on this.

SercoSteveB
Active Participant

Hi sahils.  Flatten to String will flatten anything to a binary string.  The data you pass to flatten is translated on a byte by byte basis into binary.  NOTE:  If the data type you pass to Flatten to String is a non-scalar type (of undefined size) such as a strings and arrays  Flatten to String will by default add header information to the beginning of the string that defines the size of the non-scaler type that was translated.

ashwinilele
Member

D

mssorters
Member

D

Rathan123
Member

what is the use of binary string and How to identify/expect the input from output binary string??

Rathan
crossrulz
Knight of NI

Rathan123 wrote:


                       

what is the use of binary string and How to identify/expect the input from output binary string??


                   

It is used a lot in TCP/IP communications since you have to write a string out.  I have also had to use it when talking to a PLC over Ethernet/IP.

One of the more unexpected places I use it is for interprocess communications.  I like to use queues with a string data type and then I can embedd the command and any parameter data in the string.  It is a derivative of using a cluster with a string and variant for sending commands.

As far as knowing what the data in the binary string is, well, you don't know.  You just have to know who sent the data and how they want you to interpret it.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5