LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple data TCP/IP Labview

Hi, I have this VI that runs on a server:

dudalabview.JPG

 

What i have to do is a client that can write 2 parameters , the one circled in red and the other one in blue.

 

The red one defines the quality of the acquired video.

The blue one consists of an array of 5 booleans, to activate up/down/left/right/home commands to move the camera.

 

I've made some tests on other VI's practicing over TCP/IP and I can only send data of the boolean arrays, I don't really understand well how to send all the data so this VI can take only the parts that matter to each section (blue and red).

 

I'll really appreciate your healp, since I haven't found any example like this or that explains in a deeper way the byte size entry of the read data and how to take a portion of all the data send to manipulate it.

 

 

Thanks in advance.

0 Kudos
Message 1 of 10
(5,406 Views)

esponda wrote:

The red one defines the quality of the acquired video.

The blue one consists of an array of 5 booleans, to activate up/down/left/right/home commands to move the camera.


An array of Booleans is not the same as a single U8 value unless your client took 5 bits and compacted them into a single U8 via bit-shifting. Is this what's actually being done at the client? If not, and they're actually sending an array of Booleans, then you should be reading 5 bytes, not 1, since in most languages a Boolean is represented in memory as a single unsigned 8-bit integer.

 


I've made some tests on other VI's practicing over TCP/IP and I can only send data of the boolean arrays, I don't really understand well how to send all the data so this VI can take only the parts that matter to each section (blue and red).

 

I'll really appreciate your healp, since I haven't found any example like this or that explains in a deeper way the byte size entry of the read data and how to take a portion of all the data send to manipulate it.


I do not understand what you are asking here. The number of bytes to read is a function of the protocol you have defined. You can read them separately, or you can read all of the bytes at once and convert to an array of U8 or typecast to a cluster that consists of your data. For example, if your client is sending an I16 and a U8 you can do it as you have it, or you can read 3 bytes at once and Type Cast the string to a cluster that consist of an I16 and a U8.

 

The above assumes one byte for the commands having been bit-packed. If the client is actually sending an array of Booleans, then you should replace the second element with another cluster of 5 U8 values.

0 Kudos
Message 2 of 10
(5,372 Views)

Thanks for your response. I have another question, for example in this VI, If i send 3 bytes according to this VI will this read the first 2 bytes firsts, and in the blue part the byte left? or ir take 2 bytes from the 3 i send, and then 1 byte again from the 3 bytes send?

 

 

Sorry but I'm having trouble undertsanding this :s

0 Kudos
Message 3 of 10
(5,354 Views)

These are the kinds of questions you can answer yourself by experimenting.

 

But the 2nd read will read the 3rd byte because the first 2 bytes would have already been removed from the buffer by the first read.

0 Kudos
Message 4 of 10
(5,352 Views)

I have this 2 VI's for doing so, but look at them, and they do different things, the correct values appear sometimes, but then other values what I'm doing wrong?

Download All
0 Kudos
Message 5 of 10
(5,338 Views)

Because what you are sending is not what you are trying to decode after receiving.

 

Sender:

1.  4 bytes, length of string (32 bit) after converting booleans to U8 to string.

2.  1 byte,  character of the U8 after converted from boolean array.

3.  4 bytes. length of string (32 bits) after converting U16 to a 2 byte string

4.  2 bytes.  2 byte string after conversion from U16 numeric

 

Reader:

1.  1 byte, then converted to U8

2.  2 bytes, then converted to U16

0 Kudos
Message 6 of 10
(5,332 Views)

Sorry, I followed a tutorial , here I made this one with correct byte sizes, but only the boolean part is working :s , the numeric is not. Can you help me pls?

Download All
0 Kudos
Message 7 of 10
(5,328 Views)

Is there anything different in what you just posted vs. what you posted earlier?

 

Did you read at all anything I said in my last post?

 

It is very irritating when you get the sense that people aren't reading what you wrote, and wind up reposting the same VI's without any changes or attempts at fixing what you told them is wrong.

 

You are sending 4 pieces of information.  You are only reading 2 pieces.  Yet in your newest post you are still doing the same thing.  Why are you the sending information on the length of the string data you are sending when you aren't bothering to read that data in your receiving VI?

0 Kudos
Message 8 of 10
(5,325 Views)

Sorry , here's the one that is working, I appreciate your help, Im'm just a bit confused about with this project, but thanks for your help anyways.

Download All
0 Kudos
Message 9 of 10
(5,321 Views)

That's better.  It works.

 

So what problem are you still having?

0 Kudos
Message 10 of 10
(5,319 Views)