LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Different data types over TCP

Hi,

 

I have a TCP connection that are going to send 3 different types of data, numeric, boolean and string. I choose the datatype to send with enumerated control and case structures. I first choose datatype and send the message with the press of a button.

 

I am able to recive all datatypes but the numeric and boolean are not displayed correctly as TCP read output i string, I know that I can convert the data type with type cast, but this will only work if I know the datatype I am sending, er there anyway to somehow figure out what datatype are recived from the TCP read String? Then convert the data to correct type and display the data correctly? I was thinking about sending a string with some code for the datatype sendt, and then converting the TCP read string accordingly, but is there an easier way to solve this?

 

 

Thanks for any help.

 

With kind regards


Espen Olsen

0 Kudos
Message 1 of 2
(3,034 Views)

I highly recommend you have a look at the STM library.  It does exactly what you are looking for.


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
0 Kudos
Message 2 of 2
(3,030 Views)