LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to use myRIO "Read/Write Control" value from FPGA to control myRIO

Hello,

 

I am trying to use a value that I obtain by Reading an indicator on a Target FPGA, but I am unable to control onboard LED's despite the activation of the respective case structure.

 

I noticed that when I initially open the project, when the Target FPGA has not yet been compiled, that one of the on-board LED's is ON. Also, I have an LED that I would like to dim through PWM, and it is bright before I compile the Target, but dim afterwards. The Target VI does not reference the on-board LEDs directly, but it is where the Case Structure's case is obtained from.

 

I am sure that this is a simple issue with my code, but does someone here know why my read values (of 0, 1, 2, 3, or 4) do not change affect the LEDs? The LED code shown is within a Timed Loop. Altogether, it is a myRIO RT VI.

 

- Best regards, ExactPlace441

0 Kudos
Message 1 of 6
(1,470 Views)

Please don't attach pictures of pieces of LabVIEW code.  If you had attached a small myRIO Project that we could try to run on our hardware and see what it was doing, we could, perhaps, understand the concepts you missed and explain them to you, so you could learn and avoid these mistakes in the future.  Or less maybe (??) you found a Bug in the myRIO hardware, and we could confirm it for you.

 

But not without LabVIEW Code that we can compile and test for ourselves!

 

Bob Schor

0 Kudos
Message 2 of 6
(1,420 Views)

Hello Bob,

 

You're right about me needing to attach a project file. "FPGAmyRIO_Ultrasound_v2.vi" is the FPGA Target VI, while "RT UltrasoundMain.vi" is the RT Host vi. I do not believe that the other 2 attached files are necessary, but they are there just in case. However, I was having trouble with attaching the project file, so I have included individual vi files along with a link to a Google Drive of the project as a whole.

 

Link to Google Drive: https://drive.google.com/drive/folders/1KBD77C8uV_SqWjxCUznQmsa3DeSj17ip?usp=sharing

Please see the "Used Project file, RT Host, and FPGA Target vi's" subfolder for the vi's used for the project.

 

For wiring, I am using an HC-SR04 ultrasonic sensor.  For pins, ConnectorA/DIO8 goes to the HC-SR04's Echo, while ConnectorA/DIO9 goes to the sensor's Trig. The GND and Vcc are connected to ConnectorA pins 1 and 12, respectively.

 

As for the issue that I stated about the LED being dimmed after compilation, I haven't had that happen again, so it may have just been a coincidence when it did happen. However, the On-Board LED's aren't activating as desired.

 

There is also an external LED that I would like to eventually dim by changing it's power's Duty Cycle, and that pin is B/PWM0 (Pin 27). However, I can look into this at a later date.

 

- Thank you, ExactPlace441

 

0 Kudos
Message 3 of 6
(1,385 Views)

Hi ExactPlace,

 


@ExactPlace441 wrote:

However, I was having trouble with attaching the project file, so I have included individual vi files along with a link to a Google Drive of the project as a whole.


Have you ever thought about ZIPping the project folder and attaching a single ZIP file?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(1,381 Views)

Your Ultrasound Project is in a "Project".  There is a folder with (I hope) most of the VIs you've written, including the FPGA code, and a Project File that you double-click to "open the Project".

 

Find that folder,  Right-click and from the Drop-down menu, choose "Send to" and choose "Compressed (zipped) Folder".  Attach that folder.

 

Are there any special drivers that you need for your ultrasound device?  Attach some information about this, as well, please.

 

The isolated files you attached are not helpful to me.  I don't plan to open an unknown Google Drive.

 

Bob Schor

0 Kudos
Message 5 of 6
(1,364 Views)

That's fair, I understand. Here is an attached Zip file of the project. 

 

There are no special drivers or software for the ultrasound device. All is done on a myRIO RT Host with an FPGA Target. The used RT Host palettes are "FPGA Interface" and "myRIO". The Target FPGA palettes involve "FPGA I/O" and "Data Storage & Transfer".

 

"RT UltrasoundMain.vi" is the host vi, while "FPGAmyRIO_Ultrasound_v2.vi" is the target vi. The "PC_Ultrasound.vi" under "My Computer" is not used.

0 Kudos
Message 6 of 6
(1,322 Views)