Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

tcp/ip comm error help

Hi,

 

This is my first post so please don't flame me for bad programming, etc.  I'm trying to talk via TCP/IP communication to a power supply to get a reply to the standard *IDN? commmand.  I am successfully communicating with the device via hyperterminal without errors and the instrument appears in MAX and I can open a VISA test panel.  When I execute my VI everything is OK but the reply I get is "HTTP/1.1 400 ERROR"

 

Does anyone have any idea what I may be doing wrong?

 

Thanks,

 

Kevin

0 Kudos
Message 1 of 13
(5,507 Views)

Why aren't you using VISA in the VI? What's the instrument? Did you search for an existing driver?

0 Kudos
Message 2 of 13
(5,504 Views)

sounds like you are connecting to port 80 (web server) you should be connecting to the control port which could be 5025 or some other port which you need to find out what it is. If hyperterminal is working correctly what port are you using there 23 maybe?

 

0 Kudos
Message 3 of 13
(5,492 Views)
Thanks for
0 Kudos
Message 4 of 13
(5,488 Views)

My first reply got messed up but thanks for the replies.  I'm using port number 10001 with Hyperterminal so I'll change the port assignment on the VI to see what happens.  I thought I tried this and it didn't work but I'll give it another shot.

 

I have found some drivers for my device (Ametek XG40-21 Power Supply) but I'm getting errors using them and so far I have been unsuccessful at getting support from them.  Maybe I'll post the errors here to see if someone can help.  I'm very new to LV so things are moving slowly.

0 Kudos
Message 5 of 13
(5,483 Views)

I started to get a response from the power supply using port 9999 but it seemed like I was talking to the Ethernet port instead of the power supply.  It looked like I was talking to the Lantronix port (9999) instead of the power supply port (10001).  When I switch MAX to communicate over port 10001 I would not get any reply.  I probed the string wire and was sending *IDN?\n so I thought it would reply on that port.  I have the bytes to get set at 70 which should at least get something.

 

Any other ideas?

 

Thanks,

 

Kevin

0 Kudos
Message 6 of 13
(5,465 Views)

I'm trying to understand what you are actually doing. You've got an instrument that MAX has detected and you say you can communicate with the VISA Test Panels. Then you are using the TCP functions instead of VISA/MAX? You also said you tried the driver and got some errors. You must provide the error codes.

 

One other question. Did MAX automatically detect it or did you have to provide the IP and port?

0 Kudos
Message 7 of 13
(5,461 Views)

Thanks Dennis,

I'll post a detailed description of my issues tomorrow when I get back to work.  As far as MAX goes, I did have to provide the IP address and port in order to successfully open a VISA session.  Also, I redid the program using VISA instead of TCP commands, that vi is attached.

 

More to follow tomorrow.

 

Kevin

0 Kudos
Message 8 of 13
(5,451 Views)

Here is the updated situation on my comm issue I'm having.  First, the hardware setup:

  • Ametek XG40-21 Power Supply connected to laptop computer through Ethernet connection.  The power supply uses an XPort Ethernet device XPort web page  I used the Lantronix configuration utility to set the power supply IP address and port.  The power supply port is 10001 and the lantronix device port is 9999.  If I use port 9999 through Hyperterminal I talk to the Lantronix device and if I use port 10001 I talk to the power supply directly.
  • I had to manually configure the MAX connection to give it the IP address and port #.  IP address is 192.168.0.137.  Port is set to 10001 for the power supply.

Hyperterminal results

  • Talking to the device through Hyperterminal works as follows
    • Using port 10001 talks directly to the power supply and it responds to all commands like *idn? and other SCPI commands.  No errors observed during any communication. *IDN? reply is "Ametek, XG 40-21.0, SN# 1138A00611, 1.14 Build 27, 02/12/09"
    • Resetting hyperterminal to port 9999 talks directly to the Lantronix device (not power supply) and allows me to enter setup mode only.
    • If I reset to port 80 on Hyperterminal I get the following error - HTTP/1.1 0 ERROR

MAX Setup

  • As I mentioned before I had to manually configure MAX with IP address and port number.  MAX successfully opens ports 10001, 9999 and 80.  Screenshot of port 10001 below.

MAX10001.png

 

VISA Test Panel

  • When I open the VISA test panel and issue a *IDN?\n through viWrite is gives me no apparent errors but nothing comes back.  If I go to the viRead page and press execute I get a return count of zero and a BFFF0015 error on the return status window.  Screenshot below.

VISATP10001.png

 

 

 

  • VISA Test panel on port 9999
    • If I change the MAX port to 9999 and reopen a VISA test panel I do get something back from the viRead command as shown below.

MAX9999.png

 

 

  • I have tried setting the TERMCHAR_EN to true but it doesn't seem to change anything.

 

I think I am having some sort of error with the termination command but I have tried everything I can think of and nothing works.  Does anyone have any idea what I could be doing wrong?

 

Thanks in advance for the help.

 

Kevin

0 Kudos
Message 9 of 13
(5,438 Views)

I think you are on the right track with the termchar. By default in Visa it is linefeed whereas the default in Hyperterminal is carriage return unless you configure it to append linefeed. Use Wireshark to look at the packets.

 

0 Kudos
Message 10 of 13
(5,427 Views)