Thanks for your quick response 

I have different commands that I want to control instruments via GPIB 
commands, It will be okay if I can import NI visa and build different logic 
in automating instruments. 

Here is a simple Python command I send to setup spectrum analyzer. I am a 
beginner and I would like to learn and stick with one language and Julia 
seems to be interesting to me

import visa
import numpy as np
class MXA_ACP:
    def __init__(self,gpib_address="GPIB0::18",hw = 1, route = "A"):
        
        rm = visa.ResourceManager()
        self.handle = rm.open_resource('{}::INSTR'.format(gpib_address))
        #self.handle= 
visa.instrument('TCPIP0::{}::INSTR'.format(TCPIP_Address))
    
          
    def ACP_set(self,BW,freq,numCarr,spacing):
       self.handle.write('system:preset')
       self.handle.write('CONFigure:ACPower')
       self.handle.write('CONFigure:ACPower:NDEFault')
       self.handle.write('INST:SEL LTE')
       # set standard based on BW 
       if BW ==5:
          self.handle.write('SENSe:RADio:STANdard:PRESet B5M')
       elif BW == 10:
         self.handle.write('SENSe:RADio:STANdard:PRESet B10M')
       elif BW == 20: 
        self.handle.write('SENSe:RADio:STANdard:PRESet B20M')
        
       self.handle.write('ACP:carr:coun {}'.format(numCarr)) #set number of 
carriers 
       self.handle.write('ACP:carrier:RCFR {} MHz'.format(freq))#set Freq
       self.handle.write('ACP:carr1:list:width {} MHz'.format(spacing)) # 
set carrier spacing 
       self.handle.write('Corr:nois:flo ON') # noise floor extention
       self.handle.write(':power:RF:range:optimize immediate')
       self.handle.write('ACP:aver:coun 50') # averaging 
       self.handle.write('*WAI')   # wait for averaging to finish           
       acp = np.fromstring(self.handle.ask('read:ACP?'), sep=',')
       acp_3rd_upper = acp[4]
       acp_3rd_lower= acp[6]
       acp_5th_upper= acp[8]
       acp_5th_lower= acp[10]
       print acp_3rd_upper
       print acp_3rd_lower
       print acp_5th_upper
       print acp_5th_lower
       return  acp_3rd_upper, acp_3rd_lower,acp_5th_upper

On Monday, July 4, 2016 at 1:29:50 PM UTC-5, Keno Fischer wrote:

> You may want to look at Instruments.jl: 
> https://github.com/BBN-Q/Instruments.jl 
>
> On Mon, Jul 4, 2016 at 2:00 PM, Alex Mellnik <[email protected] 
> <javascript:>> wrote: 
> > Hi Yared, 
> > 
> > This should be possible, but it could be less than ideal in some 
> instances. 
> > What exactly are you hoping to automate? 
> > 
> > Like Isaiah, I don't know of a specific GPIB library for Julia, but if 
> you 
> > are using the NI drivers you can call them directly from Julia (see 
> > 
> http://docs.julialang.org/en/release-0.4/manual/calling-c-and-fortran-code/ 
> > and there's a bit of specific information about the GPIB libraries here: 
> > 
> http://alex.mellnik.net/application-notes/application-notesusing-nis-gpib-drivers-in-qt/).
>  
>
> > 
> > -A 
> > 
> > 
> > On Saturday, July 2, 2016 at 5:39:07 PM UTC-7, Yared Melese wrote: 
> >> 
> >> Can Julia be used as instrument test Automation? Send commands via GPIB 
> to 
> >> different instruments 
> >> 
> >> If so is there Visa library for it? 
> >> 
> >> Thanks 
> >> Yared 
>

Reply via email to