PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

5404 start phase unstable

Solved!
Go to solution

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 

 

 

 

 

 

 

 

 

 

 

 

 

 

0 Kudos
Message 1 of 4
(4,262 Views)

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 

National Instruments
Precision DC Hardware Engineer
0 Kudos
Message 2 of 4
(4,257 Views)

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

 

 

0 Kudos
Message 3 of 4
(4,254 Views)
Solution
Accepted by topic author Binar

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

0 Kudos
Message 4 of 4
(4,242 Views)