04-23-2007 12:11 PM
04-23-2007 12:52 PM - edited 04-23-2007 12:52 PM
I'm trying to understand how you can have no error but get no data. Because your while loop will only stop if there are 4 bytes read, are you aborting the VI? If so, then this might account for not receiving an error. What type of cable do you have between the two computers? Is it a straight through or null modem type. Have you tried using Hyperterminal at both ends to verify the cable is correct?
When you verify that you have the correct cable, then your code could use some cleanup. Start with fixing the wiring so that it looks something like the code below. Then you want to start using the VISA Bytes at Serial Port in the VI that does the read.
Message Edited by Dennis Knutson on 04-23-2007 11:53 AM
04-24-2007 10:07 AM
04-24-2007 10:25 AM
If you were to right click on the string indicator and select 'Hex Display', you would probably see 'FFFF FFFF'. Something is getting mangled up.
I can't stress enough the need to first test your cable and comm settings with something like hyperterminal.
When that works, you need to modify the VI at the receiving end. Unless you append a carriage return on the sender, you have to disable the termination character in the VISA Initialize Serial Port. After the VISA Initialize Serial Port, you should use the VISA Flush I/O Buffer to clear out any characters that might be in the buffer. Start the VI at the receiver. Use the VISA Bytes at Serial Port to do a read when bytes are greater than 0. The run the VI at the sender.
04-24-2007 01:42 PM
04-24-2007 02:14 PM
I can't imagine a usb->RS232 converter that only works in one direction. Every one that I've used will transmit and receive. Maybe yours is defective or the cable you are using is bad.
In any case, yes you can use the TCP/IP functions in LabVIEW to communicate between two pc's. If you have a dedicated NIC in each computer and connect them with a cross-over cable, then I believe the latency is fairly small but I have no numbers to post. If you use an existing network connection, then the overall network traffic is going to have some effect.