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 Sat Dec 07, 2019 5:24 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Tue Nov 05, 2019 9:56 pm 
Offline

Joined: Mon Oct 14, 2019 2:29 pm
Posts: 2
Hi!

I'm trying to figure out if there's any way to instantiate variable comments in Twincat 3. As seen in my example below i have created two variables of the same type. They don't have the same purpose though (one is for showing temperature and the other one is for pressure).

I would like to have individual description of the two instances output in an ads (preferred) or opc ua list.

I have seen the opc ua attribute below but i don't think it's possible to change a description of a variable inside a functionblock?

Quote:
Data Access (DA)
{attribute 'OPC.UA.DA.Description' := 'x'}
Name: OPC.UA.DA.Description
Value: see right column
Sets a text for the OPC UA attribute "Description".

https://infosys.beckhoff.com/english.ph ... 1.html&id=

Any of you who have an idea?

Best Regards Optimizer3000 :)


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


Top
   
PostPosted: Fri Nov 08, 2019 8:35 am 
Offline
Frequent User
Frequent User

Joined: Fri Feb 23, 2018 3:41 pm
Posts: 172
just declare your instance with a comment

Code:
VAR
Temperature: fbFunctionBlock; // This is pressure
Pressure: fbFunctionBlock; // This is pressure
END_VAR


Top
   
PostPosted: Sat Nov 09, 2019 7:18 pm 
Offline

Joined: Mon Oct 14, 2019 2:29 pm
Posts: 2
dFx wrote:
just declare your instance with a comment

Code:
VAR
Temperature: fbFunctionBlock; // This is pressure
Pressure: fbFunctionBlock; // This is pressure
END_VAR
Hi!

Thanks for your answer!

I want to have an individual comment of "rOutput" of each instance, not a comment of the instances of the functionblocks it self. I'm going to put information like description, unit, format and so on and use it to generate a CSV-taglist for a scada-system.

One "solution" that i'm using today is to make functionblock for pressure and one for temperature, but since the logic is identical it feels stubbornly to create multiple functionblocks just to hold a comment...

Best Regards Optimizer3000 :)


Top
   
PostPosted: Tue Nov 12, 2019 9:02 am 
Offline
Frequent User
Frequent User

Joined: Fri Feb 23, 2018 3:41 pm
Posts: 172
This is the point of hierarchical comments.
If you correctly declare your variables inside namespaces / GVLs / FBs, you can trace the functionnal description of your tag, using each level description.


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

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 4 guests


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