03-25-2012 10:49 AM
Hallo, I am Andi and I am working on the DaNI robot.
I tried to attach a Gyroscope to the sb Rio on the dani robot. I connected the wires of the gyro to the board to get analog signals. It works fine.
I choose to programm a Fpga sub VI and implement this in a Gyroscope main vi to calculate the angular rate and finally the angular position of the gyroscope.
In the gyroscope Vi this both works fine for me!
Now I wanted to use the gyroscope vi as a sub VI in my main programm. It should give me only the information of the angle, so I specified the connector pane like this.
I programmed a very simple main vi to see if i get the required information, but it seems that it is not working. The Fpga does not execute in the sub- Gyroscope vi. And I do not know WHY!!!
Does someone hase got experience with this and can help me?
03-25-2012 11:09 AM
Hi toft,
Thanks for joining the forums!
It would be a good idea to attach your project so that we can see exactly what you have running on your FPGA, and what you have on the real-time side. It looks as though you are not passing your FPGA reference to the Gyro SubVI, which makes me wonder how you are reading back from the FPGA.
One quick thing to try would be to use an FPGA Invoke Method wired outside of your loop in the main VI, to programmatically Run' the FPGA code.
03-25-2012 02:58 PM
Hello Peter D!
Thanks for your quick response!
I really need hepl here cause i am working on my desertation.
I applied the project as an image where you can see all the different files.
The marked files are the FPGA sub vi for the Gyroscope VI and the Turn VI which I would like to habe as a main VI.
Can you specify this statement?
"It looks as though you are not passing your FPGA reference to the Gyro SubVI, which makes me wonder how you are reading back from the FPGA."
Cause I open a FPGA reference in the Gyro sub vi right? Do I have to do do something else to get the gyro FPGA running?
I also tried to put an invoke after the FPGA reference with no success, still the same, the FPGA does not execute. (attached a picture as well)
03-25-2012 03:41 PM
If I just open my Gyroscope Vi I get readings without a problem.
03-26-2012 02:07 AM
03-26-2012 06:41 AM
Thanks for your answer peter!
I am a bit confused, so I am not allowed to open the reference to the robotics starter kit if I want to use the FPGA for my gyroscope VI?
I am getting exactly the error you told if I am opening the gyroFPGA VI to have a look if it is running, while the main Vi runs.
What is your suggestion, how can I fix that problem? Is there an other way to get the Gyroscope readings from the Pins in the sb Rio?
Kind Regards
Andreas
03-26-2012 07:08 AM
Hi Andreas,
The Open FPGA VI Reference opens a reference to the VI or bitfile to be run on your FPGA. Quoting the linked help file:
You can download and run only one FPGA VI at a time on a single FPGA target.
Typically you will have one FPGA VI, which can have SubVIs. You will then open a reference to this code and pass the reference through a tunnel to your SubVI in MAIN.vi - so you will have to add your Gyro FPGA code to the DaNI FPGA code.
If you would like some more information (a lot more actually
) I would recommend having a look at the CompactRIO Developer's Guide.
03-26-2012 10:57 AM
So in other words is there no chance to run the FPGA reference with the Starterkit bitfile and the gyro FPGA in one programm at the same time?
Cause I will need to have the reading from the Gyroscope and for example from the encoders in the same programm.
This must be possible in a way. Can I not make the gyro FPGA vi kind of choosable in the read/write control or so? I need the readins from MOD A/AI0
Regards
Andreas
03-26-2012 11:08 AM - edited 03-26-2012 11:09 AM
You can only run one bitfile/FPGA VI at a time. However you just need to add to the code in the DaNI example to perform the functionality. The Starter Kit bitfile has been compiled from a VI - edit this VI to include the read from your AI0 alongside the other DaNI code. You can then recompile this code (by clicking the run button) - after compilation this edited FPGA VI can then be called from your RT Host.
- You will then be able to read/write to the additional IO.
Let me know if there's anything here you would like me to expand on.
03-26-2012 11:26 AM
Yes I am sorry but since this problem is only a bit of my project I would like to ask you for more help to do this.
I do not know how to include that into the starterkit bitfile and never came accross something like it.
Kind Regards
Andreas