04-13-2009 12:10 PM
I'm working with an NI Arbitrary Waveform Generator PXI-5421 and Digitizer PXI-5211.
Using CVI, I'd like to output a waveform with the AWG 500ms after the digitizer is triggered.
Is this possible?
To attempt to setup the triggers, I've used the following two functions:
However, I've been unsuccessful in getting the ARB to output anything once the scope is triggered.
Am I missing any crucial steps or is this something that can't be done in the manner in which I am attempting?
Thanks for your help. 🙂
Solved! Go to Solution.
04-14-2009 11:54 AM
Hello,
I believe that the niScope_ConfigureTriggerOutput() function is obsolete and likely does not work on your digitizer. Also, what digitizer is it that you have? Did you mean a PXI-5112? Instead of using that function to output your start trigger event, I would use the niScope_ExportSignal() function. This function essentially works the same way but you can generate signals based from more types of triggers.
Chris W
04-14-2009 11:59 AM
Hi Chris,
Thanks for the reply.
I had a dyslexic moment -- my digitizer is actually the PXI-5122 🙂
I will give the niScope_ExportSignal() function a try.
Thanks again!
04-14-2009 03:50 PM
Hmmm, still no luck. Maybe I'm screwing up something with the setup?
I've tried to link them on several different lines (RTSI's, PFI's, PXI Star) with no results.
I've attached a small program I created to try and get this working.
04-15-2009 03:24 PM - edited 04-15-2009 03:25 PM
Hello,
I think I see the problem. What it appears is that you're configuring your digitizer and fgen properly if they were going to be run separately, except for one thing. In this section:
//// Config Digitizer ////
....
// Configure output trig for Digitizer to trigger AWG
error |= niScope_ExportSignal (ScopeHandle, NISCOPE_VAL_START_TRIGGER, "", NISCOPE_VAL_RTSI_0);
you export the start trigger, which is actually sent immediately once you call the niScope_InitiateAcquisition() function. All of this is done before you configure your AWG, so the start trigger is already being sent before you call the niScope_InitiateGeneration() for the AWG. Also, I'm assuming that you actually want to trigger off of the reference trigger that you are configuring with your call of the niScope_ConfigureTriggerEdge() function. I have attached an image of the help file for that function.
There are two things you need to do to fix this.
1. You need to change this line: // Configure output trig for Digitizer to trigger AWG
error |= niScope_ExportSignal (ScopeHandle, NISCOPE_VAL_START_TRIGGER, "", NISCOPE_VAL_RTSI_0);
to export the reference trigger instead: // Configure output trig for Digitizer to trigger AWG
error |= niScope_ExportSignal (ScopeHandle, NISCOPE_VAL_REF_TRIGGER, "", NISCOPE_VAL_RTSI_0);
2. Also, you should move the niScope_InitiateAcquisition() function to be called after the niFgen_InitiateGeneration() function:
"....
// Enable AWG output
error |= niFgen_ConfigureOutputEnabled (AWGHandle, "0", VI_TRUE);
// Arm output
error |= niFgen_InitiateGeneration (AWGHandle);
// Begin digitizer acquisition
error |= niScope_InitiateAcquisition (ScopeHandle); "
I think that should take care of it.
Chris W
04-15-2009 04:16 PM
Chris,
That worked like a charm.
Thanks!