Posted Tue, 21 Mar 2023 20:06:02 GMT by Eglowstein, Howard
First, thank you all for the help on the waveform download question some weeks back.&#160; With your help we did get code in place to break large waveforms into pieces, sequence them (after buying licenses for the truckload of new AFGs we bought) and we can see they download properly as long as the waveform pieces start and end with zeroes. It's still weird that the device is that finicky about the specifics of the data - and that it fails without returning errors, but we can live with that.<br> <br> So now, we have in our application a situation where we have a single waveform. It's basically binary, so it's composed of 0 and 8191 so that it's a waveform referenced to 0 and goes as high as V+.&#160; The code sends it just fine and we can see it sitting, ready to go. The code then sends the output enable command. The channel 1 and 2 buttons light up but there's no output. If I press the buttons to turn off the output and then again to turn it on, I get the output.&#160; The device doesn't report anything in status that it's waiting for anything.<br> <br> I also tried putting the double button push in code to Band-Aid over this. After the waveforms are downloaded and the output enabled, I added two more output commands - a disable and an enable spaced 1 second apart. The lights behave as you'd expect but there's no output. It seems like the physical button push is required to get the output.<br> <br> Any theories?&#160; Is this something that might be known and is waiting for a firmware fix?<br> <br> Thanks!<br> <br> Howard
Posted Wed, 22 Mar 2023 16:44:24 GMT by Teles, Afonso
Hi Howard,<br> <br> I was not able to replicate your issue, at least in Basic mode, the command <code>output1:state on</code> enables the channel 1 output, as expected.<br> <br> Perhaps some more context is needed on what you're doing before the enable commands?
Posted Wed, 22 Mar 2023 17:03:48 GMT by Eglowstein, Howard
Thanks for looking at this Afonso. Can I ask if the unit you have has the sequencing option? Tek's tech support asked me about the option (which we have) as they think that might have something to do with it. I'll have to get a capture of the whole sequence but essentially we download a waveform into EditMemory1, set up the arbitrary mode to use that, then send &quot;OUTP:STAT ON&quot; through the updated NI 31K driver. I can see it in the USB capture and it looks pretty much just like that. When the AFG receives the command the CH1 button lights. Nothing comes out but if I press the button to shut it off and then again to turn it back on, the button lights but there's output. So the current theory I'm exploring is that somehow there's a sequencer issue where it's waiting for something that it's not seeing. If I don't specify any sequence elements, I assume I don't need to do anything else to stay in basic mode? Am I missing something? Thanks! Howard
Posted Wed, 22 Mar 2023 19:32:32 GMT by Eglowstein, Howard
I've been emailing with Tektronix and they think it has to do with the sequencing module. A trigger or something, perhaps. I captured the traffic with the AFG and the NI driver sends dozens of commands to get the state of just about everything. Even when we don't specifically use the sequence features the driver does hit a few commands.&#160; I've attached the capture if that helps.<br> <br> Howard
Posted Thu, 23 Mar 2023 13:11:51 GMT by Eglowstein, Howard
Someone is going to find this thread eventually so i wanted to document the fix. Thanks Afonso and the other folks at Tektronix who took the time to look at this and come up with a solution!<br> <br> The issue appears to be the AFG getting confused between advanced and basic modes. We have an application that will sometimes need a waveform more than 128K points, so we wrote a bunch of code (see the other thread) to take the large files, break them up strategically into chunks, write those out and control the whole mess with the sequencer. It's sad that was necessary but that's another topic...<br> <br> The code we wrote was on top of the NI driver for the 31K. We spew out a bunch of viWrite() commands with SCPI stuff, then at the end we did the &quot;OUTP1:STAT ON&quot; followed by a &quot;SEQC:RUN:IMM&quot;. If there's no sequence involved we didn't think the SEQC command could hurt anything. Apparently that's not true. The AFG is weird and it reponds by lighting the buttons and doing nothing.<br> <br> After an incredibly cool conversation with Afonso and others at Tek, I moved things around rather than trying to have the code decide if there's an actual sequence. So if I send the &quot;SEQC:RUN:IMM&quot; first, followed by an &quot;OUTP1:STAT OFF&quot; and an &quot;OUTP1:STAT ON&quot; it works a treat! I'm stil testing and I need to verify all of my sequencing code but it looks like a fix.
Posted Thu, 23 Mar 2023 17:00:18 GMT by Teles, Afonso
<p>Hi Howard,</p> <p>Thank you for following up and posting your conclusions in the thread for others to enjoy.</p> <p></p> <p>To summarize what I see as the root cause of the issue:</p> <p>The AFG31k does not have a strict restriction between basic/AFG mode and advanced/sequence mode. This means sequence commands can be used even when the instrument is in basic mode and vice-versa. And these commands can have unforeseen consequences, in this case <code>SEQC:RUN:IMM</code>, which would be used to start outputting in sequence mode, actually leads to stopping the output in basic mode while keeping the output lights on.</p> <p></p> <p>Since the AFG31k doesn't separate strictly between basic and advanced mode, it is up to the remote control program to keep track of that state and to avoid using commands from the wrong mode, or else confusing behavior like this can arise.</p>

You must be signed in to post in this forum.