Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VXI-11 Server Example

I think it works.

I used the example to define how to pass the master GPIB back and forth, and make the master temporarily act as an instrument.

Have yet to build the actual code, but the pieces look like they are working as we needed.

Thanks very much for the help.

 

WRT the loads frying. We are running about a 50% duty cycle when the test is functioning, and are close to the limits the loads will take steady state. If the process freezes, half of the loads will cook at 100% and exceed their ratings by quite a bit.

0 Kudos
Message 11 of 37
(7,820 Views)
Hello everyone,

I think I may have simmilar problem as the founder of the thread, that's why i am not starting new one, just writing here.

As my thesis I am doing server that will support vxi11 protocol for Visa library clients (for example LabVIEW software). I've implemented all server (or most) server functions, but now I am facing some significant problems.




Problem 1

The server does not see all input parameters that are passed while calling viOpen function ( this function has clientID, device, lock and lock_timeout ). My XDR structure looks like that :

struct Create_LinkParms {
    long clientId;
    BOOL lockDevice;
    u_long lock_timeout;
    char *device;
};

while debugging on server during create connection only parameters I see getting to server are client ID and device, lockDevice and lock_timeout are always 0, no matter what values I put on viOpen call.

Problem 2

This problem is noticed while trying to execute Visa Write or Read in asynchronously mode. I got a visa error like that one in attachment. The problem is I am not sure what 'tells' visa that it is enabled for async events. I suspect that it may be caused by the type or values in structure that is returned after creating link on server (viOpen calls a function on server which input parameters are Create_LinkParms, and return value is like this one below)

struct Create_LinkResp {
    Device_ErrorCode error;
    Device_Link lid;
    u_short abortPort;
    u_long maxRecvSize;
};

If anyone has a clue how can it be solved I would be very grateful, thanks in advance

PacHOOk

--------------------------------------------------
Regards,

PacHOOk
0 Kudos
Message 12 of 37
(7,694 Views)
Hi pachook,

What API are you using to communicate with the server, and which version are you using? Also, what version of NI-VISA are you using? You can find this by going to Measurement & Automation Explorer > Software > NI-VISA. The version number will appear on the right window pane.

Could you explain a bit more about how you are creating programming the server to support the VXI-11 protocol?

In LabVIEW, VISA writes and reads default to async, and you can change this by right-clicking on the subVI and choosing Synchronous I/O mode > Synchronous. There is more information about this here.

Could you additionally perform an NI-Spy capture and upload the .log file here so we can take a look? This would help us troubleshoot things further. There is more information on how to do this here.
Rasheel
0 Kudos
Message 13 of 37
(7,662 Views)
Hello Sputnikrent,

thank you for your reply,

to communicate with the server I use LabVIEW 7.1 with 4.2 version of VISA. Sorry but I dont really get what do you exaclly mean by API 🙂

I also tried to communicate to server using simple C - code like this one here http://kmeif.pwr.wroc.pl/elektron/interfejsy/wyklad_a2/sample.zip

I did try to use NI-Spy (results you can find below)



I also attach my test vi.

The aim of my task is to do an environment close to real server and device as possible, so that for users (students) switching beetween my server and device model and real one will be just changing IP address of the server.

In order to get usability of real vxi server I did my server code and XDR file using Distinct RPC library. The *.x file was designed basing on specification of vxi protocol..

I hope it helped a little

PacHOOk
--------------------------------------------------
Regards,

PacHOOk
Download All
0 Kudos
Message 14 of 37
(7,657 Views)
Pachook,
 
I think you are going to have to revert to using a packet sniffer like wireshark to see what is going on between the client and server. It does help to have a VXI-11 instrument (server) that you can observe the handshake. Agilent and NI do this slightly differently and different instrument also respond differently.
 
0 Kudos
Message 15 of 37
(7,641 Views)
Hi pachook,

What is the server you are refering to, is this an actual PC, or is this a VXI-11 instrument? Like cymrieg mentioned, the information might be parsed differently depending on what you are communicating with. Let us know!
Rasheel
0 Kudos
Message 16 of 37
(7,598 Views)
Hi all,

thanks for your interest,

the server I am refering to is a pc with server software on it (the one I am developing), but I also did some tests with vxi 11 instrument.

I would be happy to investigate the network, and compare my server results with vxi, but right now the laboratory I could do it is quite busy (espacially with network communication)

we shall see in few weeks i guess.


--------------------------------------------------
Regards,

PacHOOk
0 Kudos
Message 17 of 37
(7,591 Views)

I got same problem about ONC/RPC on LabVIEW,and needs some advises about that.
I need to build ONC/RPC Server on a PXI controller with LabVIEW on WINDOWS XP,so the other PC can treat the PXI controller as a LXI Instrument,I have read the specifications of LXI and VXI-11 and some other papers,and have Search the NI forumn and LAVAG,so I download XML-RPC example,RPCGEN,windows SDK and so on,but seems helpless,and I found someone said that it is difficult to build ONC/RPC on windows,and Microsoft's RPC is different from ONC/RPC,I also downloaded the JAVA Remote Tea ONC/RPC library for windows,but I know nothing about JAVA.
It is said that the LXI Consortium has the code for ONC/RPC,but only valid for its members.
Which way mybe helpfull?Any reply is appreciate.

0 Kudos
Message 18 of 37
(6,348 Views)

If you have a skil to write UDP and TCP socket programs using WinSock library in C/C++ language, it is not impossible to implement VXI-11 service code. The easiest way is spy the actuall client/server traffic using Wireshark software. RPC/VXI-11 is one of simple wrrapered protocols of TCP having some header (documented in VXI-11 spec) on both send/receive packet. Some difficulty is VXI-11 discovery function, which uses UDP port 111 as following RPC port mapper function. This can be also captured by Wireshark by spying UDP and TCP port 111 packet.

 

Also, the VXI-11 is not only the protocl used by LXI instruments.  If your client software can use simple RAW TCP socket instead of VXI-11/RPC, your server code may be simple socket. The standard protocol of this is called SCPI-RAW having TCP port 5025, but there is no special protocol rule because it is simply a full-duplex raw socket streaming SCPI strings with 0x0A termination. This server type can be controlled from VISA clients using a VISA address as like "TCPIP::192.168.x.x::5025::SOCKET"

 

 

Message 19 of 37
(6,343 Views)

Many thanks to Mokoto!

I have alread installed the Wireshark softwar and capture the packet,I have try to sent the packet data to port 111 using TCP,seems not work,I will try that again using UDP.

I found the packet data between PC and LXI instrument is in some format like this: Source IP Address + Destination IP address ...+...+ TCP port and something like this,hope  I can make it work.

 

It seems that  simple RAW TCP socket is much simpler, I wonder if the server code can be done just by LabVIEW using NI VISA?As the client code can be done using VISA.

I will try  RAW TCP socket ASAP.

 

I will reply here if I make  any progress.

 

Thanks to Mokoto again.Have a good day!Smiley Very Happy

0 Kudos
Message 20 of 37
(6,328 Views)