01-07-2011 12:12 PM
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.
01-07-2011 12:18 PM
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?
01-07-2011 02:13 PM
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.
01-10-2011 09:11 AM
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.
01-10-2011 09:14 AM
I think that as someone mentioned earlier you need a linefeed after the C1 command.
01-10-2011 09:29 AM
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?
01-10-2011 09:34 AM
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.
01-10-2011 09:41 AM
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.
01-10-2011 09:43 AM - edited 01-10-2011 09:45 AM
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.
01-10-2011 10:01 AM
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.