LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VIScripting and NI-FPGA - copy registers

Solved!
Go to solution

Is there a way to copy or create FPGA registers using scripting in a project.  I am looking at needing a few registers for each IO (128) so if I could run a script to make and name them that would be really really nice.

 

I can create one, and get a reference to it in the project, but I can't use the GObject move, because I can't cast the ProjectItem ref to be a Gobject.  I also looked and don't see a project level "Copy", which would be the easiest.

 

 

My end goal is a FPGA target with the hundreds of registers defined. 

 

0 Kudos
Message 1 of 3
(856 Views)
Solution
Accepted by topic author EvanCo

I found this VI that seems to do the trick: [LabVIEW 20xx]\vi.lib\FlexRIO\ProjectCreator\ProjectCreatorClass\Create Register.vi

 

Pass in the reference of the ProjectItem you want to own the Register, and it has a configuration cluster for setting the name, data type, etc. When I ran this code a Register was successfully created in the project.

 

register.png

 

FYI this approach (and more generally, any attempt to call undocumented internal VIs) is not officially supported by NI.

0 Kudos
Message 2 of 3
(807 Views)

Awesome.  I was able to use that, normal scripting and then \vi.lib\rvi\ClientSDK\Core\Script\Memory\XNode\Public\nirviXnMemory_Open.vi and those VIs to change the register read\write nodes and I think I got it all working.  Thanks again

0 Kudos
Message 3 of 3
(754 Views)