Signal Generators

cancel
Showing results for 
Search instead for 
Did you mean: 

Change Arb gain on a trigger

Hi,
 
I want to play out a short sine signal then wait on a trigger on PFI 0. When the trigger is received I want to adjust the Arb gain and play out the sine signal again. I want to do this many times until I reach the lowest output of the Arb. I cannot do this by defining a signal for each output level (too many signals and I lose resolution as I get to the smaller signals). Anyone got any ideas?
 
Thanx,
 
Nick
0 Kudos
Message 1 of 5
(7,409 Views)

Hi Nick,

Unfortunately, the arb cannot change the analog gain directly in response to a trigger.  You can do it in software if you have an SMC-based arb (5412, 5421, 5422, 5441) and can live with the software latency.  With NI-FGEN 2.4 or later, you can do it by outputting a marker when you receive the trigger.  You can then poll the marker status in software using the NI-FGEN Marker Event Latched Status property, and set the analog gain accordingly.  To output the marker, you will need to be in script or sequence mode, and begin generating the same waveform once the trigger is received.  See either the NI-FGEN script example or marker example for how to output a marker.  Hope this helps.

Evan Cone
National Instruments
RF R&D
0 Kudos
Message 2 of 5
(7,388 Views)

Edit to my previous reply: You will need script mode to do this, since you only want the marker to be output the first time you play the waveform after the trigger is received.  So, you will need an arb that supports script mode (5421, 5422, 5441).  The script would look something like this:

repeat forever

    repeat until scripttrigger0

        generate wfm1

    end repeat

    generate wfm1 marker0 (0)

end repeat

 

Evan Cone
National Instruments
RF R&D
0 Kudos
Message 3 of 5
(7,377 Views)

Hi Evan,

Thanks for the replies. I am using the Arb in Sequence mode but only have one waveform defined in the sequence. I have been trying to use the marker event so it is good to know that I am on the right track in my thinking. I need to change the gain many times on this waveform so I need to generate the marker each time the signal is generated. With this in mind I think that your first response is the one I need to follow. I was trying to use the live status but saw no changes ever, I have now tried to use the latched status as you suggested but I still see no changes to the value. I have checked to see if the marker is being generated and it is so I'm a bit puzzled here, could you give me a bit more guidance. I'm using NI-FGEN 2.4.

Thanx,

Nick

0 Kudos
Message 4 of 5
(7,362 Views)

Hi Evan,

Perseverance pays off I got there in the end, thanks for the pointer.

Nick

0 Kudos
Message 5 of 5
(7,360 Views)