svego Posted September 27, 2015 Share Posted September 27, 2015 Hi, simple question but I didn't find answer... How can I change LED symbol to be green if digital input_1 is true, and red when is false... ? example component name is: LED_channel_1 active color is green inactive color is red THX Link to comment Share on other sites More sharing options...
AzeoTech Posted September 28, 2015 Share Posted September 28, 2015 Do you mean an LED component, or a symbol component with a picture of a green LED and one red LED? Link to comment Share on other sites More sharing options...
svego Posted September 29, 2015 Author Share Posted September 29, 2015 well, both examples please.... LED component, right click -> Displays -> LED round.... or how to change color on button eg from gray to green ( relay on/off) ??? also picture how to change c:\picture1.gif ( channel1=0 ) to c:\picture2.gif if channel1=1 Link to comment Share on other sites More sharing options...
AzeoTech Posted September 29, 2015 Share Posted September 29, 2015 You can change the color of the LED component for off/on by simply clicking on the active color or inactive color boxes in the components properties. Active is when the expression evaluates to non-zero, inactive when it evaluates to zero. A button is a little trickier, here you would have to name the button (select, the right click and select Component Name...), then, probably in the Event for the relay channel, put: component.myButton.backColor = iif(relayChannel[0], RGB(0,255,0), RGB(255,0,0)) That will set the background color of the button to green if relayChannel is non-zero and red if zero. As for the picture, use the symbol component. Create two rows in the symbol component, one with threshold = 0, the other with threshold = 1. Then paste the appropriate picture for each. Link to comment Share on other sites More sharing options...
svego Posted September 30, 2015 Author Share Posted September 30, 2015 Hi, THX, it works..but 3rd option is not working as you suggested..( using custom picture, like digital1=red_polygon.jpeg else blue_polygon.jpeg right click -> display -> Symbol.... tried to copy-paste bitmap, jpeg but nothing happened Link to comment Share on other sites More sharing options...
AzeoTech Posted September 30, 2015 Share Posted September 30, 2015 Open the symbol component properties, then hit Add twice. Change the threshold on one of the rows to 1. Then copy the image you want out of your Paint program, then double click in the Symbol column for the row you want. That will paste it. Link to comment Share on other sites More sharing options...
svego Posted October 1, 2015 Author Share Posted October 1, 2015 THX, it works..... :-) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.