<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Pointer</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/1d4a35340a/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/1d4a35340a/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/1d4a35340a/</id><updated>2021-04-19T11:50:46.971000Z</updated><subtitle>Recent posts to Pointer</subtitle><entry><title>Pointer</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/1d4a35340a/?limit=25#4939" rel="alternate"/><published>2021-04-19T11:50:46.971000Z</published><updated>2021-04-19T11:50:46.971000Z</updated><author><name>codesystart</name><uri>https://forge.codesys.com/u/jeetshah/</uri></author><id>https://forge.codesys.com6049c04e716c27ba6c9fc8582e841e67f4bda380</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Ok Thankyou for the info.&lt;/p&gt;
&lt;p&gt;I guess we cant really do type safety of pointers...&lt;/p&gt;
&lt;p&gt;The second part wont cause much issues. I think i can manage it in my code...&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Pointer</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/1d4a35340a/?limit=25#18ad" rel="alternate"/><published>2021-04-18T19:28:25.833000Z</published><updated>2021-04-18T19:28:25.833000Z</updated><author><name>i-campbell</name><uri>https://forge.codesys.com/u/i-campbell/</uri></author><id>https://forge.codesys.com94b633898c317112114452ca75b5569c8b15538f</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Type safety of pointer.&lt;br/&gt;
I do not know of a way to do that without changing the interface to, for example, REFERENCE TO ARRAY &lt;span&gt;[*]&lt;/span&gt; OF BYTE;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Incrementing POINTER TO ULINT.&lt;br/&gt;
Pointers are always to a byte address. So as you said, puliVar + 1 would now be pointing to a ULINT which overlaps the old one.&lt;br/&gt;
If you want to reference a ULINT which is 8bytes after your puliVar, you can use puliVar&lt;a class="alink" href="/forge/talk-ru/1/"&gt;[1]&lt;/a&gt;. The online help for pointer probably explains it more clearly &lt;a href="https://help.codesys.com/webapp/_cds_datatype_pointer;product=codesys;version=3.5.16.0" rel="nofollow"&gt;https://help.codesys.com/webapp/_cds_datatype_pointer;product=codesys;version=3.5.16.0&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;</summary></entry><entry><title>Pointer</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/1d4a35340a/?limit=25#3d25" rel="alternate"/><published>2021-04-18T17:32:50.827000Z</published><updated>2021-04-18T17:32:50.827000Z</updated><author><name>codesystart</name><uri>https://forge.codesys.com/u/jeetshah/</uri></author><id>https://forge.codesys.come4c5a91bf84ea5e5b47f6f6bad5f23a1cbfca732</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;I have a Interface Method defined with following inputs.&lt;br/&gt;
VAR_INPUT&lt;br/&gt;
    //receive buffer&lt;br/&gt;
    pbyRxBuffer : POINTER TO BYTE;&lt;br/&gt;
    //size of the receive buffer&lt;br/&gt;
    udiRxBufferSize : UDINT;&lt;br/&gt;
END_VAR&lt;/p&gt;
&lt;p&gt;For eg: If i get udiRxBufferSize = 10, then i copy 10 bytes through pointers&lt;/p&gt;
&lt;p&gt;Now I am relying on udiRxBufferSize for the actual size of buffer. but what if i get a wrong input from user?? He says 10 bytes, but doesnt actually provide the required size.&lt;/p&gt;
&lt;p&gt;Can i somehow check the size of actual variable which is provided in pbyRxBuffer??&lt;/p&gt;
&lt;p&gt;Also, i have a query for adding pointers&lt;/p&gt;
&lt;p&gt;codesys always incrents 1 pointer by 1 byte only.(irrespective of whether it is defined as POINTER TO BYTE or POINTER TO ULINT)&lt;/p&gt;
&lt;p&gt;is my observation correct??&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>