From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

PCIe-6509 data transfer

Hello,

 

I am trying to use the NI PCIe-6509 board to send/receive data on the I/O pins.

 

I have created two tasks - rx and tx - each with one pin. I also set the rx task to listen for changes with the DAQmxCfgChangeDetectionTiming function, to start sampling (continuously) at both rising and falling edge of the rx pin.

 

If I send the following sequence on the tx pin:

 

0 1 0 1

 

I receive the data on the rx pin as expected. However if the sequence is for instance

 

0 0 0 1

 

I only receive

 

0 1

 

If I set the sampling to Finite, and sampsPerChan to 4, I get an error for not enough samples available. The problem is that the DAQ driver is not detecting the consecutive 0's in both continuous and finite sampling modes. If I do not use the DAQmxCfgChangeDetectionTiming, it seems to sample the rx line every 15 or so ms, so I suspect that this is the way to go to capture all the data. This however means that I have to regularly parse the received data until I get a pattern so I know that a message has been received.

 

Ideally I would like to have the DAQ driver to start sampling on a rising/falling edge, and retrieving a number of samples every 15 ms from that point onward.

 

From what I am seeing it seems that when using the DAQmxCfgChangeDetectionTiming function it only samples on the edges. Is this correct, or maybe I am missing something?

 

By the way, for this specific board only these two sampling methods are available, correct?

 

Thanks

 

0 Kudos
Message 1 of 3
(2,821 Views)

Hello,

Did you fist start with an example to check if the problem is not in your code?

You have plenty of DAQmx examples usable for a PCIe-6509 (Digital - Finite Output/input, ...)

Pierre-Emmanuel BELLES
Certified LabVIEW Developper
Certified TestStand Architect

0 Kudos
Message 2 of 3
(2,789 Views)

I have seen the samples, I do not know however which ones are compatible with the PCIe-6509. At this point the only way I have (I do not even have physical access to it) of testing the board is via a loopback connection between a DI and a DO (had to intoduce a delay on the sending code has the board has a 10MHz clock for sending, while the reception is sofwtare timed).

 

If the message transmitted has edges (0 1 0 1 0 1 0 1) I receive it fine. If I use an emulated version of the board and read the first 8 pins, with change detection (waiting for rising and falling edges on all 8 pins), I receive the first 10 values correctly (the emulator writes a binary counter to the lines, and I correctly receive 0 1 2 3 4 5 6 7 8 9, which is not surprising as every value implies at least one rising or falling edge on one of the 8 lines).

 

The problem is that in my case (0 0 0 1) which uses only a single line, the line state is not supposed to change in 3 consecutive samples, but it should be sampling the line anyway every 15ms. I am just trying to understand If what I am expecting to happen is what should be happening, or if it is just not possible (with this specific hardware at least).

 

I find that the DAQmx API/framework documentation details all the possible software options and use cases, but then not all of those options are possible on all the supported hardware devices, and it does not seem to mention (clearly at least) which devices support which features. The device own documentation on the other hand mainly mentions hardware features, so there is not much information mapping the device with the DAQmx documentation. Hence my uncertainty.

 

Thanks.

0 Kudos
Message 3 of 3
(2,784 Views)