07-24-2015 01:31 PM
I am currently employing NI-FGEN 2.9.5 and creating an output waveform script for my PXIe-5451 ARB. The script is shown below. What I want to do is change the "Repeat Forever" to a counted repeat or a repeat until or a break on trigger, but all of these issue scripting errors. I've read the new FGEN 14.0 release notes, but nothing is mentioned with regard to changes in the scripting language. Note that I'm currently using the hardware script triggers 0,1,2 so I could use hardware trigger #3 or employ a software trigger. I'm unaware of other options.
Thanks.
script scriptName
generate waveform0
wait 24
repeat forever
wait 24
if scripttrigger1
wait until scripttrigger0
generate wfmA
else
wait until scripttrigger0
generate wfmB
end if
wait until scripttrigger0
generate wfmC
end repeat
end script
07-27-2015 01:23 PM
Hello,
What are the errors you're receiving?
Thanks,
07-27-2015 03:23 PM
The repeat until issues error -1074116598
Possible reason: "If-Else" blocks are not allowed in "Repeat Until" loops.
The repeat on fixed count issues error -1074116599
Possible reason: "If-Else" blocks are not allowed in "Finite Repeat" loops
And the break issues error -201218
Possible reason: "If-Else" block not allowed in "break" block
What options exist?
07-27-2015 03:30 PM
You may be getting into a script size issue. Please take a look at this resource below. Go to 'Calculation of Script Size':
http://www.ni.com/white-paper/7283/en/
Thanks,
07-27-2015 03:58 PM
The "If-Else blocks not allowed" error indicates otherwise.
In addition, I calculate less than 200 bytes for my script. Multiply that times two for the two channel device (400 bytes) and add 256 samples (2 bytes each) times four waveforms times two channels adds another 4K of data. Add the 400 bytes of script and round up to less than 5 K of memory.
My device is rated at 128 megabytes. Memory is not the issue. Other thoughts?