Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Direct I/O - versus - Instrument Driver - versus - Basic Serial Read and Write

Hello,
 
I need to communicate via RS-232 with an Elmo motion controls servo drive.  Currently I can find no instrument driver.  So what do I do?
 
From the looks of it I can develop an instrument driver using the Instrument Driver Project Wizard or use the Direct I/O.  I am confused about exactly what the differences are between them and what advantages I will have with one or the other.  Also, can I just use something similar to the Basic Serial Read and Write example under the hardware section to communicate?  Or is the Basic Read and Write example identical to using a Direct I/O?  If I develop an Instrument Driver are API VIs and NI-VISAs used?  In the tutorials there doesn't seem to be a distinct difference between them.  What is the difference between VISAs and API-VIs?
 
Also, If I design my own Instrument Driver do I need to compile code to dowload or link to the API-VIs? 
 
Any explanation would be greatly appreciated!  
 
Thank You, JMJ
0 Kudos
Message 1 of 6
(5,031 Views)

I really don't knwo what you mean by API-VIs. Where did you read about API-VIs? For serial, the only way that is currently supported is with the VISA functions. When you use the driver project wizard, you will get some basic VIs that use the VISA functions. You will still have to write a lot of the code yourself. The project wizard is geared more towards traditional instruments such as DMMs, scopes, etc.

The serial examples use VISA functions as well. They are meant to demonstrate the basics. You configure the serial port, do a read, and then do a write. What you get out of the project wizard will not be that much different. You also have the Instrument I/O Wizard. This is not as flexible as a true driver but might be better for you (and easier to use). One advantage of the assistant is that you get help in translating any data that might be read back.

There is no downloading or linking required.

0 Kudos
Message 2 of 6
(5,024 Views)
Hi

The instrument driver should do two things:
1) have a similar API for all lower level function calls for similar instruments.
2) translate the user commands into hide the command language needed by the instrument and translate the results from the instruments into data the user needs.

direct IO is used internally by the driver to accomplish this. But it is not the kind of direct IO used in DOS 20 years ago.
It is always built on a big layer of communication bus overhead needed to make programming possible in modern systems.
greetings from the Netherlands
0 Kudos
Message 3 of 6
(5,015 Views)

Hello and Thanks for your help so for; however, I am still unclear what I need to do to communicate with my servo drive.

Could you please help me with which of the following option is the closest to what I need to do with any motifications:

1.  Use the Instrument Driver Project Wizard to develop an Instrument Driver, which will require a lot of code writing.  If this is the case, what program do I use to write code (Visual Studio..) and what code is needed?

2.  Use the Basic Serial Read and Write example and somehow download code to the VISAs?  Or do the VISAs not need code downloaded?

3.  Use the Instrument I/O Wizard that Dennis Kn... mentioned, in which case I don't need to write as much code?  Or was the statement "There is no downloading or linking required" referring to the Instrument I/O Wizard?

All I am going to be controlling is the position or velocity of a voice coil and getting feedback from an LVDT.

I know it sounds like I don't know what I am doing and that is because I don't know what I am doing, so I truly appreciate you taking the time to help.

The API VIs are described as the VIs that are internal to the Instrument Drives when I was reading through the tutorials. 

It sounds like the Instrument I/O Wizard may be the way to go?

Thanks, Mark

 

0 Kudos
Message 4 of 6
(5,003 Views)

1. An instrument driver in your case would be written in LabVIEW. An instrument driver is just a program that has a series of different functions to make controlling an instrument easier. For example, a driver for a dmm might have a single function to configure a measurement (i.e. set to volts/current/resistance/etc. and set the range). The function in this case would have an input to specify the resource (com port/gpib address), an input to specify the measurement type, and an input to specify the range. Instead of having to write these commands each time, just the function is called. An instrument driver is beneficial when the instrument is used in multiple programs. Please refer to one of the earlier links that explains what a driver is.

2. There is no download to anything. I don't think you have the correct understanding of what VISA is. VISA is an API for communicating with a variety of instrument types. The most basic VISA functions are VISA Write and VISA Read. For a VISA Write, you specify the resource (com port name, GPIB address, etc) and the string to write to that resource. Say your device is connected to Com1 and in order to move it, you need to issue the command 'MOV x,y' where x and y are numerics. To move to 1,2, you would wire the string 'MOV 1,2' to the write buffer input of the VISA Write function. To the VISA Resource Name input of the VISA Write, you would wire a value of 'COM1'. In order to get data from a resource, you use a VISA Read. Both of these basic VISA functions are shown in the serial examples. The command to send to the instrument is a front panel string control as is the control for selecting a VISA Resource. Any data returned by an instrument is shown in a string indicator on the front panel.

3. The Instrument I/O Assistant does all of the same VISA Writes and Reads as the serial example. The code is just hidden by the Express VI and what the wizard creates for you. Where it can help is converting front panel numerics to the necessary strings to be sent or in converting strings returned into numerics you might need in the program. It is similar in a way to a high level function in a driver. A single Instrument I/O Assistant can be setup to do multiple tasks. These tasks are generally sequential.

0 Kudos
Message 5 of 6
(4,992 Views)
Thank you for your help.  Those last paragraphs clarified most of my confusion.
0 Kudos
Message 6 of 6
(4,962 Views)