Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

Running custom personalty on FPGA for myRIO

I have a question regarding running custom personalty on FPGA for myRIO. I get an error -61202, which says that I must close the reference to FPGA before referencing to new one. At the beginning I open FPGA reference and then I initialize SPI (SPI open.vi), that generates generic FPGA reference as well (I suppose that SPI needs FPGA to access the outputs). My question is what should I do so there will be no conflict? There is a picture below. Thanks in advance!

 

FPGAerror.PNG

0 Kudos
Message 1 of 8
(6,397 Views)

SPI really need FPGA to access myRIO IOs. Are you using SPI VIs included in the myRIO palette?

 

In this case these VIs are calling FPGA bitfile, so you will not be able to use your custom bitfile as well.

 

If you need to run your FPGA code together with SPI functionality, just copy SPI part from the existing myRIO FPGA code to your code.

 

 

Thanks,

Arev

 

CTO | RAFA Solutions

 

Certified-LabVIEW-Embedded-Systems-Developer_rgb.jpgCertified-LabVIEW-Architect_rgb.jpg

 

 

 

 

Message 2 of 8
(6,328 Views)

Hey Arev, thanks for reply! 

Yes I use VIs for SPI that are in myRIO pallete, but I use them in Real-time part of the program not in FPGA program. So should I move them there or you meant the other way as I have now?

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

Hello,

 

Actually you should copy FPGA code part implementing the SPI functionality to your FPGA code. If you will create new project from Create Project -> Templates -> myRIO and select myRIO Custom FPGA Project, you will find FPGA Main Default.vi inside. The FPGA VI includes the code you need to copy to your custom code.

 

After just modify the RT part to call your FPGA bitfile, and use the reference in SPI VIs.

 

Thanks,

Arev

 

Certified-LabVIEW-Embedded-Systems-Developer_rgb.jpgCertified-LabVIEW-Architect_rgb.jpg 

Message 4 of 8
(6,310 Views)

Now it is becomming celarer. 

Just to clarify - actually all the code that deals with SPI (SPIopen, SPIwrite, read) is somewhat FPGA code part since it has FPGA generic reference. So I should copy those things to my FPGA code. How can I use this generic reference? Is it used by default if I the SPI VIs are in my FPGA code?

 

As soon as I manage to test it, will inform you how it goes.

 

Thanks Arev for your help!

0 Kudos
Message 5 of 8
(6,305 Views)

When you open the FPGA reference, it is creating the reference to use for accessing controls with FPGA Read/Write controls for example. You can use generic reference, to pass between the subVIs, but you should cast it to your reference using "Dynamic FPGA Interface Cast" available in FPGA Interface Palette.

 

Thanks,

Arev

 

Certified-LabVIEW-Embedded-Systems-Developer_rgb.jpgCertified-LabVIEW-Architect_rgb.jpg

0 Kudos
Message 6 of 8
(6,298 Views)

Hello Arev!

Do you have any examples with Dynamic FPGA Interface Cast? I did not manage to use it, since I have FPGA reference output from my custom FPGA and Generic reference outputs from SPI VIs.

This way I can use SPI vis in the real time part - I just have to cast reference to bitfile? It would be much easier.

 

Thanks

0 Kudos
Message 7 of 8
(6,053 Views)

Hello,

 

You can check how it is implemented in the "Set Custom Bitfile.vi". The VI can be found in the following palette: myRIO -> Device Management.

 

But besides using custom FPGA reference in myRIO VIs, you should have integrated SPI functionality in your FPGA code.

 

Thanks,

Arev

 

Certified-LabVIEW-Embedded-Systems-Developer_rgb.jpgCertified-LabVIEW-Architect_rgb.jpg

0 Kudos
Message 8 of 8
(6,040 Views)