09-06-2012 09:16 AM
Hi,
I have made a little stimulation program in Labview 7.0, and I'm using NI SCB-68 (see printscreen of block diagram in attachment).The user can load a txt document of 1000 datapoints (between -1 and 1) which define a pulse, and specify the pulse duration, the stimulation frequency and the total number of seconds to stimulate.
To give the pulses at a certain frequency, I've connected the inverse of the frequency to the time delay button.
When I connect the output of the NI with an oscilloscope, I can see that the stimulation frequency is correct for all values until higher than 50Hz: the 50Hz stimulation gives pulses with an interpulse duration of 20ms, but when I try a higher frequency, the interpulse duration stays 20ms.
Does anyone know whether I've made a programming mistake or whether this is a hardware problem?
Thanks!
09-06-2012 10:41 AM
The NI SCB-68 is just a connector block - what data acquisition device do you have in your PC to generate these signals.
Ken
09-06-2012 11:19 AM
I'm using M series NI PCI 6251
09-06-2012 02:43 PM
My guess would be that you are hitting the software timing limits with your program. Since you are using a time delay to control frequency that means that your program needs to be able to run faster than the frequency you want. So it looks like the fastest your loop can run is 20ms since you cant go above 50hz. To go faster you will need to go to hardware timing or a digital signal.
Look at the example programs (help >> Find examples) and do a search, you should be able to find some useful examples. I do not have LV 7 on my machine right now to check.
09-06-2012 02:52 PM
I would recommend upgrading to DAQmx. It is a much better API for data acquisition. Also, setup the channel before you enter the main loop and don't close it out until after the main loop. If you are trusting your software to give you a good, deterministic output interval, you are greatly mistaken. You should be using the hardware timing whenever possible. But maybe getting the setup and close out of the way will speed things up enough for you.