Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

tcp error code 59 when writing twice

Hi,
I'm writing a labview code to control an OMEGA CNiSeries temperature controller using tcp. I can write to the device once using the tcp write command and then I can read the response using the read command but when I try to write to the device a second time I get error code 59 (the network is down, unreachable, reset...) and then each subsequent tcp command I use results in error code 66 (network connection has been closed by peer).
The program opens the tcp connection, writes a command, reads back the data and closes the connection. This works fine until I put a loop around the write/read part of the program to get multiple data points before closing the connection. I've used a time constant of 5 seconds between subsequent loops so I don't think it's a timing issue. I've also tried resetting the controller between each iteration but I can not write to the controller to reset it after the first write command. I'll try to post the code (I'm using labview 7) when I get back into the lab.
Thanks in advance for any help.
~Justin
 
0 Kudos
Message 1 of 4
(3,822 Views)
Here is the labview program I've been using to test the device.
0 Kudos
Message 2 of 4
(3,818 Views)

Hi jsigley,

I can't pinpoint exactly what's causing the problem since I don't have the device, but it seems like the device is not in the expected state when you send the second command.  Maybe the first command has some unnecessary or incorrect data?

Did your device come with control software that works correctly?  If so, you might try using a packet sniffer to see the contents of the TCP packets that program is sending out, and compare them to the packets that LabVIEW is sending out, to provide insight into what the difference is.

Wireshark is probably the best known packet sniffer, though there are many others.

Eric V
National Instruments
Applications Engineer
Certified LabVIEW Associate Developer


"I'm a Ramblin' Wreck from Georgia Tech and a helluva (NI Applications) Engineer!"
0 Kudos
Message 3 of 4
(3,794 Views)
I can maybe try that. The device has a program from OMEGA to download but it is only for pc and we run only macs here. I've tried contacting them for the source code but they are reluctant to give it to me. The device does have an imbedded web server that I can access using safari so I can try using a sniffer with that. Thanks for your help.
0 Kudos
Message 4 of 4
(3,789 Views)