[Troop139] Fwd: RIGOL RSA code

James Gordon Beattie Jr w2ttt at att.net
Wed Sep 12 21:24:41 EDT 2018






Get Outlook for Android







From: chris_armstrong at rigol.com


Sent: Wednesday, September 12, 19:59


Subject: RE: RIGOL RSA code


To: BEATTIE JR., GORDON


Cc: James Gordon Beattie Jr, RIOS, ROQUE






Will do. Hope you find time to do what you need with it. Let me know if there is anything else I can do to help. Thanks again.




Regards,




Chris




Chris Armstrong


Director of Product Marketing & SW Applications


Rigol Technologies


8140 SW Nimbus Ave


Beaverton, OR 97008


office/fax: 877-4-RIGOL-1 x110


mobile: 440-781-4982


email: chris_armstrong at rigol.com






-----"BEATTIE JR., GORDON" <jb1589 at att.com> wrote: -----


To: "Chris_Armstrong at rigol.com" <Chris_Armstrong at rigol.com>


From: "BEATTIE JR., GORDON" <jb1589 at att.com>


Date: 09/12/2018 11:46AM


Cc: James Gordon Beattie Jr <w2ttt at att.net>, "RIOS, ROQUE" <rr986c at att.com>


Subject: RE: RIGOL RSA code




Chris,


I a bit… we should be able to ship it back sometime next week.


Go ahead and send me a shipping label sometime on Monday or Tuesday and we’ll get it back to you.  


The short answer is that it is a nice device and definitely something that fills a gap in our arsenal.  When we discuss next purchases, it will definitely be under consideration.


 


Thanks!


J. Gordon Beattie, Jr.,  W2TTT


Principal Systems Engineer


AT&T Domain 2.0 Platform & Systems Development


Office & Mobile: 201.314.6964


 


Business Email:  w2ttt at att.com


Personal Email:   w2ttt at att.net 


                                 w2ttt at arrl.net


Text:               2013146964 at txt.att.net


 


Making things Effortless through Innovation!


 


“Don’t undertake a project unless it is manifestly important and nearly impossible” – Edwin Land


 


From: Chris_Armstrong at rigol.com <Chris_Armstrong at rigol.com> 


Sent: Wednesday, September 12, 2018 2:04 PM


To: BEATTIE JR., GORDON <jb1589 at att.com>


Cc: James Gordon Beattie Jr <w2ttt at att.net>; RIOS, ROQUE <rr986c at att.com>


Subject: RE: RIGOL RSA code


 


Hi,


 


Have you found some time to test the instrument remotely? 


 


Any questions or issues? 




I want to make sure you have the code you need to get through your tests.


 


Hopefully, you can get all the info you need before we need the instrument back. 


 


Please let me know how things are going. Thanks!


 


Regards,


 


Chris


 


Chris Armstrong


Director of Product Marketing & SW Applications


Rigol Technologies


8140 SW Nimbus Ave


Beaverton, OR 97008


office/fax: 877-4-RIGOL-1 x110


mobile: 440-781-4982


email: chris_armstrong at rigol.com






-----Chris_Armstrong/Rigol wrote: -----


To: "BEATTIE JR., GORDON" <jb1589 at att.com>


From: Chris_Armstrong/Rigol


Date: 09/04/2018 04:13PM


Cc: "James Gordon Beattie Jr" <w2ttt at att.net>, "RIOS, ROQUE" <rr986c at att.com>


Subject: RE: RIGOL RSA code


Hello,


 


Hope your Labor Day weekend was good and that you are getting into your week. 


 


I wanted to send one more update version.


 


I have added the spectrogram to the RSA_live_combo_view.


 


I also changed the colormapping technique a little. I am now linearizing the data before sending it to the chart to get more color definition.


 


If you run into any challenges don't hesitate to call. Thanks!


 


Regards,


 


Chris


 


Chris Armstrong


Director of Product Marketing & SW Applications


Rigol Technologies


8140 SW Nimbus Ave


Beaverton, OR 97008


office/fax: 877-4-RIGOL-1 x110


mobile: 440-781-4982


email: chris_armstrong at rigol.com






-----"BEATTIE JR., GORDON" <jb1589 at att.com> wrote: -----


To: "Chris_Armstrong at rigol.com" <Chris_Armstrong at rigol.com>, "James Gordon Beattie Jr" <w2ttt at att.net>


From: "BEATTIE JR., GORDON" <jb1589 at att.com>


Date: 08/30/2018 07:14PM


Cc: "RIOS, ROQUE" <rr986c at att.com>


Subject: RE: RIGOL RSA code


Chris,


Thanks for the email of the .py scripts.  We will need to try it out.


As for this week, things got a little crazy with personnel changes, but things are settling down.


On Friday, I am going to remote the device on my home LAN, then on to a series of cellular wireless routers as that will be a likely mode of field deployment.


One day next week, I am hoping to get to Middletown when Roque has some time and do some software control exercises with him, as his insights will be a good complement to mine.  Your code will be a great help with that as well.


 


Have a lovely weekend!


 


Thanks!


J. Gordon Beattie, Jr.,  W2TTT


Principal Systems Engineer


AT&T Domain 2.0 Platform & Systems Development


Office & Mobile: 201.314.6964


 


Business Email:  w2ttt at att.com


Personal Email:   w2ttt at att.net 


                                 w2ttt at arrl.net


Text:               2013146964 at txt.att.net


 


Making things Effortless through Innovation!


 


“Don’t undertake a project unless it is manifestly important and nearly impossible” – Edwin Land


 


From: Chris_Armstrong at rigol.com <Chris_Armstrong at rigol.com> 


Sent: Thursday, August 30, 2018 7:35 PM


To: James Gordon Beattie Jr <w2ttt at att.net>


Cc: RIOS, ROQUE <rr986c at att.com>; BEATTIE JR., GORDON <jb1589 at att.com>


Subject: Re: RIGOL RSA code


 


Hello,


 


one more update I finished today.


 


Save .py file, but I have added a function:


 


box.RSA_live_combo_view(10)


 


this function opens an interactive plot that shows the PvT & Spectrum view in Real time mode and updates N times before stopping. Useful for visualization I think.


 


I also commented out all the demonstration code at the bottom. All this version does when you run it is that it tries to connect at the IP address listed.


 


Regards,


 


Chris


 


Chris Armstrong


Director of Product Marketing & SW Applications


Rigol Technologies


8140 SW Nimbus Ave


Beaverton, OR 97008


office/fax: 877-4-RIGOL-1 x110


mobile: 440-781-4982


email: chris_armstrong at rigol.com






-----Chris_Armstrong/Rigol wrote: -----


To: James Gordon Beattie Jr <w2ttt at att.net>


From: Chris_Armstrong/Rigol


Date: 08/30/2018 02:14PM


Cc: rr986c at att.com, BEATTIE GORDON <jb1589 at att.com>


Subject: Re: RIGOL RSA code


Gordon & Roque,


 


Hope you guys are doing well. I will try to give you a call tomorrow and see how the RSA is working for you.


 


But I have been working on a little code here and wanted to pass it along.


 


The attached python code uses pyVisa to collect data over a network connection. There are some unneeded functions in here because I built it on my instrument class, but the functions you actually need are pretty straightforward. After creating all the functions the code just does this:


 


#How to get started with the instrument.


        


    # Put your instrument's IP address in place of 192.168.203.144 below


box = PyRigol(PYVISA_TCPIP,"192.168.203.144",debug=0)


 


 


##Demonstration of Spectrogram Capture


box.capture_spectrogram_data(200)


ready = 'running'


while ready == 'running':


    time.sleep(1)


    ready = box.check_status()


box.get_spectrogram_plot(200)


 


##Demonstration of Display Capture


box.get_display_image().show()


 


 


That basically tells it to capture 200 traces in the spectrogram, then waits for it to complete, them pulls it over the network to the PC. 


 


The data is then plotted which looks like the attached PNG.


 


Once you close the figure then a bmp is also pulled from the instrument. Also attached.


 


The whole process takes a couple of minutes depending on how many traces are collected.


 


Hopefully this is useful for your deep data analysis and remote control needs. 


 


Let me know if you have any questions about this and I hope to talk with you guys soon.


 


 


 


Regards,


 


Chris


 


Chris Armstrong


Director of Product Marketing & SW Applications


Rigol Technologies


8140 SW Nimbus Ave


Beaverton, OR 97008


office/fax: 877-4-RIGOL-1 x110


mobile: 440-781-4982


email: chris_armstrong at rigol.com






-----James Gordon Beattie Jr <w2ttt at att.net> wrote: -----


To: rr986c at att.com, chris_armstrong at rigol.com, BEATTIE GORDON <jb1589 at att.com>


From: James Gordon Beattie Jr <w2ttt at att.net>


Date: 08/23/2018 06:23PM


Subject: Re: RIGOL RSA code


Correction... Roque's correct email!  Sometimes the spell checker gets stupid!


Thanks!


Gordon Beattie W2TTT 


201.314.6964


Get Outlook for Android


 


From: James Gordon Beattie Jr


Sent: Thursday, August 23, 21:18


Subject: Re: RIGOL RSA code


To: rr986c at att.com, chris_armstrong at rigol.com, BEATTIE GORDON


Chris,


Thanks!  You have Toques correct email.


Please add my business email, jb1589 at att.com. 


Using this one is fine as a CC.


Thanks again!


Gordon Beattie W2TTT 


201.314.6964


Get Outlook for Android




From: chris_armstrong at rigol.com


Sent: Thursday, August 23, 19:47


Subject: RIGOL RSA code


To: w2ttt at att.net, rr986c at att.com


Rocky & Gordon,


hopefully this email gets to Rocky. If not, Gordon could you forward it?


Let me know if you have any questions about the attached code. Once you set up the instrument and give it an IP (probably thru DHCP) it should be easy to talk to if you are on the same network.


You can always try to open the IP address in a browser. Something will come up if you are addressing the instrument correctly.


I am attaching a small python script that will enable you to capture some remote data from the instrument in a couple of different ways programmatically including:


1: get trace data and add it to a plot


2: show the plot


3: extract the data array


4: get the screen image


To use this as is you will need:


1: Python 2.7


2: PyVisa


3: Matplotlib


4: numpy


5: PIL (python image library)


6: NI VISA full version. such as: http://www.ni.com/download/ni-visa-17.5/7220/en/


The NI VISA version depends on your OS, but in general it should be easy to make work on Windows.


There are ways to do these same things without VISA, but that would take a little work to reformat the function calls to use the sockets. Let me know if you need to do that or if you can get the NI VISA and PyVisa working.


I'm confident you can at least look through this and see what I am doing. Here are the key parts relevant to the RSA5, most of the rest is general config code:


  def get_display_image(self):


        #use box.get_display_image().show() to show returned image where box = PyRigol(#)


        if len(self.displayImageStr) == 0:


            print 'no method to get display'


            im2 = None


        else:


            try:


                self.instr.write(self.displayImageStr)


                buff = self.instr.read_raw()


                buff2 = buff[self.imageheader:]


                im2 = Image.open(StringIO.StringIO(buff2))


            except:


                print 'Unable to get display data'


                im2 = None


        #tk_img = ImageTk.PhotoImage(im2)


        #skipping conversion and returning array for now


        return im2


    def get_spectrum_plot(self,color='r'):


        #return matplotlib plot of display data. chan 0 represents the active channel. -1 indicates all active channels


        #self.dataplot = ()


        if self.debug ==1: print 'get display data'


        #chanlabel = str(chan)


        chancolor = color


        # set up for RSA in RT mode. 801 points.


        self.write("FORM:TRAC:DATA ASCII")


        datalist = self.ask("TRAC:DATA? TRACE1").split(",")


        #freq steps


        freq_start = float(self.ask("FREQ:START?"))


        freq_stop = float(self.ask("FREQ:STOP?"))


        freqlist = np.linspace(freq_start,freq_stop,801)


        self.dataplot = plt.plot(freqlist,datalist,chancolor)


        #plt.legend()


        return plt


#How to get started with the instrument.


    # Put your instrument's IP address in place of 192.168.203.118 below


box = PyRigol(PYVISA_TCPIP,"192.168.203.118")


import matplotlib.pyplot as plt


import numpy as np


#clear the dataplot


dataplot = ()


#each call adds another plot to the chart in a color by passed value


chart = box.get_spectrum_plot('b')


chart = box.get_spectrum_plot('r')


chart = box.get_spectrum_plot('c')


#when you have all the plots you want you can show the chart with this


chart.show()


#pull the actual data array from the last plot call


trace_data = box.dataplot[0].get_data()


#grabs the screen image. saves to file structure and shows it in image viewer. It takes a few seconds for this to operate.


box.get_display_image().show()


Regards,


Chris


Chris Armstrong


Director of Product Marketing & SW Applications


Rigol Technologies


8140 SW Nimbus Ave


Beaverton, OR 97008


office/fax: 877-4-RIGOL-1 x110


mobile: 440-781-4982


email: chris_armstrong at rigol.com














[attachment "spectrogram_data.PNG" removed by Chris_Armstrong/Rigol]


[attachment "spectrogram_display.PNG" removed by Chris_Armstrong/Rigol]


[attachment "pyRIGOLv5rsaIntro.py" removed by Chris_Armstrong/Rigol]






[attachment "pyRIGOLv5rsaIntro.py" removed by Chris_Armstrong/Rigol]








More information about the Troop139 mailing list