Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital write latency on PXİ 6289

Solved!
Go to solution

Hello all,

 

I'm a sort of newbie with Labview programming.

I have a loop using digital change detection of certain digital lines as its time source.  In that loop,

I update the value of three digital output lines according to the value of the digital input line  which are responsible for the change.

 

I know that the maximum change detection rate will be about 50 khz. which leads to that write tasks of the three digital outputs

has to be finished in less than 20 us. Right now, I've seen that I miss some loop iterations since my write execution time is about 150 us.

 

I also checked if the digital write is responsible for slow execution time. and yes, as I disable the digital write portion of my code which

leaves reading the status of digital input lines whose change is detected solely in the loop, my execution rate drops down to a 5 us.

Is this the best I can achieve with PXI card or am I doing something wrong?

 

My program sequence of the digital output lines is as follows:

 

1. Initializing the three digital output line by create virtual channel.

2. start their task.

3. write new values to them, in the loop

 

Any help is appreciated a lot.

0 Kudos
Message 1 of 6
(5,109 Views)

Hi,

 

Do you think you could post a screenshot of your code to see if we can find any way to further optimize it? 5 us seems like a pretty reasonable execution time to me.

Matt W.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 6
(5,070 Views)

Attached, You can find the screenshot of my vi.

I have PXI 6289 in slot 7 and PXI 6602 in slot 8 on a PXIe-1062Q machine.

0 Kudos
Message 3 of 6
(5,049 Views)

I also realized today that I'm having the same issue as http://forums.ni.com/t5/Digital-I-O/Incorrect-DI-readings-with-change-detection-events-and-USB-6229/...

 

I don't how to modify the solution there to my specific application.

 

 

0 Kudos
Message 4 of 6
(5,023 Views)
Solution
Accepted by topic author gorkem.secer

I don't have any suggestion for improving DO Write performance... some other devices (X Series, some of the DIO boards) support memory mapping for digital outputs which would have helped a bit, but unfortunately I don't believe the 6289 (or 660x) supports this feature (according to this, memory mapping is only supported for AI and AO tasks on the 6289).  A very minor improvement (doubtfully even noticeable) would be to write U32 data instead of a boolean array.

 

As far as the change detection issues from the other thread... I'm not sure exactly the behavior you are seeing but you might be better off just reading a digital input task as quickly as possible in a while loop (no change detection timing at all) and compare the value against the previous state in software--only write to the output/counter tasks if the input has changed.  It's worth trying at least, I don't have the necessary hardware for a benchmark.

 

 

Could you describe your application in general including any timing requirements you may have?

 

 

Best Regards,

John Passiak
0 Kudos
Message 5 of 6
(4,951 Views)

I missed your post. 

That was exactly the solution and I also further improved it by reading all avalabile samples so far.

I didn't see your post at the time I was dealing with the problem but thanks a lot though!

0 Kudos
Message 6 of 6
(4,538 Views)