AFG3000 series AWG:  How to create an Arbitrary Waveform file? - Page 1
Forum section: electronics / testgear

author: smoothVTer
author_rank: Regular Contributor
timestamp: August 24, 2019, 02:34:42 pm
content: 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?

author: voltsandjolts
author_rank: Unknown
timestamp: August 24, 2019, 09:39:11 pm
content: 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/usbtmc0Make this device accessible to your user eg. sudo chown username /dev/usbtmc0Copy the waveform data to same directory as afgsend.pyRun afgsend.py with the command: python afgsend.py –i dacdata.txtI 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.

author: smoothVTer
author_rank: Regular Contributor
timestamp: August 25, 2019, 03:20:08 pm
content: 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.

author: Omicron
author_rank: Regular Contributor
timestamp: August 25, 2019, 03:30:53 pm
content: Just download the Tektronix ArbExpress software:https://www.tek.com/product-software-series/arbexpress-signal-generator-softwareIt connects directly to the instrument via USB or network, no need to mess with USB sticks.

author: voltsandjolts
author_rank: Unknown
timestamp: August 25, 2019, 04:04:29 pm
content: 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/#msg1973726If you need logic pulses, a digital pattern generator might be more appropriate.

author: norsci
author_rank: Newbie
timestamp: March 07, 2022, 05:51:40 am
content: 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:X-axis,WaveGen-ARBsecond,voltThe 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:X-axis,WaveGen-ARBsecond,volt0,2.304734752.2125851845296E-05,2.302885754.42517036905921E-05,2.302146256.63775555358881E-05,2.302885758.85034073811842E-05,2.3039950.00011062925922648,2.302885750.000132755111071776,2.3039950.000154880962917072,2.3039950.000177006814762368,2.30473450.000199132666607664,2.30436450.00022125851845296,2.302885750.000243384370298256,2.305104250.000265510222143552,2.308062250.000287636073988849,2.30621350.000309761925834145,2.305843750.000331887777679441,2.30325550.000354013629524737,2.30473450.000376139481370033,2.307322750.000398265333215329,2.3091720.000420391185060625,2.308062750.000442517036905921,2.3088020.000464642888751217,2.30991150.000486768740596513,2.308062250.000508894592441809,2.306953250.000531020444287105,2.30806250.000553146296132401,2.30473450.000575272147977697,2.30621350.000597397999822993,2.3084320.000619523851668289,2.305104250.000641649703513585,2.30806250.000663775555358881,2.305104250.000685901407204177,2.304364750.000708027259049473,2.3047345