Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital IO timing

Hi Everybody!
    I'm developing a digital I/O application, and I'd like to reach the highest speed in card access.

    I do some  read-write (hence 2 tasks),  from 3 input an 3 output channels, on a NI 6509.  If I do something like (it's just metacode...)

    DAQwrite(1);
    DAQwrite(0);
    DAQwrite(1);

   I get a time spacing between samples of 1 millisecond.  If I do

   DAQwrite(vector);

   where vector = [1,0,1];

   I get 5 microsecond spacing between samples.

   What I'm looking for is:

       1)  It depends upon what this time spacing between  2 consecutive calls to a Write or Read? It seems to be unpredictable.  Does it depends upon Processor class, bus  speed (40 MHz instead of 800....), number of PCI devices.....  Is it similar to LPT port access behaviour? (quite unpredictable....)

       2) Is there a means to speed up my application? I have to emulate a communication bus, and it should be faster....

    If someone can provide me some reference to this issue, it would be apreciated!!!!

graziano


0 Kudos
Message 1 of 6
(3,999 Views)

Graziano,

the question you post is quite interesting. The point is that the board you are using does not offer HW Timing of digital lines among its features.
This means that Reads and Writes are depending on software function calls.
Being Windows a non deterministic OS as you know, sw function calls get executed whenever the CPU has time for them.

If you look at the metacode you reported above, in the scalar write case, you are calling the same function 3 times. This allows for "asynchronous" writes, that is each digital sample is not tied to the previous one, and the OS can serve other interrupts between 2 consecutive calls.
In the second instance (Array Write), you are calling the Write function just once. This occurs faster than calling the function 3 times in a row, but on the other hand it does not allow the OS to serve interrupts between 2 consecutive digital samples.

Now, if you are looking for performance, either speed or determinism, I suggest you determine what the constraints are for your application and then figure out whether you need an RT OS or a HW Timed digital board.

AlessioD

0 Kudos
Message 2 of 6
(3,974 Views)
Hi AlessioD,
   I actually know all these features; anyway, it's always useful to receive confirmations.....

   Unfortunately, I can't use  an RT OS,  because I have to place the board in a NT system, because this board should emulate an old device.

   Moreoveer, my card will have to implement an old (pdp11!) communication protocol, which involves  reads-writes that should be closer... Actually, this protocol defines minimum timings, not maximum, but the card has to communicate real-time with an external device, with low data-rate.

   What  I would  need, is a card that  can be programmed, in the sense that it can "take decisions" depending on arriving signals.....

   Just one more  thing: can it be better, for these needs, to use Traditional NIDAQ functions, that are quite raw, and maybe, for simpler tasks, faster? I actually don't know if  they're faster, I've always found good NIDAQmx......

  Thanks...

graziano
0 Kudos
Message 3 of 6
(3,973 Views)
Hi again...

   I refer to this post:   http://forums.ni.com/ni/board/message?board.id=70&message.id=4539

   It seems writteen for me!  So, Traditional DAQ seems to be faster for RAW SCALAR read-write  operations!

   So, I'm trying  to re-write my code in Traditional DAQ.  The only problem is that I can read Traditional DAQ, but I never wrote a new program in Traditional DAQ.

   It should be quite easy to replace read-write function.  the poroblem is  with MAX configuration.  I've tried to add a new DAQ device, but I didn't find NI 6509 in the list.  Moreover, I don't know what device starting address I should provide.... 

   Is there a  way to convert DAQmx  device configuration for traditional DAQ? Does NI 6509 support  traditional DAQ?

   Please, help needed!

graziano
0 Kudos
Message 4 of 6
(3,961 Views)

The 6509 digital IO board is only supported by DAQmx.

AlessioD

Message 5 of 6
(3,939 Views)
Thanks!
   I checked this also at the NI support.


0 Kudos
Message 6 of 6
(3,934 Views)