Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read Digital I/O using PXI-7813R?

Solved!
Go to solution

Hi guys,

 

I am trying to read a digital signal using one of the ports in the PXI-7813R. The 7813R has 5 digital ports or 39 lines for reading in digital data. I connected a SCB-68 as the physical hardware interface for 'plugging-in' a 5V adapter, which will act as my signal for now.

 

After configuring the PXI through MAX, I wrote two codes, one for my Host pc and one for controlling the FPGA through the host. But I think, I may have over complicated things or gone in the wrong direction completely.

 

Any help in writing these codes would be much appreciaetd.

 

Thanks, Anoop

0 Kudos
Message 1 of 25
(7,180 Views)

Where are you having problems?  Can you share your code?



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 25
(7,178 Views)

Well, I want to display the data I obtain, but that desn't seem to work. Also, there is some error while you highlight the execution. 

 

i have attached the code.

0 Kudos
Message 3 of 25
(7,174 Views)

Well, I don't see you writing into the DMA in the FPGA.  That will cause a timeout error on the DMA read.

 

Are you trying to get all of the data points sampled at a specific rate?  If so, you just need to write the data into the DMA.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 25
(7,168 Views)

Hi, thanks for the reply.

 

Couple of questions, 1. when you mean sampling at a specific rate, what do you mean? Would I need to know frequency etc. of the incoming signal to adjust the sapling within my program?

 

Also, if I write into the DMA, how can i view this signal as it is written in continuously?

 

Thanks a bunch again, Anoop

0 Kudos
Message 5 of 25
(7,163 Views)
Solution
Accepted by RedAG

You need the FPGA to sample the signal at whatever frequency you expect the device to send the data.

 

If you write your data in the FPGA to the DMA, then on the PC side you just need to read from the DMA.  I like to think of the DMA as a queue.  It makes it easier for me to understand how it works.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 25
(7,161 Views)

Ok great, thanks man! or women!

 

AG

0 Kudos
Message 7 of 25
(7,158 Views)

Hi, sorry to bother you again, but where would the DMA write be in the FPGA? I mean, what value are we writing in? As far as I can see, there is only 'number of elements' and timeout in the write DMA.

0 Kudos
Message 8 of 25
(7,151 Views)

Configure the node to write (right-click it).



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 25
(7,145 Views)

Thanks man, but now, the Host vi reads in nothing, even though I have a 5v connected and configured through the PXI.

0 Kudos
Message 10 of 25
(7,136 Views)