07-15-2007 10:26 PM
07-24-2007 09:02 AM
Hello-
Apologies, but the DDK forum is only supported by English-speaking National Instruments engineers. If you are comfortable with and able to repost your question in English I will be glad to help out.
Thanks-
07-26-2007 02:32 PM
Hi, I am writing code in C# with .Net and used the below code to access the DAQmx drivers. Everthing worked but I found talking to the 6503 ports was quite slow about 300ms per port access. Are there other drivers available that are quicker or will I have to learn how to do direct register programming of the card? The PCI bus is fast so it must be the software that is slowing things up.
Best Regards,
Ivan
Below just a snippet of code to access port 0
using (Task TaskWritePort0 = new Task(){
TaskWritePort0.DOChannels.CreateChannel("Dev1/port0", "port0", ChannelLineGrouping.OneChannelForAllLines); DigitalSingleChannelWriter writePort0 = new DigitalSingleChannelWriter(TaskWritePort0.Stream);writePort0.WriteSingleSamplePort(
true, (UInt32)bCrateNo); //rt.Text += "Crate No(Hex): " + bCrateNo.ToString("X") + "\n";}
07-27-2007 08:25 AM
Hello Ivan-
There are several changes you can make to increase your loop performance with NI-DAQmx.
First, the creation of the DO task and channel only needs to be done once at the beginning of operation. These can be persisted throughout the execution of your application and simply referenced by the Write() methods. This should speed up your loop rate from a software perspective.
Second, if you want to write several times in a loop you may want to consider explicitly calling the DAQmx Start() method and then use autoStart=False with the Write() method. This will speed up your loop rate from a hardware perspective by allowing for faster write cycles. In this case, only the register access required to update the data register is necessary rather than having to repeatedly arm and disarm the device.
Hopefully this helps-