cancel
Showing results for 
Search instead for 
Did you mean: 

read and save settings from instruments

jjlee
Active Participant

read and save settings from instruments

Message contains an attachment
Currently, the 'save config' case saves the data read from the user interface (in the 'aggressor settings' tab)
how can I change this 'save config' event so that;
- Read all the insturment settings from hp8133s and hp8648 (along with GPIB addrs)
- Load into the user interface
- Save to a file (*.ini)
 
Thanks,
 
 
37 REPLIES 37
Dennis_Knutson
Knight of NI

Re: read and save settings from instruments

In order to determine how an instrument is actually set up if done manually, you will have to write the queries yourself as these are not normally part of a driver. With SCPI, the query is usually the command used to set it with a question mark at the end. For example, if the command to set a DMM's function was FUNCTION:VOLTS DC, in order to read what it is, you would issue the command FUNCTION? and then do a read and get the value VOLTS DC. You will have to read the individual programming manuals to determine the actual command syntax for the instrument and decide which parameters you wish to read and save. Once you've done that, you can write that information to your existing clusters that will update the front panel controls, run the "set config" case and the "save config" case.
jjlee
Active Participant

Re: read and save settings from instruments

I did find SCPI commands from the user manual of hp8133, but I am not sure how I should get started. I wonder if there is any example that I can take a look?

Russ_Evans
Member

Re: read and save settings from instruments

Hi jjllee,

One of the vi's in the driver library is "initialize".  In that vi they use the command *IDN? to query the ID of the instrument. That is an example of what Dennis is talking about. Now you just need to develop similar vi's for the queries you are interested in.

cheers,

--Russ
jjlee
Active Participant

Re: read and save settings from instruments

Message contains an attachment

Hi Russ,

Thanks for your suggestion.

I looked at the user manual with SCPI section and they all seem like set & query is the form for all these commands. I though I only need to open VISA session and read in function with appropriate 'string' command from the manual. However, all the examples are for setting a particular parameter. (e.g., setting duty cycle on page 5-35)

plz see the attachments....

 

jjlee
Active Participant

Re: read and save settings from instruments

Message contains an attachment
here is the manual
Russ_Evans
Member

Re: read and save settings from instruments

Message contains a hyperlink
jjlee,

I think if you look at page 5-3 you will notice that nearly all if not all commands have [?] option. So if you want to read what the duty cycle is you simply write your string as if you were going to set the value but instead of a value you use a question mark.

for example to query duty cycle chan 1 would have a string like the following
": PULS: DCYC1?"

Also the 8133 is in the NI instrument driver network have you download their libraries and examples at

http://www.ni.com/devzone/idnet/default.htm

hope this helps

Cheers,

--Russ


Message Edited by Russ Evans on 05-24-2006 05:49 PM

Message Edited by Russ Evans on 05-24-2006 05:50 PM

xseadog
Active Participant

Re: read and save settings from instruments

Hi jjlee,

with regard to 8648 generator instead of saving all of the setup values,
 why don't you just do a reset command ? Which will place the instrument in the factory default state.
 Thus all you need to do now is write ( already saved values) the parameters that you wish to start up the statea in.

If you read the manual I'm sure that it explains what the factory initial state parameters are.Also you know that you are in a predetermined  condition.Remember
to query the state after you have written the command!!

 Else you could end up frying your electronic circuit if you assume that the instrument has understood the command that you wrote to it.

As a rule of thumb:

 if changing several parameters it is prudent to disable the output before doing the ammendements.

Regards
xseadog


jjlee
Active Participant

Re: read and save settings from instruments

Thank you all for your helpful suggestions!
jjlee
Active Participant

Re: read and save settings from instruments

Message contains an attachment
I have created this case, "load instrument settings"
First four settings are from hp8133A voltage output.vi (from instrument library)
and the last two pulse setting VIs were modified version from voltage output.vi
I have created an array to gather all output values, but don't know how to pass it on to the front panel...
could you please advise on how to accomplish this?