rscott9399 Posted May 6, 2019 Report Share Posted May 6, 2019 Hi all Trying to use a network published variable to control the event structure of something in an RT loop of a rio project. When i try and add an event, it wont let me have access to that variable. Any ideas? Maybe create a local variable? Quote Link to comment
Jordan Kuehn Posted May 6, 2019 Report Share Posted May 6, 2019 If you have the DSC module this may be what you are looking for. https://forums.ni.com/t5/Example-Programs/Creating-a-Value-Change-Event-for-Shared-Variables/ta-p/3528947?profile.language=en Quote Link to comment
smithd Posted May 7, 2019 Report Share Posted May 7, 2019 13 hours ago, rscott9399 said: Hi all Trying to use a network published variable to control the event structure of something in an RT loop of a rio project. When i try and add an event, it wont let me have access to that variable. Any ideas? Maybe create a local variable? Generally RT code doesn't have a UI, and as mentioned you have to use a special add-on to use events with shared variables. The usual equivalent is to use a messaging tool to handle communication and generate events in your RT code. I personally use HTTP and/or websockets since its free and there are many clients out there. I believe there is a tcp handler for drjdp's messenger lib (https://sine.ni.com/nips/cds/view/p/lang/en/nid/213091), actor framework has a networking addon, and for quick and dirty, AMC (https://www.ni.com/example/31091/en/) works. To put it another way, where you might use a UI event (queue) structure on a windows machine, you would typically use asynchronous I/O (eg tcp, udp, serial) to feed a queue on the rt system. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.