LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to read an FPGA control by name

Lets say my FPGA had 3 numeric controls: counter1, counter2, counter3...counter99. Is there a way to read one of those controls from the host by specifying say a string like "counter1".  In otherwords, I'm looking for something that's like the "read/write control" node but more dynamic.

CLED (2016)
0 Kudos
Message 1 of 13
(3,435 Views)

Not that I'm aware of.... the closest you might get to this is to create a case statement with each possible FPGA control read in one case each, then use your string "counter1" to launch the appropriate case.

Won't work dynamically though.

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 2 of 13
(3,406 Views)
That would be a good option if there weren't too many controls on the FPGA. I wouldn't want to create 100 cases and 100 read write nodes.
CLED (2016)
0 Kudos
Message 3 of 13
(3,400 Views)

I'm not aware of your application here, but if you have near enough 100 controls on your FPGA FP, all of the same type, could you not perhaps create a 100 element array of controls? Or if they differ, then a cluster of controls?

This would only require one read/write property node.

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 4 of 13
(3,398 Views)
The number of controls is not the problem. It's accessing the fpga controls dynamically that's the problem. Making a case structure with 100 frames would work fine but it's alot of work. Also, if the FPGA changes, the case structure would have to be manually updated. 
CLED (2016)
0 Kudos
Message 5 of 13
(3,375 Views)

I know my suggestion for one array of controls is not dynamic, but it's certainly adjustable programmatically. By allowing the array size to alter (I presume FPGA array controls can alter in size programmatically) you are effectively talking to any number of controls you need to. In this example, 'dynamically' would mean "modifying one element of the array", rather than programmatically dealing with a unique control by label string. For example, if the code needed to talk to control control01 in one iteration of a loop, then control04 in the next, instead of using a dynamic property read/write and calling the control by name, you would instead be modifying the control in index 1, then index 4.

 

I know this isn't particularly flexible, but it is scaleable.

 

Just trying to help.

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 6 of 13
(3,358 Views)

I think the only thing I don't like about an array is that it makes it much harder to trace. If I ever want to know what index 47 is, I have to go through the FPGA code and trace it out. I could make a lookup document but that would be another document I'd have to maintain. Thanks for the ideas. 

CLED (2016)
0 Kudos
Message 7 of 13
(3,338 Views)

I like to group all of the controls for a function into a cluster.  That way I have one main control to update for a given function.  For example I have 24 controls in a cluster that control the 8 analog outputs of the 7833.

 

Visualize the Solution

CLA

LabVIEW, LabVIEW FPGA
0 Kudos
Message 8 of 13
(3,332 Views)
The problem with clusters is that they are hard/clunky to read an element by a programatically provided name.
CLED (2016)
0 Kudos
Message 9 of 13
(3,330 Views)
Here is a VI (v8.2) that will update my 24 element cluster - by name. The code in the Update case would off course be implmented in a subVI.
Visualize the Solution

CLA

LabVIEW, LabVIEW FPGA
Message 10 of 13
(3,307 Views)