LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Programming PXIe-6682H in CVI in order to generate a PPS

HI everyone,

I' m working on a project that requests to program a PXI 6682H board in order to generate a PPS.

I started from an exmple provided by labview named "generate PPS and wait.vi" and I tried to implement the sequence of functions using the LabWindows/CVI functions.

That's the code I have written on CVI:

 

GetCtrlVal (timesynchtab, TimeSynch_Res_Timing_Synchro, TimSynch_ResName_6682H);                                 
niSync_init (TimSynch_ResName_6682H, VI_FALSE, VI_FALSE, &TimeSynchro_6682H);                 
niSync_GetTime (TimeSynchro_6682H, &secondi, &nanoSecondi, &fractionalNanos);
niSync_CreateClock (TimeSynchro_6682H, NISYNC_VAL_PFI1, 1, 1, secondi, nanoSecondi, fractionalNanos, 0, 0, 0);
 
I expect a PPS coming out of PFI_1 but nothing happens,probably I've forgotten something but I don't know what it is.
Can anyone give me any suggestions on how to address this issue?
0 Kudos
Message 1 of 3
(218 Views)

It's always a good idea to add error checking to function calls: return code can offer useful informations to detect problems in the code or the system.

What I can tell is that there seems to be an error in the first line: TimSynch_ResName_6682H must be passed as a pointer in order to retrieve a value to use in subsequent code. On the other hand, if this variable is defined as a pointer then the following function calls must be tailored accordingly.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 3
(192 Views)

Dear Roberto,

 

Many thanks for your quick and helpful response.

There was no problem in the first line since I was already passing a pointer, which I didn' t include in the first message in order to keep it cleaner, but your suggestion about adding an error check really helped me finding the problem in the function CreateClock(), and I solved it by simply changing the following parameters :

- high and low ticks;

- start time seconds,nanoseconds,fractionalNanos;

obtaining this -> niSync_CreateClock (TimeSynchro_6682H, NISYNC_VAL_PFI1, 100, 100, 0, 0, 0, 0, 0, 0);

I really appreciated your help, best regards.

0 Kudos
Message 3 of 3
(180 Views)