LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help for RT PC timed loop in us?

If you can send a small vi. in which i can generate certain almost 11 patterns of 15 to 20pulses with(.5us pulse width) 500KHz frequency and 512us interval using NI PCI 6251 either reatime or simple which will be really helpful for me.

                                                                                                        Thanks

 

 

Yours sincerely

 

 

0 Kudos
Message 11 of 20
(1,011 Views)

Please clarify your timing requirements.  I don't understand how you could have 0.5us pulse width and 500kHz frequency.  By interval, do you mean the pattern should repeat (or the next pattern should start) every 512us, or do you mean that between the last edge of one pattern and the first edge of the next pattern there should be a 512us gap?  A simple diagram would help.

0 Kudos
Message 12 of 20
(1,002 Views)

Two options: with one (LS) and two (HS) counters. Bursts of 20 samples (sometimes zeros in the end) with 2 kHz repetition rate.  I do not have hardware, so this might work, but bugs are possible.

High speed should work up to 500 kHz/20 samples = 25 kHz, during changes it might skip pulses.

Low speed is slower: real-time might help, in Windows you might need to play with execution system, VI priority.

PS: to generate 0.5 us pulses you will need to work at 2MHz and generate 4 pulses (1=true, others - false) for each bit. Now two subsequent TRUEs make one wider TRUE.

Download All
0 Kudos
Message 13 of 20
(992 Views)

If the task is properly configured, you do not need to stop and restart in order to change the pattern.  I have neither the hardware nor time to set up and test an example VI, but look at the DAQmx properties, specifically the Regeneration Mode and the write position within the buffer (Offset and Relative To).

0 Kudos
Message 14 of 20
(984 Views)

By interval i mean 512us time between first edge of first pattern and first edge of second pattern.

 

Yours sincerely

0 Kudos
Message 15 of 20
(966 Views)

The problem i have described is still there. From my point of view Real time PC  1Mhz clock is not applicable with DAQ. I have tested it on NI PCI 6251. NI should append or describe in programming that 1Mhz option is just for software iterations which is not big advantage. The solutions i have recieved are all not related to task.If some one tell some thing verified i will be glad as well as serprized.

 

Yours sincerely

0 Kudos
Message 16 of 20
(945 Views)

Hello Ali,

You are correct, the 1 MHz clock is for software iteration, however when programming DAQ you can the DAQ's internal clock to set up the sample rate or write the values using the software timed option, that means a new value is written everytime the function is called by software. A point to clarify is that real time means ON TIME , not faster. For example, you can configure a timed loop to iterate every 0.5 us, but that does not mean it will do that, the iteration speed depends on the code you place inside the loop, a comparison is Ferrari, is a pretty fast car, but you need a highway to drive it at maximum speed, if you take the ferrari off road you can not go fast. However as the daq card has its own internal clock you can configure it to sample at 1 MHz even if the loop that writes or reads the data to it iterates to 500Hz

Regards

Mart

0 Kudos
Message 17 of 20
(939 Views)

Did you try moving the DAQ Task creation, start, and stop outside the loop as suggested, to see how much faster that will be? I don't have the hardware to test it, but it will be much faster. Here's a simplification and modification of your VI that just outputs a pattern over and over again at the timed loop rate. I realize that's not quite what you want, but if it achieves your timing goal it would be easy to modify to do what you want.

Test 22.png

0 Kudos
Message 18 of 20
(928 Views)

This is a completely different solution: it generates burst of data (changes of the digital state, not pulses) with 2 kHz rate between points.

Real Time will provide this rate and faster, but not 2MHz as required. 

0 Kudos
Message 19 of 20
(914 Views)

@Alexander_Sobolev wrote:

This is a completely different solution: it generates burst of data (changes of the digital state, not pulses) with 2 kHz rate between points.

Real Time will provide this rate and faster, but not 2MHz as required. 


Yes, I realize it does something different than what the poster wanted, but I'm hoping it's a step in the right direction. I still don't understand what's he's trying to achieve. It sounded like he was trying to get the loop to run at 1Mhz even though the dt is 500 counts of the 1Mhz clock. Anyway, if this works, then the next step would be a simple modification to output multiple points instead of a single one on each loop cycle.

0 Kudos
Message 20 of 20
(907 Views)