LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NIRFSG_ATTR_FGEN_SESSION attribute

Solved!
Go to solution

Hello:

 

Does anyone know the help for this attribute of NI-RFSG driver - NIRFSG_ATTR_FGEN_SESSION. It gets the session for the 5450 AWG that is part of a 5673 generator. 

I have some legacy code that uses this attribute and I know that it works. However, I can't find any explanation of this attribute.

 

Thank you,

-Ilya.

 

0 Kudos
Message 1 of 8
(3,998 Views)

Ilya,

 

I haven't been able to find that attribute anywhere in our help files either.  Where did you find the attribute?  Is it in a piece of code that you wrote, or is it inside of some file from NI?

 

Thanks,

 

Eric K

Applications Engineering

National Instruments

0 Kudos
Message 2 of 8
(3,972 Views)

Hi Eric:

 

It is piece of code that I inherited. I have no idea where exactly it came from. Most probably from some example or NI people directly. But it works fine.

 

 

// NI-Tclk technology is needed to syncronize the arb sample clocks. In order to use NI-Tclk, we need
// to extract the NI-FGEN handle (for the PXIe-5450 arb) being used internally by the NI-RFSG driver.
// NI-Tclk wants all NI-FGEN handles (for all the PXIe-5450 arbs) in the form of an array.
for(i=0; i<numberOfResources; i++) {
err = niRFSG_GetAttributeViSession (vi[i], VI_NULL, NIRFSG_ATTR_FGEN_SESSION, &FGENHandles[i]);
if(err) {
rfsg_create_error_message(vi[i]);
}
}

// NI-Tclk function calls for syncronizing sample clocks and initiating phase coherent signal generation.
err = niTClk_ConfigureForHomogeneousTriggers(numberOfResources, FGENHandles);
if(err < 0) {
niTClk_GetExtendedErrorInfo (errMessage, MAX_ERROR_MESSAGE_LENGTH); 
return err;
}
err = niTClk_Synchronize(numberOfResources, FGENHandles, 0);
if(err < 0) {
niTClk_GetExtendedErrorInfo (errMessage, MAX_ERROR_MESSAGE_LENGTH); 
return err;
}

 

 

Regards,

-Ilya.

 

PS: Sorry, I posted this question to LabVIEW because I didn't know where else it applies. But I do use LabVIEW and C++ interchangeably.

0 Kudos
Message 3 of 8
(3,968 Views)

Hello Ilya,

 

The function described above is used to hold the FGEN session which is used by TCLK to synchronize multiple RFSG devices.  In the help, you can find documentation for the LabVIEW VI by searching for "niRFSG Get Session Reference VI".  This vi performs the same functionality as the niRFSG_GetAttributeViSession does.  The NIFSG_ATTR_FGEN_SESSION, is used to state that you want to return the FGEN session as done in the vi. I'm afraid I don't see any specific documentation on the C function call in the help, but the above information on the labVIEW vi should help explain what the function is doing. 

 

Please let me know if you have any other questions about it.

 

Regards,

Paul C.

0 Kudos
Message 4 of 8
(3,934 Views)

Hi Paul:

 

Well, I suppose this explanation will fly, for a time being.

However, I hope that NI will update the list of properties in NI-RFSG help. NIFSG_ATTR_FGEN_SESSION is a valid attribute and thus should be listed with all the other attributes.

 

If I get the FGEN session, can I use it to fully control and query the associated FGEN using the NI-FGEN driver? I sometimes see the RED LED on FGEN, which indicates some sort of an error condition. However, the NI-RFGEN says there is no error.

 

Thank you,

-Ilya. 

0 Kudos
Message 5 of 8
(3,926 Views)

Hello Ilya,

 

It appears that we have changed things in the latest RFSG version (Version 1.6).  According to R&D and the shipping examples, you only need to provide the TCLK function calls with the RFSG session handle in the current version.  Before, you would use the posted function to grab the FGEN session for TClk.  Now, you simply provide the TClk function calls with the RFSG session.


The documenation for our NI-TClk function calls can be found in the NI RF Signal Generators Help under Programming » NI-TClk Synchronization Help » Programming » NI-TClk C Reference.  I would also highly recommend taking a look at our C shipping examples.  I've gone ahead and attached the C code associated with our CVI sychronization example.  Line 214 shows the TClk configure function and how it uses the numResources variable that is filled with RFSG session handles.

 

As for your question, we do not recommend using the NI-FGEN session to set NI-FGEN attributes directly.  All relavant control over your arbitrary waveform generator should be available within the RFSG driver.   Please let us know if you find functionality missing. 

 

As for the error, please check and see if the RFSG session has reported any errors after making the above changes.  If you are using the latest driver and following the above programming guide, it should give you the appropriate error that is causing the red LED on the arb.

 

Regards,
Paul C.

0 Kudos
Message 6 of 8
(3,919 Views)
Solution
Accepted by topic author ilyak

Hello Ilya,

 

I also want to add that the current way your program works (the legacy version) will still work, but we no longer recommend doing it this way.  The recommended way would be to use the RFSG sessions with the TClk functions.  We expect this way to be more stable and to be less of a support issue across future updates.


Regards,

Paul C.

0 Kudos
Message 7 of 8
(3,907 Views)

Thanks, Paul.

 

-Ilya.

0 Kudos
Message 8 of 8
(3,900 Views)