08-02-2016 08:11 AM
I have 2 laptops, 2 usb rs232/4 boxes, and one labview VI. The vi writes a command over serial to a meter and then reads the response string back which looks like:
Time 8:00 AM
Meter 1.23839 EPDH
It prints back over two lines like I have it there. But on one laptop it writes the command, hangs and then times out. Everything is set up in the VI identically, and the laptops are identical as well (same model, same brand, same com port plug, etc). Where do I begin my search for why this is happening? On the both laptops I can query the meter over hyeprterminal and get a response without issue so it must be a labview side thing. I tried reinstalling all drivers, VISA, Daqmx, you name it. Still times out...
08-02-2016 08:41 AM
I would try to confirm that the serial port on the non-working system is actually transmitting the command, and if it is, what the meter is sending back in response, by monitoring the serial lines with external hardware. It would take a little bit of wiring, but you could use the receive line on the working system to spy on the transmit or receive lines (one at a time) on the non-working system, to see what data (if any) is being transmitted.
08-02-2016 08:54 AM
@labview212 wrote:
But on one laptop it writes the command, hangs and then times out.
Hangs? What do you mean by hangs exactly? Do you mean the read function is working normally and waiting for receive bytes? In which case it hasn't hung, it's doing what is asked of it - waiting for the reply. It of course then times out when the device fails to send anything.
I would start by ensuring, as said by arteitle, that bytes are actually being written to the device. And that reply bytes are being sent back. yes, you'll need to intercept the Rx and Tx lines in the RS232 cable, but adaptors are available for this cheap enough. It's great that you have a working set up for this as it rules out lots of things immediately for you, such as faulty USB RS232 adaptors or meters.
08-02-2016 10:27 AM
@labview212 wrote:I have 2 laptops, 2 usb rs232/4 boxes, and one labview VI. The vi writes a command over serial to a meter and then reads the response string back which looks like:
Time 8:00 AM
Meter 1.23839 EPDH
It prints back over two lines like I have it there. But on one laptop it writes the command, hangs and then times out. Everything is set up in the VI identically, and the laptops are identical as well (same model, same brand, same com port plug, etc). Where do I begin my search for why this is happening? On the both laptops I can query the meter over hyeprterminal and get a response without issue so it must be a labview side thing. I tried reinstalling all drivers, VISA, Daqmx, you name it. Still times out...
Well i see you are using USB to RS232 converters. There is a good chance that there is driver issues with labview. I have experienced the same issues when using converters. The application would work, but would eventually fail and it would be entirely random. I switched to FTDI chip converters and i have not had a problem since.
08-02-2016 02:45 PM
I did not read that "you swapped all of the hardware between the two laptops and the problem remains with the original laptop".
It is all to easy to swap hardware than to to chase a subtle software issue. So step one, rule out the hardware.
If the hardware is OK then use NI IO Trace and compare what is diffeent between the two PCs.
Ben