I generated niRFSG.mdd and implemented MATLAB code to do the same thing as the ScriptTrigger CVI code. However, an error occurs when calling
invoke(sig_gen.GenerationConfigurationScripting,'writescript',waveformscript)
NI PXIe-5673E
The instrument returned an error while executing the function.
You cannot set the Power Level Type to Average Power in Script Mode. Either change the Power Level Type to Peak Power or use the Arb Waveform Mode.
The instrument returned an error while executing the function.
You cannot set the Power Level Type to Average Power in Script Mode. Either change the Power Level Type to Peak Power or use the Arb Waveform Mode.
Error using icgroup/invoke (line 93)
The instrument returned an error while executing the function.
The AWG reported the following error:
Error in niRFSG_test (line 66)
invoke(sig_gen.GenerationConfigurationScripting, 'writescript',waveformscript)
First of all not sure why I'm getting the Power Level Type warning since I'm actually using Peak.
invoke(sig_gen.Generationconfigurationconfigurewaveform,'configurepowerleveltype', 7001) % 7000 - Average, 7001 - Peak
I look into the second issue (script issue) and it seems like inside the .mdd generated code is not working correctly. When I replace invoke(sig_gen.GenerationConfigurationScripting, 'writescript',waveformscript) with my own local function call (by copying the actual writescript function from .mdd to a.m file scripttest(sig_gen.GenerationConfigurationScripting, waveformscript)
It seems like the problem is right here:
status = calllib(libname,'niRFSG_WriteScript', session, Script);
I noticed the same calllib is done for other niRFSG functions and it works but for the WriteScript it does not. Please note that the same call in C or C# works great.
I have been talking to mathworks support about this issue. They are still investigating. But since the instrument is generating this error, The instrument is informing through NIRFSG driver that the power level is set incorrectly, but most likely this error is regarding some other parameter set out of range. Perhaps this is causing the issue with the writescript. Can you provide any support to figure out this issue?
Thanks!