LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event Structure to Encode Arrow Keys not working on MyRIO

I have the following code which works fine when I have it operating outside of the myrio, but once I put it into the myrio it will not work. If anyone has any hints I would appreciate it. I'm not sure if it has something to do specifically with the MyRIO? Any help would be appreciated.

 

 

0 Kudos
Message 1 of 9
(4,827 Views)

I did not get myRIO yet, but your code is full of race conditions. Why don't you place the indicators after the event structure and eliminate all the local variables?

 

(Not sure how key events work if the code runs on myRIO since myRIO has no keyboard)

0 Kudos
Message 2 of 9
(4,812 Views)

@altenbach wrote:

Why don't you place the indicators after the event structure and eliminate all the local variables?


Here's what I had in mind. Keep it simple!

 

(NOTE: This is general programming advice, and might not solve your myRIO issue).

0 Kudos
Message 3 of 9
(4,804 Views)

I appreciate the rapid response! Yet I tried implementing the code and again it works when not being interface with the MyRIO but as soon as I load it into the project it and deploy it onto the MyRIO it will no longer properly interface. However fixing the race conditions should help down the road as it now is all off at the start which will help not damage the motors I will ideally run when this keyboard mapping starts to work.

 

Thanks!

 

0 Kudos
Message 4 of 9
(4,801 Views)

Event structures dont fully work on real time targets because the front panel executes on the host while the block diagram executes on the real time system:
http://digital.ni.com/public.nsf/allkb/42B70D2D0C4B568586256E2F0051441D

Craig H. | CLA CTA CLED | Applications Engineer | NI Employee 2012-2023
Message 5 of 9
(4,768 Views)

Hi, 

Thank you for the response. I am curious, but will the usereventinRT.vi work to "create" an event structure in RT? I'm new to creating VI's in real time so any help would be appreciated! Thanks again!

0 Kudos
Message 6 of 9
(4,756 Views)

Hi, 

 

Did you managed to find a workaround for your problem?

 

Thanks

0 Kudos
Message 7 of 9
(4,375 Views)

If you must use events, you'll want to create a host vi that can run on your PC and send messages to the RT side of the myRIO.  It's not a workaround.  It's how you're meant to do it.

Message 8 of 9
(4,339 Views)

The reason you can have event structures on RT targets is because you can create/use user events in an RT application. Any event that's based around front panel events or controls/indicators won't function on the RT target (because when it's running on the RT target, there is no user interface).


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 9 of 9
(4,279 Views)