11-05-2008 03:15 AM
Hi,
I like to generate clock of around 300kHz using 6534 card.Currently i could able to generate only 1kHz using simple Low -> High-> Low .How to accompalish that?
With regards,
JeyZ
11-05-2008 06:41 AM
Hello Jayz,
Your card is capable of generating 20MS/s. This means you can change the output logic state of any channel 20 million times in a second.
This corresponds to 10MHz as a clock signal.
You probably achieved the 1kHz by applying static output (low->high->low) to a channel in a for-loop in software.
To be able to get a higher update rate you have to program the card and make the card hardware circuitry do the job for you.
You can use the NI-HSDIO library for this. You probably have installed already, so just check the sample code suitable for your development environment.
You should look for the words "dynamic generation" in the CVI>Samples>niHSDIO folder.
Hope this helps.
11-05-2008 03:32 PM
Hi JeyZ,
I wanted to add to the discussion by pointing out that the 6534 will work with the Traditional NI-DAQ driver and the NI-DAQmx driver.The HSDIO driver will work with the 654x, 655x, and 656x product lines. If you are developing code I would strongly recommend that you use the DAQmx driver since it is a current driver and is being maintained. Assuming that you are working with the DAQmx driver, you can start by looking at ContReadDigChan-ExtClk example. You can find this on Windows XP under ...\Documents and Settings\All Users\Documents\National Instruments\CVI\Samples\DAQmx\Digital\Read Values. This example is configured to use an external clock, which may or may not be of use to you.
In order to change the example to use an internal clock, you can change the following line:
DAQmxErrChk (DAQmxCfgSampClkTiming(gTaskHandle,clkSrc,rate,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000));
The line can be changed to be:
DAQmxErrChk (DAQmxCfgSampClkTiming(gTaskHandle,"",rate,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000));
You can write a pattern of 0, 1 and set a sample rate of 600kHz in order to have a 300kHz clock signal on the specified channel.