LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

user-specified repetition rate of a group of binary signals in HSDIO

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.

0 Kudos
Message 1 of 14
(3,381 Views)

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

0 Kudos
Message 2 of 14
(3,379 Views)

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

0 Kudos
Message 3 of 14
(3,369 Views)

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

0 Kudos
Message 4 of 14
(3,367 Views)

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!

0 Kudos
Message 5 of 14
(3,359 Views)

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 mywfvm     
Wait until scriptTrigger0 
end repeat 
end script
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

 

0 Kudos
Message 6 of 14
(3,349 Views)

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! 

0 Kudos
Message 7 of 14
(3,314 Views)

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.

0 Kudos
Message 8 of 14
(3,312 Views)

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!

0 Kudos
Message 9 of 14
(3,297 Views)

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!

 

 

0 Kudos
Message 10 of 14
(3,289 Views)