LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically selecting Digital IO at run time on FPGA.

I need to be able to programmatically select  DIO line that I want to write to at runtime.  The target is an NI 7833R FPGA card and I'm running Labview 8.5 and Labview FPGA Module 8.5.0.

I receive requests through the FPGA DMA writes with the bit and the time to execute the change.  At the moment I select the bit to write to by creating a huge case statement that has each bit in a seperate case.  This case statement will grow to have 114 cases, which just doesn't seem write.

I tried to set the value property on the Control wired to the FPGA I/O Node but it's looking for a FPGA I/O type.

Does anyone know if there is a way of programmatically selecting the I/O Line at runtime ?
0 Kudos
Message 1 of 8
(4,122 Views)

How is the bit information represented?  An integer such as 0-113?  If this is the case you could create an array of FPGA I/O constants and use the bit information to index the array to the I/O you wish to write to.

 

 

0 Kudos
Message 2 of 8
(4,100 Views)
Thanks for your solution,

I hadn't thought of that.  Unfortunately after spending an hour implementing the change and trying to compile.  I got a error message indicating that dynamic allocation of IO Type Refs is not supported on the current platform.

I'm guessing that due to the fact that the 7833R FPGA has both DIO/AO & AI it's not quite smart enough to work out the connection type to the IO.  I even went as far as allocating three arrays where I seperated DIO/AO and AI, but still got the same error.

Once again thanks for your help.
0 Kudos
Message 3 of 8
(4,081 Views)

Even Assigning all FPGA I/O's in array and accessing via array index is not working.Same error is prompted.

 

Any solution?

0 Kudos
Message 4 of 8
(3,731 Views)

Hi Abhi_shek,

 

Can you post more details about the error you are seeing? Would it be possible to post a screenshot?

 

Tim W.

Applications Engineering

National Instruments

http://www.ni.com/support 

 

0 Kudos
Message 5 of 8
(3,712 Views)

I suppose this is something like that:

 

 ScreenHunter_001.jpg

 

The broken VI is due to the fact that "Refnums must be constant references in the current target. This construct could potentially cause a reference to be dynamic". I am not sure how nebelkov eventually solved his problem, but I don't quite see a way around editing individual cases of a case structure, with an individual write node in each case:

 

ScreenHunter_003.jpg

 

It could be annoying to create 114 cases and edit each one, but it would still be faster than compilation in any case!

My 2 cts.

 

0 Kudos
Message 6 of 8
(3,685 Views)

You can also bundle several IOs together by using ports instead of single IOs:

With the output enable you specify whether you read or write and then you can set any data.

You might also bundle several ports together to larger (U16 or U32 ...) constants / controls.

 

dioport.png

 

Regards, Ben

_________________________
CLA
Message 7 of 8
(3,679 Views)

Definitely zombie thread resurrecting, but for the good of those who may fall on this post while searching for how to do what the title says, which I had to.

 

@X. wrote:


I don't quite see a way around editing individual cases of a case structure, with an individual write node in each case:

 

ScreenHunter_003.jpg

 

It could be annoying to create 114 cases and edit each one, but it would still be faster than compilation in any case!

My 2 cts.


I did put together a scripting way of creating case selectors for FPGA i/o Xnodes. Here on github. Enjoy...

0 Kudos
Message 8 of 8
(1,181 Views)