07-02-2010 09:44 AM
Hi,
I need to have a user-specified repetition rate for a group binary signals such as 1010101010. I already had a control for clock rate as the frequency of the signals. Can I use trigger or write a script on controlling how frequent this group of signal run. I am running in HSDIO. Please let me know if I need more clarification on this issue.
Thank you.
07-02-2010 09:54 AM
Hi Gordooo3,
Can you be more specific about what exactly you want?
Are you wanting to change the data rate of a waveform based on user input (changing the clock frequency "on-the-fly") or are you wanting to change the time in between repetitions of a waveform, keeping the same clock frequency, but adding "dead" time between each waveform?
Thanks,
Keith Shapiro
National Instruments R&D
07-02-2010 10:44 AM
Hi Keith,
I want to change the time in between repetitions of a waveform, keeping the same clock frequency, but adding "dead" time between each waveform.
Thank you very much
07-02-2010 10:51 AM
What sort of delays are you looking for? > 1ms? 100s of ns?
You can use a software script trigger if you don't mind your resolution being "large" (in the 100s of us or more). If you need it to be hardware timed, it can't be done just with a single HSDIO card. Our scripting engine requires either fixed duration loops or to act on a trigger.
If you had a DAQ card, or anything where you could create a pulse train of varying frequency, you could use that that as a hardware script trigger, which should get you sub-1us reaction time, depending on your output clock frequency.
Does that make sense?
Keith Shapiro
National Instruments R&D
07-02-2010 12:53 PM
Hi Keith,
The sample clock rate is from 50KHz to 4MHz. The repetition rate need to be between 10Hz and 100Hz. I don't have a DAQ card. I am very new to LabView, is there a tutorial or help forum for writing scripts?
Thank you!
07-02-2010 01:30 PM
With your repetition rate at 100Hz or slower, you can do this with a software script trigger.
I created this script in our Script Editor (from Start Menu|Programs|National Instruments|NI-HSDIO):
script myScript1 Repeat forever Generate mywfm Wait until scriptTrigger0 end repeat end script
We actually do have an example program for how to generate using a script. Open up Example Finder, and search for:
Dynamic Generation Software Script Trigger.vi
You can modify this to do exactly what you want.
Take a look and let me know if that helps.
Keith Shapiro
National Instruments R&D
07-07-2010 03:12 PM
Based on the example you mentioned, I made some changes. In order to have a selection of repetition rate for the waveform, I created a case structure with 10 different frequencies. Case 1 is 10Hz, case 2 is 20Hz, ... case 10 is 100Hz. Should I just add a wait time to different cases to create different frequencies? Such as, for 10Hz, I can add 9s wait before the trigger in that case. Is that correct? Thank you!
07-07-2010 03:18 PM
The wait happens in parallel with the execution of the loop, so you should set the wait to be whatever your period should be.
In reality, you probably don't need to use a case statement - you can just wire up a calculated value to the Wait(ms) VI.
07-08-2010 09:21 AM
Hi Keith,
Thank you for your help. I am new to LabView and PXI. I created this vi and hope you can check if this is correct.
I intended to do followings:
1. Create square waveforms
2. the out of phase waveform needs to have 31ns delay on the rising edge to the waveform before.
3. The frequency of the waveform needs to be 50K, 100K, 200K, 500K, 1M, 2M, and 4MHz.
4. The number of transmitted cycles needs to be between 1 and 16.
5. The repetition frequency of each waveform needs to be between 10Hz and 100Hz.
Thank you very much for your help!
07-08-2010 12:09 PM
I don't think you want to use the Configure Generation Repeat VI. The script will handle your generation repeat. Instead of having the script repeat forever, change "forever" to be the number of times your user wants to repeat.
It looks all right to me, otherwise. There are some subtle changes we could make to improve performance, but otherwise, make those changes about the repeat and give it a shot and see if it works!