LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

tcp connection to Processing not working

Sorry I've only just begun working with labview, by server code do you mean what I have developed in the block diagram? All I have done there is created the TCP functions: open connection, read and close connection.

0 Kudos
Message 11 of 20
(1,062 Views)

No. You posted a document that showed the server you are trying to send commands to. It has a function labViewParse that does a println when it gets a command from LabVIEW. Does this print happen?

=====================
LabVIEW 2012


0 Kudos
Message 12 of 20
(1,060 Views)

A network server is an application that listens for connections from other devices. Clients are the applications/devices that connect to the server. The C code you posted appears to be the server which LabVIEW (the client) will connect to. If you are using the TCP Read in your LabVIEW application you are not sending the command to the server. You would need to use the TCP Write to actually send the string. It would be very helpful if you could post your LabVIEW code.



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 13 of 20
(1,053 Views)

There is no println when I run labview which may mean that processing is not recognizing the command that i am sending it. i have attached the labview file that I created to this post. The DAQ devie is recording properly for me and the results are saved in a format which i can access through excell. The only issue i have is the TCP connection.

 

And apologies for earlier I am using the TCP write function I mistakenly said it was TCP read earlier.

0 Kudos
Message 14 of 20
(1,027 Views)

I think that as someone mentioned earlier you need a linefeed after the C1 command.

=====================
LabVIEW 2012


0 Kudos
Message 15 of 20
(1,023 Views)

how do I add in a line feed into the block diagram? I am unfamiliar with how line feeds work. For the TCP write function I connect it to the data in part but where do i add in the line feed?

0 Kudos
Message 16 of 20
(1,018 Views)

The easiest way is to right click on the string constant and change it to "'\' Codes Display". The edit the string constant and type "\n" at the end of the line.

 

Also, as written your application will only send the command to the server once. You loop will continue to run until the DAQ is stopped. I am not sure if this is what you want or not but I though I would mention it.



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 17 of 20
(1,016 Views)

Thanks fro that still no luck unfortunately. I've set the command to only send once as when it sends processing should play the audio sound on a loop its coded to do that already so shouldn't need to have to loop it in Labview. This is very frustrating it may just be the processing code because it is sending and no errors are coming back in labview.

0 Kudos
Message 18 of 20
(1,009 Views)

It may be looking for a carrage return/line feed termination as earlier suggested.

 

The Word doc you posted earlier does not have the code for the read that it is using so it is difficult to know exactly what it is looking for to determine it has read a complete command.

 

Do you have anything that works? If so, you can trying running a network trace using Wireshark to see exactly what the other application is sending. Have you tried connecting using command line telnet or a pprogram like Hyperterm or TeraTerm? Do these work? If so, try the network trace to see what they are sending. Alternatively you should be able to log the data they are sending.



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 19 of 20
(1,007 Views)

There are a few ways to add a linefeed. You could just press enter in your string constant.  You could also use concatenate strings and add one of the string constants "Line Feed",  "Carriage Return" or "End of Line". That last constant is just made up of the first two.

=====================
LabVIEW 2012


0 Kudos
Message 20 of 20
(996 Views)