FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
05-21-2024 09:21 AM
Hello,
i want to ask, if there is a way to start and stop the Live Mode of the Trend Widget with a Variable from an OPC UA Server. I have a boolean Variable in my plc project, that should stop the Live Mode when it is true.
Thanks for the answers
Solved! Go to Solution.
05-21-2024 11:00 AM
You can do this in this way:
1. You retrieve an instance of your IQ Trend widget, preferably using shmi.onReady (instead of shmi.ctrl below)
2. You subscribe to an item using the IO Manager (check our scripting demo for examples)
3. You do all of this in a LocalScript that you add to your HMI
const trendWidget = shmi.ctrl(".iq-trend");
if (trendWidget) {
if (trendWidget.isLive()) {
trendWidget.setLive(false);
} else {
trendWidget.setLive(true);
}
}