I would like to have a control panel using systemlink. The panel would control a cRIO 9030 that is running a real time application.
This panel should have for example a button for starting the operation in automatic mode, one for stopping it and two more buttons that control the direction of movement of some motors.
What I am wondering is, how can I manage the activation of a control in the real time target?
I imagining having trouble timing out the controls from the dashboards and the reaction from the rt controller.
Say one clicks the "start" button in the dashboard, (There is only see the switch option in the dashboard).
If the switch stays true (pressed on click ):
- the rt will read this value as true as long as the control is true (could cause trouble). How can the controller reset the variable?
If the switch is a "press and release" switch:
- How often should the RT read the tag in order to acknowledge that the tag was pressed? or
-How long would the tag be active when the switch is pressed?
Are there any other ways of doing this?
Solved! Go to Solution.
The SystemLink Dashboards are not intended to be used to control RT targets and some of the challenges that you are facing are a result of this. Your use case may be better suited for using a Web VI because you'll be able to incorporate more logic behind the UI. Additionally, you will more likely have more customization with how the different controls can be interacted with. That being said, there may be things that you can do to achieve what you are looking for.
In order to get your cRIO and SystemLink communicating with one another, the cRIO has to be running an application. I don't see a good way of using the SystemLink Dashboards to start an RT executable and any action that you want to "start" will have to be triggered by writing to a tag value. You could have your RT target monitoring a specific tag value looking for a value that would indicate that it should kick off a specific routine. When the RT target sees the value meet a specific criteria, it could reset the value and then kick off the routine. You would then do the same thing for any of the other actions you wanted the cRIO to follow. To make this work, you're going to have to build your cRIO RT application around these criteria to make it work.
Because SystemLink isn't intended for controlling systems' execution (start, stop, pause, etc.), there aren't native features that would offer this functionality. However, you may be able to set up tags and use their values to create the behavior you are looking for.
I'll add one thing to Brandon's post, which is absolutely correct.
SystemLink messages, rather than tags, are the API intended to be used for command/control scenarios like the one you are describing. Messages are essentially a network queue and can be used in a similar fashion as dequeuing commands as is common in the Queue Message Handler pattern. Additionally the broadcast(-like) nature of message can allow you to scale to 100s of cRIOs receiving and reacting to commands sent through the message API.
Long story short, use the Message API for command and configuration. Using the Tag API when's publishing measurement data.