09-08-2010 10:50 AM
Hello,
I try to communicate with PowerSupply by TCPIP using NI VisaNS.
So I add manually TCPIP resource of a Raw Socket: "TCPIP0::192.168.2.30::80:SOCKET" (PS has web-interface so the port 80 is only opened).
I have a small test application on C# and use SCPI commands provided by PS producer.
When I try to "read/query" something from the device I got error message with the error code: 0xBFFF0015 - ErrorTimeout.
I have played with termination symbols and timeout value, but it didn't help. .Net examples provided by NI gave same results.
Can someone help me?
Thanks in advance!
wbr, Alex
09-09-2010 07:29 AM
Are you sure the correct port is 80? I know most web servers are on port 80 and you will then have to deal with all the html baggage that gets sent. If you are sending SCPI commands (e.g. *idn?\n) then you connect to port 5025 usually. You need to read the documentation for the instrument.
It could also be the case that the PS has a VXI-11 port and then you don't specify the port number in the resource string but use "INSTR" instead of "SOCKET".
09-09-2010 08:25 AM
Hi cymrieg,
Thanks for answer.
Yes, I know that port 80 is used by web-server, but the PS producer specified this one as a device connection port that should work.
VX11 protocol support was removed by producer in the new version of the interface card. With the old interface there're no problems to use "INSTR" instead "SOCKET".
Unfortunately I cannot get a help from the instrument producer, as they support only LabView applications, not .Net...
I have tried to send complete Http packet with the SCPI command (just for test) and it was working, but this is not a solution...
09-09-2010 08:47 AM
btw, device producer connect to instrument in LabView using port 80. And it is working there.
09-09-2010 09:29 AM
Who is the manufacturer of the Power supply and what is the model number?
09-09-2010 09:36 AM
Manufacturer: EA www.elektroautomatik.de
ModelNr: EA-PS8080 (PS8000 2U family)
09-09-2010 10:54 AM
Hello again,
Today I have played a little bit with the device and the strange thing is that I got a different error during reading: VisaException 0xBFFF003E, ErrorIO.
I have analyzed TCPIP communication with Wireshark: the packet with the command (*idn?) was send but as a respond I got 4 zero bytes.
I have ask PowerSupply producer to check same situation with Wireshark and their test LabView application: they got a correct answer about the instrument in a response packet.
Communication list looks similar to mine.
Another interesting thing: I have tried example program from NI for .Net 3.5 (Simple Read/Write). I can connect to the device (TCPIP::192.168.2.30::80::SOCKET).
When I try to send a command *IDN? Wireshark show me same behaviour as before: command sent, response 4 zero bytes. When I try to send second time: it didn't send at all - no packet in Wireshark.
With the third I got an error 0xBFFF00A6 ErrorConnectionLost.
09-10-2010 03:58 AM
some more details to the previous post.. I have a screenshot from the LabView program (from PS producer), that send and read data to/from instrument.
Instrument support told me that the write cycle is done in 2 sequenced commands: with the first one they send length of the command, with the second one command itself.
same sequence for read: first read number of bytes, them response with the that length.
I implement "write sequence"... In Wireshark I check that device return always 4 zeros after command write. And I cannot read any data, it gave me always ErrorIO 0xBFFF003E.
I am not really familiar with LabView, maybe screenshot in the atatchment will help to someone to help me 🙂
09-10-2010 08:52 AM
I think your issue has nothing to do with Measuement Studio and .NET. I would move your LabVIEW isssues/questions to the Instrument Control forum where there are several people knowledgable in LabVIEW, VISA and instrument programming.
09-10-2010 09:35 AM
Thanks for help. The goal was to realize the communication part that will work in .Net using only LabView program screenshot
Finally I got it running. First of all I need to open session every time I want to send/receive a command.
Second, as I understand instrument producer has implemented communication with a device (write/read commands) in several TCPIP packets:
first packet with command length, then packet with command.
In this case I need to cover this functionality in my application using NI VisaNS write/read commands ( I cannot use query command because of
2 packets sending/receiving).
One more question that I want to ask: is there a possibility to keep connection with the session alive?