Author Topic: AFG3000 series AWG: How to create an Arbitrary Waveform file?  (Read 4382 times)

0 Members and 1 Guest are viewing this topic.

Offline smoothVTerTopic starter

  • Regular Contributor
  • *
  • Posts: 145
  • Country: us
AFG3000 series AWG: How to create an Arbitrary Waveform file?
« on: August 24, 2019, 02:34:42 pm »
I've read through the user guide / quick start guide to the AFG3022 about the arbitrary waveform function and that it has the capability to accept files on a USB stick and then output the content of those files through either/both of its outputs.  Well, I can't seem to find information about how this file is generated, what is its format,  etc.

For my application, I need to generate a TTL level digital signal, though the usage is only to read rising/falling edges and time the space between them;  something like 10us minimum pulse widths, either high or low.  I **think** this is possible to do with the AFG3000 series, but correct me if I'm wrong.

Anybody out there have experience with the arb functionality of this series of AFG's?   How do you go about generating your arb waveforms?  Is there a reference out there for the file format, its headers, anything else?


 
 

Offline voltsandjolts

  • Supporter
  • ****
  • Posts: 2299
  • Country: gb
Re: AFG3000 series AWG: How to create an Arbitrary Waveform file?
« Reply #1 on: August 24, 2019, 09:39:11 pm »
IIRC loading waveforms onto the Tektronix AFG3000 Arbitrary Signal Generator is somewhat awkward.

Despite having a USB host port on the front panel, which could easily be used to load waveforms in CSV format (like the Agilent equivalents) Tektronix decided to support only proprietary waveform formats which are generated by extra cost software.

Waveforms can be loaded over the Ethernet or USB Slave ports but on Windows computers this requires TekVISA or NIVISA drivers and additional software. The simplest solution for me was to use a Linux distribution which includes the USBTMC (USB Test and Measurement Class) kernel driver – included in most modern distributions. I wrote the attached python script to send waveform data to the AFG.

To use this script:

Copy this script to a Linux system.
Connect the AFG3000 via USB cable (use rear Slave Port on AFG3000)
The USBTMC driver should load and a new device should appear in the filesystem at /dev/usbtmc0
Make this device accessible to your user eg. sudo chown username /dev/usbtmc0
Copy the waveform data to same directory as afgsend.py
Run afgsend.py with the command: python afgsend.py –i dacdata.txt


I wrote that a few years back on python 2.7 (?).
It should be simple enough to modify to use the pyvisapy library for ethernet comms and that should be cross-platfrom.
« Last Edit: August 24, 2019, 09:44:22 pm by voltsandjolts »
 
The following users thanked this post: smoothVTer

Offline smoothVTerTopic starter

  • Regular Contributor
  • *
  • Posts: 145
  • Country: us
Re: AFG3000 series AWG: How to create an Arbitrary Waveform file?
« Reply #2 on: August 25, 2019, 03:20:08 pm »
Thanks for your reply.  The AFG3000 isn't rented yet by me, and with your input for this kind of setup, I'm thinking of looking at other options.  So ...

In your experience, have you used any AWG's or AFG's which take .CSV and are easily read/recognized?   I have a budget to spend on a new AWG/AFG.

I currently own a half-broken ( 1 channel is fried ) Rigol DG1032Z, and it reads .RAF waveforms just fine, but tends to crap out when reading .CSV's.   Still unsure why.  Need to use .CSV's as the waveform files because they are generated through python scripts very easily as opposed to Rigol's clunky graphical solution.   

 

Offline Omicron

  • Regular Contributor
  • *
  • Posts: 142
  • Country: be
Re: AFG3000 series AWG: How to create an Arbitrary Waveform file?
« Reply #3 on: August 25, 2019, 03:30:53 pm »
Just download the Tektronix ArbExpress software:

https://www.tek.com/product-software-series/arbexpress-signal-generator-software

It connects directly to the instrument via USB or network, no need to mess with USB sticks.
 

Offline voltsandjolts

  • Supporter
  • ****
  • Posts: 2299
  • Country: gb
Re: AFG3000 series AWG: How to create an Arbitrary Waveform file?
« Reply #4 on: August 25, 2019, 04:04:29 pm »
Thanks Omicron for pointing out that ArbExpress is now a free download. I'm almost certain it was a cost item circa 5 years ago.

Personally, I use a Siglent 2042X 16-bit arb gen now and I am very happy with it.
It can directly import text/csv files from USB stick.
I wrote an Octave script for generating waveforms with the right file format, easy to translate to python or whatever, see here:
https://www.eevblog.com/forum/testgear/siglent-sdg1000-arbitrary-csv-file-format/msg1973726/#msg1973726

If you need logic pulses, a digital pattern generator might be more appropriate.
 
The following users thanked this post: smoothVTer

Offline norsci

  • Newbie
  • Posts: 2
  • Country: au
    • Norris Scientific
Re: AFG3000 series AWG: How to create an Arbitrary Waveform file?
« Reply #5 on: March 07, 2022, 05:51:40 am »
Hi, I know this is an old topic but I wanted to post in case it helps others looking for an answer. I have a Rigol MSO5074 oscilloscope and a Rigol DG1022Z function generator. I use ARB files regularly and have found them relatively easy to work with, once you know the file format.

If you have the oscilloscope to hand, the easiest way to get an example file is to set up the GENI or GENII output, choose ARB as the function type, then load the waveform from one of the channels (note, the channel does not need to actually hold a useful signal) and save the waveform to an ARB file. If you save the file to a USB stick then you can transfer it to a PC and inspect the file format.

The ARB file is a text file format, CSV delimited, and the header contains the following fixed content:

Code: [Select]
X-axis,WaveGen-ARB
second,volt

The following rows contain the time in seconds, plus the voltage. The file can be as long as required.

Now, there are some details/limitations that need to be acknowledged:

  • While the file defines the voltage, the actual output voltage values can be specified using controls on the device, e.g. the upper and lower voltage levels.
  • Likewise, while the file defines the time, the actual output time period can be specified using the control on the device, e.g. the frequency or the period of the output waveform.

I'll just finish with the first few dozen lines from a sample file that is confirmed as working on both of the devices mentioned above. Best of luck with it!

Code: [Select]
X-axis,WaveGen-ARB
second,volt
0,2.30473475
2.2125851845296E-05,2.30288575
4.42517036905921E-05,2.30214625
6.63775555358881E-05,2.30288575
8.85034073811842E-05,2.303995
0.00011062925922648,2.30288575
0.000132755111071776,2.303995
0.000154880962917072,2.303995
0.000177006814762368,2.3047345
0.000199132666607664,2.3043645
0.00022125851845296,2.30288575
0.000243384370298256,2.30510425
0.000265510222143552,2.30806225
0.000287636073988849,2.3062135
0.000309761925834145,2.30584375
0.000331887777679441,2.3032555
0.000354013629524737,2.3047345
0.000376139481370033,2.30732275
0.000398265333215329,2.309172
0.000420391185060625,2.30806275
0.000442517036905921,2.308802
0.000464642888751217,2.3099115
0.000486768740596513,2.30806225
0.000508894592441809,2.30695325
0.000531020444287105,2.3080625
0.000553146296132401,2.3047345
0.000575272147977697,2.3062135
0.000597397999822993,2.308432
0.000619523851668289,2.30510425
0.000641649703513585,2.3080625
0.000663775555358881,2.30510425
0.000685901407204177,2.30436475
0.000708027259049473,2.3047345
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf