11-02-2012 12:07 PM
Hi Max,
This script you posted looks good to me. My second suggestion would merely replace all repeat until scriptTriggerX instructions with repeat until scriptTriggerStopWfm or something to that effect (whatever you want to name it). This way you use the same trigger to stop any waveform being generated (except waveform0).
Regards,
11-06-2012 02:44 AM
Hi Chris,
Please tell me, the function niFgen Configure Software Edge Script Trigger VI can work with more than 4 triggers (with twenty, for example)?
And the function niFgen Write Script VI whether limitations by the number of lines in the script?
Regards,
Max O.
Engineer and software developer,
TeSLa.
11-06-2012 07:48 AM - edited 11-06-2012 08:02 AM
Hi Chris,
In this example, it turns out that Triger0 stops the Waveform1.
And then one runs the Waveform2, but that we should not start again send Trigger0.
Stop and start happening simultaneously?
Regards,
Max O.
Engineer and software developer,
TeSLa.
11-06-2012 12:30 PM
Hi Chris,
What is done so that еhe if/else/end if instruction must be preceded by a generate or wait <N> instruction?
Function wait 8 is the number of samples? And what is its minimum possible value?
In the following example, the wait 8 serves as a timeout or it enables after 8 samples to execute the code that follows it?
wait 8 if scripttrigger0 generate myWfmA else wait 8 if scripttrigger1 generate myWfmB else generate myWfmC end if end if
Regards,
Max O.
Engineer and software developer,
TeSLa.
11-07-2012 08:05 AM - edited 11-07-2012 08:12 AM
Hi max_i,
The script editor help file is useful for questions like these, have you had a chance to look through it? It should save you time instead of waiting for a response from someone on the forums. From the script editor help file for the "wait" function:
"Pause execution of a script. You can pause the script until a particular Script trigger is received or until a specified number of samples are generated."
Example: (also from help file)
Best Regards,
David B
National Instruments
Applications Engineer
11-07-2012 03:31 PM
Thanks David,
I looked through the script editor help file.
But I all the same still have questions.
Than what would happen in a particular example for "wait 8" function?
wait 8 if scriptTrigger0 repeat until scriptTrigger0 generate Waveform0 end repeat else wait 8 if scriptTrigger1 repeat until scriptTrigger1 generate Waveform1 end repeat
That is, after sending the scriptTrigger0 (or in other words passed software trigger) generation the Waveform0 will begin immediately after sending of a trigger (without delay) or anyway, until after 8 samples generating a new waveform will not start?
And can you answer to my previous question.
What to do if need 20 software triggers, for example?
But the function niFgen Configure Software Edge Script Trigger VI works with 4 triggers.
If exceed this number, we get an error:
Regards,
Max O.
Engineer and software developer,
TeSLa.
11-08-2012 12:04 PM
Hi max_i,
This code will wait 8 samples and then check for scriptTrigger0. If scriptTrigger0 is high, then it will generate Waveform0 until it receives scriptTrigger0 again. If scriptTrigger0 is low, then it will wait another 8 samples, then check for scriptTrigger1. In summary, if it is in the wait 8, it will wait 8 whether the trigger is sent at that point or not.
Best Regards,
David B
National Instruments
Applications Engineer
11-12-2012 01:23 PM
Ok, thanks.
What about the second question?
About the function niFgen Configure Software Edge Script Trigger VI.
Regards,
Max O.
Engineer and software developer,
TeSLa.
11-13-2012 04:19 PM - edited 11-13-2012 04:19 PM
11-19-2012 02:07 PM - edited 11-19-2012 02:16 PM
Hi,
That's a pity!
Why so few?
What to do if need a minimum of 20 triggers?
There are other ways how to implement it (In Script Mode)?
Thanks!
Max O.
Engineer and software developer,
TeSLa.