Rigol DG1022 SigGen - programming help sought - Page 1
Forum section: electronics / general

author: LaurenceW
author_rank: Frequent Contributor
timestamp: January 15, 2012, 06:27:09 pm
content: Hello EEVBloggers.Well, I've finally got me a Rigol DG1022 AWG - sitting here on my desk. I will do a review of it later, but still finding may way around it - what's good, what's bad. I bought it from SMTZone on eBay - landed on my desk for about GBP £280 ( ~ USD $450 delivered in your fancy New World Currency). I see the price has gone up a little, since then.Ironically, the package seems to have handled the journey over to the UK from Hong Kong intact, right up to the point where it reached my house. I was out, so the DHL driverDROPPED IT OVER MY SIX FOOT FENCEand the rear plastic moulding took (but did not survive) the hit. The instrument electronics seem to have survived, however. Claim is in with DHL - we shall see what comes of that.So - to my question. One thing a little lacking is any documentation on HOW to connect the thing to a PC and program it. "Use a USB cable" is about the extent of the documented info I have so far found - !!I have downloaded the NIS instruments driver, but of course that is not the actual application. I can use that to communicate very crudely to the DG1022 (so the USB comms all work, confirms NI I/O Trace). But i have yet to find a way to send it anything useful. I have got the UltraWave application running, but that is pretty much on-par with a chocolate teapot.I'd like to be able to stream commands to the DG1022, (whicharedocumented) instead. I don't know, but LabView might be the answer, but it looks like overkill for my applications.Any ideas?Anybody managed to talk to their DG1022 from Windows?

author: Unknown
author_rank: Unknown
timestamp: January 15, 2012, 06:39:34 pm
content: Quote from: LaurenceW on January 15, 2012, 06:27:09 pmUnless you already own Labview, I would agree with you. I believe the license is quite expensive, more than the generator itself (not sure about the exact price, never paid for it with my own money). Any programming language with VISA bindings should be fine for this application. VISA should enable you to send commands to the instruments and receive responses. You can probably find NI VISA demo programs in C or C++.Quote from: LaurenceW on January 15, 2012, 06:27:09 pmNo experience, the lousy software, support and documentation was the main reason why I didn't buy this function generator.

author: PeterG
author_rank: Frequent Contributor
timestamp: January 15, 2012, 10:31:49 pm
content: There is a Programming Guide available from the Rigol website. I have played with the interface on my DG1022, i found you cant do much more than the UltraWave software allows. It is fairly easy to program using VB/VC or whatever lingo you wish to use.Regards

author: LaurenceW
author_rank: Frequent Contributor
timestamp: January 15, 2012, 11:29:09 pm
content: Yes, Pete, that guide I have - with it's unhelpful "connect the DG1022 to the PC with a USB cable" comment - but then what?How do I actually GET these commands so thoughtfully documented by Rigol, to the instrument?I was hoping to stream them for a text or batch file down the USB, as if it were a serial port. Maybe this isn't going to be that simple...

author: PeterG
author_rank: Frequent Contributor
timestamp: January 15, 2012, 11:57:44 pm
content: To be honest, it was months ago when i played with it.From memory, either the DG1022 or the Ds1102 programming guide had vb examples at the end of the document.It wont work with a simple script like a batch file. Would be nice if it could tho. You need to set up the connection and then send the commands in the correct format etc.Mechatrommer is the person who has the most experience with programming for Rigol products.Regards

author: Mechatrommer
author_rank: Super Contributor
timestamp: January 16, 2012, 03:44:53 pm
content: Quotenot really. i only have "slight" experience with DS1052E, not entire rigol. i dont own DS1022. i wish the OP luck in finding the solution. could give me some idea later on.

author: LaurenceW
author_rank: Frequent Contributor
timestamp: January 16, 2012, 06:06:50 pm
content: OK, thanks, guys.No VB scripts in the documents I have, alas. Just what looks like good ole' fashined text. An example from Rigol's own docs:Example 1: To Generate a Sine WaveTarget: Generate a sine wave with 20 kHz frequency, 2.5 Vpp amplitude, 500mVDC offset and 10°phase via CH1. How to realize via commands? Method1:0 *IDN? /* Query ID to check the operating state */1 VOLT:UNIT VPP /* Set the unit of amplitude */2 APPL:SIN 20000,2.5,0.5 /*Set the frequency, amplitude and offset of the sine wave*/3 PHAS 10 /* Set the initial phase */4 OUTP ON /*Enable the  connector of CH1 at front panel */Which is what Iwantto send, but how? Anybody else had any experience get the commands already published in the Rigol document"DG1022 Programming Guide_EN"actuallyTOthe instrument? That's the nub of my problem!I guess what I am trying to establish is a simple HyperTerminal link to the DG1022, But from Windows 7 and over USB. Hardly Rocket Salad, surely?So I think i could rephrase my question thus:How Do I establish a simple command line prompt to my DG1022 via Windows 7?

author: Chet T16
author_rank: Frequent Contributor
timestamp: January 16, 2012, 06:39:37 pm
content: I would guess the same way as the DS1052 scope? Can't remember how we do that but it's in the 100mhz hack thread!Is there a complete list of commands? Anything exciting? ie something not readily doable from the panel

author: Unknown
author_rank: Unknown
timestamp: January 16, 2012, 06:54:03 pm
content: Quote from: LaurenceW on January 16, 2012, 06:06:50 pmUse NI-VISA. Something likethis tutorialfor C# and VB.NET. I believe there are some included samples for C and VB6 in the NI VISA distribution.Quote from: LaurenceW on January 16, 2012, 06:06:50 pmTry the NI Measurement & Automation explorer.

author: Mechatrommer
author_rank: Super Contributor
timestamp: January 16, 2012, 06:57:16 pm
content: from the list, i suspect its similar, ie call to ni-visa api from application. what your ide environment? cant help with matlab/labview. i can send the vb and vc++ example (from ds1052e iirc) if you have the ide.

author: DavidDLC
author_rank: Frequent Contributor
timestamp: January 16, 2012, 08:36:32 pm
content: You need to check the real address with a program that scans the connections automatically.I did a small interface to it, I was using the address from the instrument menu and I was never able to communicate with it, then I used the MAX application from National Instruments and was able to get the real addressI contacted Rigol to communicate this issue, but never got a good response back.BTW I used the VISA API and C# for my programming.David.