04-18-2011 03:41 PM
Hi NI guys,
We're using PXI 5404 and we found a problem with the start phase of the output signal. we're using C++ and the code is as following:
niFgen_ConfigureStandardWaveform (vi2, "0", NIFGEN_VAL_WFM_SINE, 1, 0, 10000000, 0);
niFgen_ConfigureReferenceClock(vi2, "RefIn", 10000000);
niFgen_InitiateGeneration(vi2);
niFgen_ConfigureOutputEnabled(vi2, "0", VI_TRUE);
Everytime we run our program, the start phase changed compared to reference signal. I'm thinking what happened with my code and come here to look for a solution. Thanks in advance.
Regards,
Bin
Solved! Go to Solution.
04-19-2011 03:04 PM
Hi Bin,
Are you using the niFgen_close function at the end of your code? Can you attach your full example code? Also, try running the 5404SineGeneration example and see if you notice the same behavior. You can find this example by going on your PC by going to Start --> All Programs --> National Instruments --> NI-FGEN --> Examples --> c. From this folder you will find the 5404SineGeneration example and you can run it and see if we get the same result.
Brandon G
04-20-2011 04:08 PM
Hello Brandon,
My code is like this below:
niFgen_init("Dev1", VI_TRUE, VI_TRUE, &vi2);
niFgen_ConfigureChannels(vi2, "0");
niFgen_ConfigureOutputMode(vi2, NIFGEN_VAL_OUTPUT_FUNC);
niFgen_ConfigureStandardWaveform (vi2, "0", NIFGEN_VAL_WFM_SINE, 1, 0, 10000000, 0);
niFgen_ConfigureReferenceClock(vi2, "RefIn", 10000000);
niFgen_InitiateGeneration(vi2);
//other non-relative code...
if(vi2!=0)
{
niFgen_AbortGeneration(vi2);
niFgen_close (vi2);
}
It is pretty like the example of reference clock. I do write my code with the reference of your example code. And I run the example "RefernceClock", it gives me an error of "Unsupported Value". The attachment picture will show the details. Thanks for your help in advance and I'm looking to hearing from you.
Sincerely,
Bin
04-21-2011 03:20 PM
Hi All,
I'm confused with the start phase and the phase shift to reference. Now I understand that to tune the phase shift to the reference, I should use "niFgen_AdjustSampleClockRelativeDelay". Thank you for your help to make me rethinking about this.
Bin