I need LED (indicator) switched off at NO_ERROR and switched on at any other value.
What I tried already:
1. Set 'variable' field of standard lamp to ' myVar <> t_ECODE.NO_ERROR '
2. Put two images one on top of each other, one with LED on, second with LED off, set 'Invisible' field to ' myVar <> t_ECODE.NO_ERROR ', second to ' myVar = t_ECODE.NO_ERROR '
Any of these methods is not working, I get invalid referece error or other errors.
Is there any solution other than dedicated program that will evaluate booleans from ENUM variables? It will make my code very hard to use, as I then cannot pass whole structures to visualisations...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks! I checked that, and You are right, it's working, but only until t_ECODE is declared in project or library with not required qualified access.
If t_ECODE is declared in library with qualified access only, it's not working any longer... Can You check that? If Project Information in included library have property 'LanguageModelAttribute' with value 'qualified-access-only' it's not working any longer (always evaluated to FALSE).
I tried assigning to variable with and without library prefix:
PLC_PRG.myVar <> MyLib.t_ECODE.NO_ERROR
and
PLC_PRG.myVar <> t_ECODE.NO_ERROR
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I add in my library property LanguageModelAttribute with value qualified-access-only and I can use enums of library as part of expression in visu elements.
Seems like you get a bug which fixed in SP11:
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
Using Codesys V3.5 SP10 Patch 3+
It is possible to (and how to) use expression in 'invisible' or 'variable' field for Image/Frame on Visualisation?
What I want to do, is make LED (simple light indicator) connected to variable of custom type (ENUM) eg:
I need LED (indicator) switched off at NO_ERROR and switched on at any other value.
What I tried already:
1. Set 'variable' field of standard lamp to ' myVar <> t_ECODE.NO_ERROR '
2. Put two images one on top of each other, one with LED on, second with LED off, set 'Invisible' field to ' myVar <> t_ECODE.NO_ERROR ', second to ' myVar = t_ECODE.NO_ERROR '
Any of these methods is not working, I get invalid referece error or other errors.
Is there any solution other than dedicated program that will evaluate booleans from ENUM variables? It will make my code very hard to use, as I then cannot pass whole structures to visualisations...
Hi.
I use CODESYS V3.5 SP11 Patch 5 and it works for me.
Maybe you forgot about namespaces?
You should use it like:
PLC_PRG.myVar <> t_ECODE.NO_ERROR
Hi,
Thanks! I checked that, and You are right, it's working, but only until t_ECODE is declared in project or library with not required qualified access.
If t_ECODE is declared in library with qualified access only, it's not working any longer... Can You check that? If Project Information in included library have property 'LanguageModelAttribute' with value 'qualified-access-only' it's not working any longer (always evaluated to FALSE).
I tried assigning to variable with and without library prefix:
PLC_PRG.myVar <> MyLib.t_ECODE.NO_ERROR
and
PLC_PRG.myVar <> t_ECODE.NO_ERROR
Hi. I check it and it works for me.
I add in my library property LanguageModelAttribute with value qualified-access-only and I can use enums of library as part of expression in visu elements.
Seems like you get a bug which fixed in SP11:
Thank You,
We're switching to newest codesys in this case
Topic can be closed