LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I send the numbers array generated after converting a Cluster into Flatten String accross TCP/IP?

Hello pipol!!!

I'm trying to send a cluster accross TCP/IP using LabView 7.0. For this purposse, I use the Variant to Flattened String function, but this one generates, in addition to the flattened string, a number array needed to unflat the string. The trouble that I have is that I'm not able to send this array accross TCP/IP.
Anyone knows if this is possible???

Many thanks in advance!
Dani
0 Kudos
Message 1 of 4
(3,325 Views)
Hi Daniel,

The attached VI (in LV 7.0) may help illustrate how to flatten and un-flatten data structures.

Note:
The top output of the flatten to... , labeled "type string" was confusing when I first encountered this function. For what you are doing, just ignore it.

FYI
I know of only two applications for the this "type string" (that come to mind) are when you need to deal with a generic data type where it is not possible to define using the normal "wire it up" method. These cases are;
1) When setting a control value on a VI where the icon connector is not available. This is illustrated in the code at the bottom of the diagram where you will find an "invoke node >>> Set control value".

2) The other example is when you want to find the
strings associated with an enum but do not want to use a property node. This is illustrated in the example I posted for this question.

http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=137&HOID=5065000000050000009ACB0100&HTHREAD=000117658000117789000117841&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0



I hope this helps,

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Download All
Message 2 of 4
(3,325 Views)
Hello,

I'm using a flattened string to convert cluster in string and i use TCP and it's works.For what i undestand of your problem you don't know to convert the string in cluster again. you need to use unflatten from string and in type connector you must put an cluster with same elements.
0 Kudos
Message 3 of 4
(3,325 Views)
Many thanks, Ben. What I needed was the "Type Cast" function. I didn't know about his existence. I'm able now to transmit clusters converted to string data accross TCP/IP.
What I have done to work before this was to develop a function that converted a number array to a flat string, and the inverse, but with this is too much easier!
Dani
0 Kudos
Message 4 of 4
(3,325 Views)