03-16-2014 03:29 PM
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.
03-16-2014 04:02 PM
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)
03-16-2014 04:16 PM - edited 03-16-2014 04:17 PM
@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).
03-16-2014 04:25 PM
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!
03-16-2014 09:42 PM - edited 03-16-2014 09:44 PM
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
03-16-2014 10:01 PM
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!
07-05-2015 05:54 AM
Hi,
Did you managed to find a workaround for your problem?
Thanks
07-05-2015 09:44 AM
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.
07-06-2015 04:34 AM
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).