How to get value from components in CONPROSYS HMI

More
2 months 3 weeks ago #48 by Tom_Contec
I want to get value from Slider or Text Input component and change Lamp status according to the value.

Please Log in or Create an account to join the conversation.

More
2 months 3 weeks ago #49 by Tom_Contec
You need to make Java Script for Lamp component to change status according to the value.

Example:
If the value of Slider is larger than 50, change Lamp status to ON. Otherwise Lamp status to OFF.
  1. Put Lamp and Slider components to cambas
  2. Add Java Script to Lamp component
  3. Specify the id of Slider component to first parameter of getProp.



value = $getProp("Layer0.SliderH.0","value");
if(value >= 50){
  this.setValue(true);
}
else{
  this.setValue(false);
}

Attachments:

Please Log in or Create an account to join the conversation.

Time to create page: 0.146 seconds
Powered by Kunena Forum