LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Two way UDP/TCP Communication

Hello,

 

I'm trying to make a Control program for my robot, so I can drive my robot with a joystick and WiFi. On the robot is a PC with windows Vista an LV9.0 and a USB camera. I want to send some data (setpoint for motors) that moves the robot. And Send back the video feed.

 

I had made a program using TCP communication send data to robot and then send de video data back. That works but it takes allong time. So the reaction of the robot to the Joystick is to slow. For the video this isn't a problem. So I thought make to TCP connections with to while loops, one for the Video and one for the data. But I can't get it to work. If I only use video or data then it works but both on not.

 

I also want to use UDP for the data and the video feed. But I get the error that is to big.

 

I have added the programs I made in labview 2009.

Download All
0 Kudos
Message 1 of 5
(3,985 Views)
For starters your loops are not running in parallel. Since you wire the output of the Stop button from one loop to the other the second loop will not run utnil the first loop completes. I suspect that this is the bulk of your problem. Definitely change your code to allow the two loops to run independently of each other (no data dependencies between them) and see if this works for you. To allow both loops to stop at same time you can use a local variable (I can't believe I just said that) to read the value of teh stop button in the second loop. Better yet would be to use a notifier or a queue to pass messages between the loops.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 5
(3,964 Views)

Ah, stupid of me. I will edit this and test it. And is there a way to send the video that via UDP ? off must I split the that, don't no what the max data length is of a UDP packet in LV ?

 

Greetz,

 

Jeroen

0 Kudos
Message 3 of 5
(3,960 Views)
The lower level UDP libraries should handle splitting the data for you. However, the maximum UDP datagram size is 64K.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 4 of 5
(3,955 Views)

I have changed the software but It doesn't work quiet yet, still struggeling. Video on TCP and Data on UDP with different ports.

 

I let you know when it works.

0 Kudos
Message 5 of 5
(3,953 Views)