01-05-2022 03:33 AM
Hello everyone
In the code I use any DIO pin on the FPGA target and then toggle the DIO pin on and off via Myrio, that works. No problem here. Also, I'm using a different pin than the one used in the FPGA and I can't turn the DIO pin on-off in Myrio with Express VI.
What is the reason of this? I could solve this problem by programming all the DIO pins directly through the FPGA and then just triggering those pins through myrio.
But still I wonder. Does it prevent toolkits in Myrio from reaching the FPGA I/O pins because the FPGA automatically deploys it to run after it's programmed?
Any opinion given is worthy of respect.
01-05-2022 07:21 AM
@constructionworker wrote:
Any opinion given is worthy of respect.
Here is an opinion you've been given numerous times -- for an explanation of why your code does precisely what you tell it to do (rather than what you want it to do), you need to show us respect by posting your code. Please.
Bob Schor
01-05-2022 02:56 PM
Sorry, the code is attached.I thought it wasn't necessary.What I want to do here is to use DIO pins on both FPGA and Myrio.
01-05-2022 09:15 PM
Thank you -- looking at your code, I think I may be able to shed some light on your issue.
The myRIO can function on two levels (particularly when running LabVIEW 2018, with the addition of the myRIO Software Toolkit, which provides you with the Express VIs you are using). One level, meant to get you started with the really sophisticated Real-Time hardware in the myRIO, is to use the myRIO Toolkit, and the sub-VIs and Express VIs you can find in the "myRIO" Block Diagram sub-Palette. Most of this Toolkit consists of Express VIs, which "hides the messy details" involved in communicating with the myRIO's FPGA (which has access to the I/O Ports) and "wraps" access to the hardware in a layer of Software.
You have mixed the "high-level" (Express VI) code with some "low-level" (FPGA) code. I must confess that I've not used the Express VIs very much, so I'm not sure what you'd need to do to convince the Express VI to only access a single DIO channel.
Your FPGA code is very easy to understand -- however you set the Open-close pin control, that value will not be changed by the Express VI (because every 25 ns, the value is reset to match the value passed in via the Open-close pin Control).
My advice would be to go with either a "pure" Toolkit solution (using Express VIs) or a "pure" FPGA solution.
Bob Schor
01-06-2022 04:21 AM
Thank you for your explanation.
I have now solved the problem using pure FPGA, but I wonder why it cannot be done. Does it prevent Express VIs from running while the FPGA code is running?
01-06-2022 09:17 AM
@constructionworker wrote:
I have now solved the problem using pure FPGA, but I wonder why it cannot be done. Does it prevent Express VIs from running while the FPGA code is running?
While I haven't exactly tried this, it would not surprise me if you could, say, use the Analog Input Express VI along with a custom FPGA that manipulated some DIO pins (as these two use different myRIO "resources").
Bob Schor