CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Sun Feb 17, 2019 10:52 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Tue Feb 12, 2019 12:05 pm 
Offline

Joined: Tue Feb 12, 2019 9:11 am
Posts: 3
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:

Code:
TYPE t_ECODE :
(
   NO_ERROR := 0,
   E_SUPPLY_FAULT,
   E_ANALOG_INPUT_FAULT
)BYTE;
END_TYPE


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...


Top
   
PostPosted: Wed Feb 13, 2019 6:58 am 
Offline
Frequent User
Frequent User

Joined: Thu Mar 17, 2016 1:24 pm
Posts: 128
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


Top
   
PostPosted: Thu Feb 14, 2019 11:55 am 
Offline

Joined: Tue Feb 12, 2019 9:11 am
Posts: 3
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


Top
   
PostPosted: Fri Feb 15, 2019 9:09 am 
Offline
Frequent User
Frequent User

Joined: Thu Mar 17, 2016 1:24 pm
Posts: 128
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:


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


Top
   
PostPosted: Fri Feb 15, 2019 5:09 pm 
Offline

Joined: Tue Feb 12, 2019 9:11 am
Posts: 3
Thank You,

We're switching to newest codesys in this case

Topic can be closed


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