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 Wed Nov 21, 2018 7:29 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Tue Oct 09, 2018 5:50 pm 
Offline

Joined: Tue Sep 12, 2017 9:37 am
Posts: 73
hello:

There is some way to extract the name of a function block (from it) to a variable in the same FB.

I do not know if I explained myself very well

Best regards


Top
   
PostPosted: Wed Oct 10, 2018 7:27 am 
Offline
Frequent User
Frequent User

Joined: Wed May 04, 2016 6:00 pm
Posts: 258
Try

{Attribute 'parameterstringof'}

Sent from my Moto G (5S) Plus using Tapatalk


Top
   
PostPosted: Wed Oct 10, 2018 10:14 am 
Offline

Joined: Tue Sep 12, 2017 9:37 am
Posts: 73
hello:

Thanks for request, you can write a example to show me some example of the use of that attribute, I do not find any example or help on how to use it.



Best Regards,


Top
   
PostPosted: Wed Oct 10, 2018 10:34 am 
Offline
Frequent User
Frequent User

Joined: Wed May 04, 2016 6:00 pm
Posts: 258
Example:


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


Top
   
PostPosted: Wed Oct 10, 2018 10:36 am 
Offline
Frequent User
Frequent User

Joined: Wed May 04, 2016 6:00 pm
Posts: 258
The attribute is instance-path and noInit not parameterstringof aI am sorry.

Is mandatory add both attributes: noInit and instance-path

Salut!


Top
   
PostPosted: Wed Oct 10, 2018 1:27 pm 
Offline

Joined: Tue Sep 12, 2017 9:37 am
Posts: 73
very thanks,

I have created a function block to see how it works with the following code.
FUNCTION_BLOCK POU_1
VAR_INPUT
in1: BOOL;
in2: BOOL;
END_VAR
VAR_OUTPUT
out1: BOOL;
END_VAR
VAR
{attribute 'symbol' := 'none'}
{attribute 'hide'}
{attribute 'instance-path'}
{attribute 'noinit'}
FbName : STRING(255);
END_VAR


if I run that FB in a plc the variable FB_name nor see it.


BR


Top
   
PostPosted: Wed Oct 10, 2018 8:46 pm 
Offline
Frequent User
Frequent User

Joined: Wed May 04, 2016 6:00 pm
Posts: 258
You need another attribute, reflection

https://help.codesys.com/webapp/_cds_pr ... n=3.5.13.0

Sent from my Moto G (5S) Plus using Tapatalk


Top
   
PostPosted: Thu Oct 11, 2018 8:34 am 
Offline

Joined: Tue Sep 12, 2017 9:37 am
Posts: 73
very thanks :)


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

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 3 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