Good morning, how can I externalize the background property of a component kit when a digital signal changes?
I’d like to change the background of a button created as a component kit when a digital signal changes.
Thank you very much.
Good morning, how can I externalize the background property of a component kit when a digital signal changes?
I’d like to change the background of a button created as a component kit when a digital signal changes.
Thank you very much.
Hello,
To control the style or properties of a component in the Custom Component Kit, you can use the “Add Property” feature in AppStudio. It lets you expose a subcomponent’s properties as properties of the custom component.
this: for example: this.bt1_background_color = 'red';
setTimeout(async () => {
API.SIGNALMONITOR.monitorSignal(
{ type: "digitalsignal", name: "ACOK", network: "EtherNetIP", device: "ABB_Scalable_IO" }, // To use the signal you defined
(v) => {
try {
if (Number(v) === 0) {
this.bt1_background_color = 'red';
} else {
this.bt1_background_color = 'yellow';
}
} catch (e) {
Logger.e("Test Sub-Signal fail:", e)
}
}
)
}, 0)