LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FGEN script abort via trigger

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

0 Kudos
Message 1 of 5
(3,680 Views)

Hello, 

 

What are the errors you're receiving?  

 

Thanks,

Jonathan R.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(3,545 Views)

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?

 

 

0 Kudos
Message 3 of 5
(3,531 Views)

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,

Jonathan R.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 5
(3,524 Views)

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?

0 Kudos
Message 5 of 5
(3,520 Views)