CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum
Deutsche Version English version russian version 
It is currently Mon Aug 21, 2017 8:30 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Sat Nov 26, 2016 3:31 pm 
Offline

Joined: Mon Nov 01, 2010 4:30 pm
Posts: 52
Hi,

I want to achieve something very simple.
There is a rectangle in a visualization. I want to change the background(fill) color of that rectangle between white-grey-green-orange-red by modifying a variable value.

Acc. to Codesys help ( I use 3.5 sp7 patch 2) , this should be done by assigning a DWORD variable to Colorvariables/Normal State / Fill color and eventually to Colorvariables/Alarmstate / Fill color. DWORD should contain an RGB color in the form 16#00RRGGBB, so if it is, say, 16#0000FF00, the rectangle background should become green.
However, nothing like that happens - when I assign a variable to Colorvariables/.../Fill color - the element simply becomes invisible, no matter what the variable value is.

What am I missing?
Attached is a simple Control Win 3 project with one visu which shows the problem.

Thanks for any suggestions


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Sat Nov 26, 2016 5:40 pm 
Offline

Joined: Fri Jun 26, 2015 6:23 pm
Posts: 37
I have the same problem with 3.5 SP9 patch3...
When variable (GVL DWORD) is in "variable color": fill color disappear.


Top
   
PostPosted: Sat Nov 26, 2016 5:45 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 2059
Color variables
Applied for dynamic definitions for the color of the element via a project variable.
A color is defined by a hex number which is composed of Red/Green/Blue (RGB) components.
A project variable of type DWORD must be entered like prog1.dwFillColor.
The variable must define the color value in hexadecimal format.
 
To fill the complete DWORD, the first two digits after "16#" have to be set to zero: "16#00RRGGBB".
 
HIND to the first two digits:
00 is used when under Visualization Manager > Activate semi-transparent drawing is NOT active
FF, instead of 00, is used when under Visualization Manager > Activate semi-transparent drawing is active

BR
Edwin


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Sat Nov 26, 2016 5:49 pm 
Offline

Joined: Fri Jun 26, 2015 6:23 pm
Posts: 37
Thank you very much : it work well !
It must be had to help of codesys....


Top
   
PostPosted: Sat Nov 26, 2016 9:29 pm 
Offline

Joined: Mon Nov 01, 2010 4:30 pm
Posts: 52
Thanks a lot!
Replacing first 00 with FF did the trick. But even Sherlock Holmes will have a really hard time finding that :)
And to make it even harder, the help file explicitly states "The leading byte always is 16#00"

I think color should be set as 16#xxRRGGBB , and Codesys should set the leading byte depending on that transparency setting.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 5 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited