06-12-2016 12:58 AM - edited 06-12-2016 01:00 AM
The attached code works if I'm trying to light up LEDs from the Boolean Pallate on the front panel. However, when I try the code with the myRIO LEDs, I get no response.
Any ideas for how I can get this to work? Also, is it possible to use numeric keypad inputs (ie, pressing a 1, 2, etc.)?
Press ctrl+e to see block diagram.
06-13-2016 04:18 AM
@richardj1701 wrote:The attached code works if I'm trying to light up LEDs from the Boolean Pallate on the front panel. However, when I try the code with the myRIO LEDs, I get no response.
Any ideas for how I can get this to work? Also, is it possible to use numeric keypad inputs (ie, pressing a 1, 2, etc.)?
Press ctrl+e to see block diagram.
Hi,
When ever you try to run a code using an hardware place a while loop to get real time response for the code. in your code you haven't placed a loop so when you run the code naturally it run once , either it waits for 1st user input or the timeout which ever occurs first.
Refer to this example on how to program. https://www.youtube.com/watch?v=SHJ-vu4jorU
Kudos Welcome 🙂
06-13-2016 04:38 PM
Hi SanthoshJoel,
Thanks for the reply! Unfortunately, this does not contribute to a solution. In the original code that I attached, the event structure is set to never time out by default (since I haven't specificed a wait time). Upon establishment of a while loop that encases the original code, it seems as though we never enter the event structure since pressing the specified keys don't yield any responses.
- Richard
06-13-2016 06:29 PM
Richard,
Ensure the front panel is selected when you make any keypresses. I have had no trouble getting it to respond to keypresses in a while loop, though I realize this is secondary to your issue. I would like to clarify my understanding. It sounds like when you wire boolean indicators to the button presses, they light up as you expect. When you wire the myRIO VI to them, you don't see the LEDs light as you would expect.
Could you open the myRIO VI by double-clicking it, click the tab called "View Code" and post a screenshot?
06-13-2016 11:04 PM - edited 06-13-2016 11:04 PM
Hi yea_likethecity,
Your understanding is spot on. Below is a screen shot of what I'm working with.
I've made sure that I was on the front panel before pressing any keys but, still, none of the onboard LEDS would light up.
Thanks,
Richard
06-13-2016 11:36 PM
@richardj1701 wrote:Hi SanthoshJoel,
Thanks for the reply! Unfortunately, this does not contribute to a solution. In the original code that I attached, the event structure is set to never time out by default (since I haven't specificed a wait time). Upon establishment of a while loop that encases the original code, it seems as though we never enter the event structure since pressing the specified keys don't yield any responses.
- Richard
Hi Richard,
Let me answer your questions.
Unfortunately, this does not contribute to a solution. In the original code that I attached, the event structure is set to never time out by default
You have set the event time out to default, so what happens it when ever you press a key the code run once and will stop. so if you want you want a output that glows an LED when ever a key is pressed you should have a loop/
Upon establishment of a while loop that encases the original code, it seems as though we never enter the event structure since pressing the specified keys don't yield any responses.
Its a basic programming fact that whenever you place a event structure inside a while loop you should create a case for exit button. If you dont create a value change for the exit button (as you did in your code placing it outside event) your Vi wont stop.
Also connect a timeout value of 10 to event structure.
And regarding the issue you are facing just check with the Myrio getting started wizard and check the LED's Are working properly.
The same code works fine here.