Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting up GPIB to send/recieve data

Ok I know this is a rather simple question, but I honestly couldnt find a clear answer in the forums nor in the help documents...

My situation is as follows whatever help would be greatly appreciated:
I am trying to write instrument drivers for my labs HP4195A network/impedance/spectrum analyzer. I was able to locate a similar set of drivers AG4395A network/Imp/Spect analyzer. However, because of the newbie that I am I am not sure how they work, so I am not sure how to adapt them for my instrument. Also for right now we would be satisfied with just a display through LabVIEW of what the network analyzer is reading, and no control. Do you know how I can accomplish this?

Well that is the main question or goal I am trying to accomplish other than that the following is the simple questions that I need help with, that may help me get to where I am going.

How can I permenantly set the GPIB address in my LabVIEW vi? I know its on GPIB::17 cause thats what the measurement automation program tells me as well as what the analyzer tells me.

How can I recieve data from my GPIB device? and what kind of data can i expect it to be?

How can I send commands to my GPIB device? like i'll even take a simple Beep command done thru labview.

Well I will extremely greatful for whatever help I can get. Thank You

Andrew Ho
0 Kudos
Message 1 of 2
(2,877 Views)
1) If you want to make a cotrol retain a specific value, right clock on the control and select Data Operations>Make Current Value Default. Most of the time, an instrument driver is called by another VI and I prefer to explicitly define the resource name in the calling VI for documentation purposes so I never set the default.

2) You get dtat from an instrument by doing a VISA Read. You need to provide the resource name and the number of bytes you expect to read. Usually, you do not get any data without first writing to the instrument and requesting data. The command you write is a query. The exact data you read will all depend on the nature of the query. You will read data in the form of strings. The strings will need to be converted if you want to perform numeric operations on them.

3) You write to an instrument using VISA Write. Again you need to specify the resource name. The write buffer input is the command you need to send to the instrument. Instruments that comply with 488.2 will support a standard set of commands for doing some basic queries. One such command is *IDN?. When the instrument receives this, it will reply with some information about itself such as manufacturer and model number. Other commands to set up measurement parameters are unique to each instrument and you have to get those from the manual. You'll need to study this to get the correct syntax. It may be similar to your old instrument but it may be completely different.

Before you start to do any LabVIEW coding, I would recomend you spend most of your time in MAX and issuing interactive commands there. You should also read the shipping document called LabVIEW Measurments Manual (Help>Search the LabVIEW Bookshelf). Lastly, the Instrument Driver Network has some links to what an instrument driver is and how to develop one. There are a set of templates available that can greatly simplify your job.
0 Kudos
Message 2 of 2
(2,865 Views)