04-05-2023 02:09 PM
Hey, I can't seem to give waveforms their own individual attributes on an RFSG (PXI5670) unit.
For context lets say I am trying to run an RFSG unit (PXI-5670) in script mode and lets assume this is a very simple script it just runs 2 separate waveforms, so it would be something like :
script myScript
generate waveform1
generate waveform2
end script
Now these two waveforms each have different center frequencies (or output powers, or IQrates, etc., it doesn't really matter just that they have an attribute that differs between the two waveforms). Now from The documentation says this is possible by setting the channelName parameter of the niRFSG_GetAttrib... and then if you check the documentation for either nirfsg_setattributevireal64 or nirfsg_getattributevireal64 they both say to use the format "waveform::waveformname" for the channelName parameter when calling them to specify the waveform that this attribute will belong to, or the waveform whose property the function call will set.
The issue is I'm always getting the following error:
IVI: The channel or repeated capability name is not allowed.
Attribute: NIRFSG_ATTR_FREQUENCY, Channel: waveform::waveformname
I have tried to set this by calling these functions through CVI c program and also via ni's grpc-device server using python. Each time it's the same error. I couldn't find any CVI c examples that accomplish this however there is an example in the ni grpc device repo that does exaclty this however when I try to run it I just get errors.
I modified the NI CVI RFSG script example "FiniteGeneration-Re-Triggered" to try and set these attributes by adding a button ("test"") that would call this function:
void testFunction()
{
ViReal64 frequency;
ViInt32 numberOfSamples = 25;
ViInt32 waveformItr;
double* i_Data = VI_NULL;
double* q_Data = VI_NULL;
double* blank_Data = VI_NULL;
ViStatus error = VI_SUCCESS;
GetCtrlVal (gui, GUI_IN_RESOURCE_NAME, resourceName);
checkWarn(
niRFSG_init (resourceName, VI_TRUE, VI_FALSE, &vi));
checkAlloc (i_Data = malloc (numberOfSamples * sizeof(double)));
checkAlloc (q_Data = malloc (numberOfSamples * sizeof(double)));
checkAlloc (blank_Data = malloc (12 * sizeof(double)));
for (waveformItr = 0; waveformItr < numberOfSamples; waveformItr++)
{
i_Data[waveformItr] = 1.0;
q_Data[waveformItr] = 0.0;
}
for (waveformItr = 0; waveformItr < 12; waveformItr++)
{
blank_Data[waveformItr] = 0.0;
}
checkWarn(
niRFSG_WriteArbWaveform (vi, "triggeredWaveform", numberOfSamples,
i_Data, q_Data, VI_FALSE));
checkWarn(niRFSG_WriteArbWaveform (vi, "allZeroes", 12, blank_Data, blank_Data, VI_FALSE));
/*- Configure the frequency of each waveform -----------------------------*/
checkWarn(
niRFSG_SetAttributeViReal64 (vi, "waveform::triggeredWaveform", NIRFSG_ATTR_FREQUENCY, 2E9));
checkWarn(
niRFSG_SetAttributeViReal64 (vi, "waveform::allZeroes", NIRFSG_ATTR_FREQUENCY, 1.5E9));
Error:
if (i_Data != VI_NULL) free (i_Data);
if (q_Data != VI_NULL) free (q_Data);
if (blank_Data != VI_NULL) free (blank_Data);
showError ("startGeneration()", error);
}
However this is the error I get:
I attached this example so that you may try it, or maybe I am doing something wrong?
There is no mention anywhere that this functionality is not supported on the PXI5670 however no matter what I try I cant do it. Does anyone know why this may be? Is the documentation just wrong and doesn't state that this is not supported on some models? Is there a specific order that needs to be followed? I have tried just about anything I could think of with no results.
Any and all help is appreciated. Thank you.
04-06-2023 12:51 PM
Ok so from what I'm seeing the only attributes that allow you to specify a waveform appear to be NIRFSG_ATTRIBUTE_WAVEFORM_SIGNAL_BANDWIDTH, NIRFSG_ATTRIBUTE_WAVEFORM_RUNTIME_SCALING, NIRFSG_ATTRIBUTE_WAVEFORM_PAPR
is that correct? This isn't mentioned anywhere in the documentation, the documentation makes it seem we can set NIRFSG_ATTRIBUTE_FREQUENCY, NIRFSG_ATTRIBUTE_ARB_POWER etc for each waveform independently by setting channelname to the waveform name.
This begs the question how would one change the frequency of waveforms referenced in a script? Do all waveforms in a script need to be the same frequency and output level?