From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VXI-11 Server Example

Hi All,
 
   We have a legacy (non-LabVIEW) client application that controls an instrument using the VXI-11 protocol.   We want to use that legacy application to control my LabVIEW VI instead.  I want to intercept the VXI-11 commands and process them myself (my LabVIEW software controls one of our custom boards).  I assume my LabVIEW application will have to assume the role of a VXI-11 server.   Do I need to purchase the NI DDK to implement a primitive VXI-11 driver capability?   Does anyone have an example VI that shows how to use LabVIEW as an VXI-11 device on the server side of the protocol? 
 
    Any help would be greatly appreciated.
0 Kudos
Message 1 of 37
(14,757 Views)
Hello. 
 
Thank you for posting to the NI Discussion Forums.
 
The VXI-11 protocol is fully supported by NI-VISA version 2.6 (or later) on Windows, Solaris and Linux operating systems.  The following website has great information on how to use VISA and MAX to configure communication with the device:
 
Using 3rd-Party Ethernet-Based GPIB Devices with the Measurement and Automation Explorer
 
That said, I am a bit unsure if this is exactly what you are looking for.  My understanding is that you currently have an app that controls an instrument.  However, now you want that same app to control a LabVIEW VI.  Can you explain this a bit further if this is correct or am I misunderstanding you?  The information I included above is more for using LabVIEW to control the instrument and eliminate the legacy app.  This would be fairly easy to implement so maybe, even if you hadn't considered this route, you could completely eliminate the legacy app and just use LabVIEW and the instrument. 
 
Let me know a little more about your application and I will be happy to continue helping you!
 
Brian F
Applications Engineer
National Instruments
 
 
0 Kudos
Message 2 of 37
(14,715 Views)
If you are just trying to control a VXI-11 instrument from LabVIEW app as a "VXI-11 client", you can simply use VISA library as Brian mentioned. 
 
If you are trying to write a "VXI-11 server" such as for emulating an LXI or VXI-11 instrument, you must write an ONC RPC server code, which specially supports VXI-11 protocol.  Sorry but I don't know if LabVIEW can be used for this purpose when using NI-DDK.  Other approach is write the server code with C/C++ with an ONC RPC library.  (Microsoft does not provide any RPC library for Windows but some 3rd parties sell this kind of middle-ware.  Linux does provide this library with no charge as a part of OS kernel.)
0 Kudos
Message 3 of 37
(14,703 Views)
I'm not sure if NI still sells it, but in the past NI sold a product called NI-Device that would allow you to create a VXI-11, USBTMC, or GPIB instrument.  The PCI-8215 was required for USBTMC and GPIB support.  NI-Device implemented all of the VXI-11 state machines and all you had to worry about is what messages you supported and what functionality you wanted to do when you received a message.  The only down side is that it was all in C or C++.  The product didn't have any LabVIEW support, but it would allow you to create a VXI-11 device.

Just out of curiosity what kind of device were you planning to replace and what kind of hardware are you using.

-Josh

Message Edited by JoshuaP on 06-22-2007 08:28 AM

0 Kudos
Message 4 of 37
(14,695 Views)

Hi Brian,

  Thanks a million for the quick response.   This is the 1st time I've used the NI Discussion Forum, so I wasn't sure what to expect.   Anyhow, you are exactly correct.  My LabVIEW application needs to be commaned from a legacy client application.   My LabVIEW application provides the low-level interface to our board.  The legacy application is a customer application written in another language.   The legacy application uses VXI-11 protocol to control another VXI-11 compliant device.   We need the legacy application to control our board using the VXI-11 protocol.   You could say I need to write the device driver for a new VXI-11 compliant device interface.  

Thanks Again.

0 Kudos
Message 5 of 37
(14,683 Views)
Yes, I need to write the server side.   Our customer sent me a bit spec on the VXI-11 protocol, but I thought I could take the easy route and find an existing example in LabVIEW.  I've had to develop C++ CIN's in the past to provide capapability to unsupported LabVIEW network protocols in the past, so that shouldn't be a big problem once I find the C code.
Thanks for the reply.
0 Kudos
Message 6 of 37
(14,682 Views)

Thans for the Info.   I'll look into NI-Device.   That sounds like the ticket, if I can get a hold of it.   It sounds like this may be more work than expected.  

Update : It looks like VIX-11 is part of the LXI spec.  Maybe I could find an example in LXI as LXI is more current. 

http://www.lxiconnexion.com/articles/1006/LXI%200610%20Device%20Control.pdf

Thanks again for the help.

ps.  Our product is still in R&D, so I can't really talk about it.  The initial command interface is very simple, but will grow as we implement new interfaces.

0 Kudos
Message 7 of 37
(14,678 Views)
I think my problem is similar but of a different stripe. I have a USB to GPIB port controlling two instruments. One is a power supply that will, if the controlling computer goes on the fritz, fry my loads. I would like to implement a second computer as GPIB watcher, and when the first stops signaling, have the second take over and shut down the power supply, assuming the first computer failure is not GPIB chatty. This should be an easy task, but it is not obvious how to implement it with the Labview 8.2. If necessary I can build routines in microsoft visual basic if that would help?
0 Kudos
Message 8 of 37
(14,211 Views)
Hello FredM,

Here is your initial system configuration:

1.  USB-GPIB device in your first computer (address 0) (Initially this is the System Controller)
2.  Device 1 (address 1)
3.  Device 2 (address 2)
4.  GPIB device in backup computer (address 3) (Initially GPIB monitor)

Since you can only address a single device at one time, and that you can only have one system controller at any time, you will need to echo all commands sent to address 1 and 2 to address 3.  This way, your "GPIB monitor" will be able to see all the commands sent on the bus.  You can also simplify this and send one command at address 3 every second (for example).  Initially, the GPIB device in your backup computer will have to be initialized as "Non System Controller".  You can look at this example to see how to programmatically do this in LabVIEW.  When the timed command is not received (or when something is wrong with the other commands), your "monitoring program" can reinitialize itself to be system controller, take control of the bus, and launch the same VI that was running in the main computer.

If your computer freezes in such a way that the USB-GPIB device is still seen as the system controller, you will get errors in the backup program.  I suggest you test this thoroughly before running with your power supply. 

As a seperate question, what can happen that will cause your loads to fry?  Can you elaborate a little bit on this?  There may be settings available in your power supply that will prevent this from happening.

In any case, let me know the results of these tests.  Have a great day.
O. Proulx
National Instruments
www.ni.com/support
0 Kudos
Message 9 of 37
(14,189 Views)
Thanks for the quick and detailed response. I will be trying it out today.
0 Kudos
Message 10 of 37
(14,180 Views)