<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Using properties for Struct access.</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/6c4ac73d34/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/6c4ac73d34/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/6c4ac73d34/</id><updated>2020-04-22T16:54:10.262000Z</updated><subtitle>Recent posts to Using properties for Struct access.</subtitle><entry><title>Using properties for Struct access.</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/6c4ac73d34/?limit=25#b743" rel="alternate"/><published>2020-04-22T16:54:10.262000Z</published><updated>2020-04-22T16:54:10.262000Z</updated><author><name>Comingback4u</name><uri>https://forge.codesys.com/u/comingback4u/</uri></author><id>https://forge.codesys.comc07320ab82bcfc348e159960879a1e78f705cfc7</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I guess I need to learn why you have to use REFERENCE TO ROBOT_STATUS instead of just setting the type to ROBOT_STATUS. For example the attached picture works for me.&lt;/p&gt;
&lt;p&gt;Since I don't know why you are stuck using "REF" just a thought of something else you could do. What if you created a copy of I_robotStatus(Internal) like E_robotStatus(External) where E_robotStatus gets updated inside the FB and E_robotStatus is referenced for your property call. Then you can isolate I_robotStatus from any external calls so that if they change E_robotStatus, those changes get overwritten by the internal I_robotStatus.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Using properties for Struct access.</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/6c4ac73d34/?limit=25#412d" rel="alternate"/><published>2020-04-22T07:28:05.828000Z</published><updated>2020-04-22T07:28:05.828000Z</updated><author><name>raml</name><uri>https://forge.codesys.com/u/ramol/</uri></author><id>https://forge.codesys.coma7c1958e314462c382b4bc8dbd8e20510e080eb2</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thank you very much for your quick response!&lt;br/&gt;
Well, for not creating a property for each field of my Structs, I am using the property to access the complete struct.&lt;br/&gt;
E.g. &lt;/p&gt;
&lt;p&gt;PROPERTY robotStatus : REFERENCE TO SL_ROBOT_CONTROL&lt;/p&gt;
&lt;p&gt;Get property becomes:&lt;/p&gt;
&lt;p&gt;robotStatus REF= l_robotStatus;&lt;/p&gt;
&lt;p&gt;Where l_robotStatus is the local struct declared in the FB.&lt;/p&gt;
&lt;p&gt;So even if I declare only the Get property, when from external I access the robotStatus property I can also change the data cause as far as I have understood is a REF property, so basically it's a pointer.&lt;br/&gt;
For safety and for reducing error situations for some structs I would like to declare the property REF= as only read.&lt;br/&gt;
Maybe there are other ways to access an entire struct of a FB from an external FB.&lt;/p&gt;
&lt;p&gt;Thank you very much.&lt;br/&gt;
Best regards.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Using properties for Struct access.</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/6c4ac73d34/?limit=25#ee63" rel="alternate"/><published>2020-04-21T16:00:26.434000Z</published><updated>2020-04-21T16:00:26.434000Z</updated><author><name>Comingback4u</name><uri>https://forge.codesys.com/u/comingback4u/</uri></author><id>https://forge.codesys.come465907b28bbbf9a07a18376c91334c67f0847f6</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Maybe I don't understand the question but can you just add a property to the functionblock and delete the "set" property. I'm not sure why "REF=" is needed so might not be understanding the question.&lt;br/&gt;
&lt;img src="./attachment/Capture.PNG" width="50%"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Using properties for Struct access.</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/6c4ac73d34/?limit=25#7375" rel="alternate"/><published>2020-04-21T15:41:42.042000Z</published><updated>2020-04-21T15:41:42.042000Z</updated><author><name>raml</name><uri>https://forge.codesys.com/u/ramol/</uri></author><id>https://forge.codesys.com651eec78f00927a4404e13f3f0968dc2f6ebe305</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi everybody,&lt;/p&gt;
&lt;p&gt;I need to access few Struct data declared in one FB. Under these helpful forums I found the way to declare the GET method (using REF=). But I haven't found this thing: if I want to allow just the read of a struct is there a way to do it? Using the REF= declaration then from the extern I can also change the data in the struct.&lt;br/&gt;
Thank you very much.&lt;br/&gt;
Best regards.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>