Specific Scripts Cause Incorrect Behavior When Using Script Triggers in NI-RFSG 1.2Primary Software: Driver Software>>NI-RFSGPrimary Software Version: 1.2 Primary Software Fixed Version: N/A Secondary Software: N/A Hardware: Modular Instruments>>RF Measurement Devices>>PXI-5660, Modular Instruments>>RF Measurement Devices>>PXI-5600, Modular Instruments>>RF Measurement Devices>>PXI-5610, Modular Instruments>>RF Measurement Devices>>PXI-5671
Problem: Why does nesting a repeat until scriptTriggerX instruction in a repeat Forever instruction not work properly with the NI-RFSG 1.2 driver? Solution: The script language introduced with NI-RFSG 1.2 and used by NI RF signal generator products is a very flexible technology. However, there are a few very specific scripts that, when combined with specific instructions, do not work as intended. These scripts involve nesting a repeat until scriptTriggerX instruction in a repeat Forever instruction. For example, the following script does not work as intended: script myScript0 repeat Forever repeat until scriptTrigger0 generate wfmSine end repeat generate wfmSquare end repeat end script The script is intended to program the arbitrary waveform generator (AWG) to generate the waveform wfmSine continuously until scriptTrigger0 is TRUE. Then the script should generate wfmSquare, and then loop back to repeat wfmSine until the scriptTrigger0 instruction, and so on. Unfortunately, after receiving the first scriptTrigger0, generating wfmSquare once, and looping on wfmSine the second time, a second scriptTrigger0 causes the generation to terminate. The following workaround requires adding a line to the script to call another scriptTriggerX.
The following script is an example of the workaround for this example: script myScript0Fixed repeat Forever repeat until scriptTrigger0 generate wfmSine end repeat repeat until scriptTrigger1 generate wfmSquare end repeat end repeat end script Though the generate wfmSquare instruction is in a repeat until.. instruction, scriptTrigger1 is configured so that the trigger is always asserted, and thus wfmSquare is generated only once before moving to the next instruction. The following scripts also require workarounds similar to the previous example: The following script generates the wfmSquare instruction once, loops forever, and generates wfmSine inside a repeat until scriptTrigger0 loop. After the first trigger the waveform generation prematurely ends. The workaround is similar to the previous example: add an extra repeat until scriptTriggerXaround the generate wfmSquare line. The scriptTrigger instruction is configured as before. The following table illustrates the workaround for the original script in this example:
The following script is designed to wait until receiving a scriptTrigger0 before moving on to the repeat Forever statement and starting waveform generation. It also prematurely ends once the second scriptTrigger is received. The fixed version uses a dummy waveform of zeros. This empty waveform is generated until scriptTrigger0 occurs, and then the desired waveform is generated. The wfmZeroes instruction should have the minimum number of samples supported by the specific module to minimize delay from the trigger to next step of the script. Note that this solution does not require the extra scriptTrigger as described for the previous examples.The following table illustrates the workaround for the original script in this example:
Related Links: Drivers and Updates: RF Measurement Hardware Attachments: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

