<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to memory violation exception when Calling FB method from another FB method</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/41215599ce/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/41215599ce/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/41215599ce/</id><updated>2020-02-27T14:03:35.327000Z</updated><subtitle>Recent posts to memory violation exception when Calling FB method from another FB method</subtitle><entry><title>memory violation exception when Calling FB method from another FB method</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/41215599ce/?limit=25#9c8d" rel="alternate"/><published>2020-02-27T14:03:35.327000Z</published><updated>2020-02-27T14:03:35.327000Z</updated><author><name>dFx</name><uri>https://forge.codesys.com/u/dfx/</uri></author><id>https://forge.codesys.com8d10d301b8ace334364c0548f399300d57a0a416</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Did you tried to just clean and rebuild all ? Pointers can be corrupted with online/partial edit&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>memory violation exception when Calling FB method from another FB method</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/41215599ce/?limit=100#22fc" rel="alternate"/><published>2020-02-27T14:03:34.420000Z</published><updated>2020-02-27T14:03:34.420000Z</updated><author><name>aliazzz</name><uri>https://forge.codesys.com/u/aliazzz/</uri></author><id>https://forge.codesys.com895f0d8b3f6efba191fe276e2fcb18af3bb9532e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;LOL (slaps his own head)  &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>memory violation exception when Calling FB method from another FB method</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/41215599ce/?limit=25#e511" rel="alternate"/><published>2020-02-27T14:03:34.143000Z</published><updated>2020-02-27T14:03:34.143000Z</updated><author><name>penngolliwog</name><uri>https://forge.codesys.com/u/penngolliwog/</uri></author><id>https://forge.codesys.comf3cb66d277c00a03df8164bb4fdcecde6690171a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Aliazzz, I'm using Codesys V3.5 SP13 Patch 1.  "Machine automation platform" is the name of the project.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>memory violation exception when Calling FB method from another FB method</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/41215599ce/?limit=25#aa9e" rel="alternate"/><published>2020-02-27T14:03:33.865000Z</published><updated>2020-02-27T14:03:33.865000Z</updated><author><name>josepmariarams</name><uri>https://forge.codesys.com/u/josepmariarams/</uri></author><id>https://forge.codesys.com96d160070d2d532df659ea4c818f09a11036847c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Have you try to change the name of compile?&lt;/p&gt;
&lt;p&gt;Sent from my Moto G (5S) Plus using Tapatalk&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>memory violation exception when Calling FB method from another FB method</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/41215599ce/?limit=100#7c7e" rel="alternate"/><published>2020-02-27T14:03:33.589000Z</published><updated>2020-02-27T14:03:33.589000Z</updated><author><name>aliazzz</name><uri>https://forge.codesys.com/u/aliazzz/</uri></author><id>https://forge.codesys.combdb8a56f0a3a847fc77ea2c412a684ad6c7ea1d0</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi, just a small question off topic question out of sheer curiosity, what flavour of IDE are you using? (....e Automation Platform)&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>memory violation exception when Calling FB method from another FB method</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/41215599ce/?limit=25#5bbe" rel="alternate"/><published>2020-02-27T14:03:32.760000Z</published><updated>2020-02-27T14:03:32.760000Z</updated><author><name>penngolliwog</name><uri>https://forge.codesys.com/u/penngolliwog/</uri></author><id>https://forge.codesys.com82b3b9d6fa2997cbad19b339ad8df9fa7686501c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;So it turned out to be an issue with the UDT_DIs that was being passed to the Insert_Input method (even though the test program was doing the same thing.....).  I worked around the problem by copying the UDT_DIs structure to a temporary UDT_DIs, passing this, then copying the temporary UDT_DIs back to the original (with Codesys.... sometimes you need to tell yourself it was a bad dream and move on....)&lt;/p&gt;
&lt;p&gt;Just to reiterate, you &lt;em&gt;can&lt;/em&gt; do the method call I showed in the original post; I don't believe there is any fundamental issue with it.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>memory violation exception when Calling FB method from another FB method</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/41215599ce/?limit=25#1930" rel="alternate"/><published>2020-02-27T14:03:32.489000Z</published><updated>2020-02-27T14:03:32.489000Z</updated><author><name>penngolliwog</name><uri>https://forge.codesys.com/u/penngolliwog/</uri></author><id>https://forge.codesys.com04c3051512f30b3542f59a7e6f96f468220e182a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi rickj,&lt;br/&gt;
Thankyou for your reply.  Yes you're right - one must take care with IN_OUT.  Unfortunately this is not my particular problem:&lt;br/&gt;
I have exported the FB and imported it into a blank project, and it works fine, even with apparently all external conditions the same.  Maybe it's project corruption, but I have already done clean all/rebuild.  Might need to rebuild the project from scratch using export/import.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>memory violation exception when Calling FB method from another FB method</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/41215599ce/?limit=25#d6de" rel="alternate"/><published>2020-02-27T14:03:32.209000Z</published><updated>2020-02-27T14:03:32.209000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.com50ebfab649e1ab78b19048489d4ee727884bcfcc</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;Originally created by:&lt;/em&gt; rickj&lt;/p&gt;
&lt;p&gt;I think the problem is with your Data/IN_OUT parameter.   Under the hood, IN_OUT parameters are essentially pointers so you must declare an instance of UDT_DIs somewhere and then pass that instance to your methods.  &lt;/p&gt;
&lt;p&gt;If you define Data in the main body of your function block, it will be defined in and accessible from all methods.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>memory violation exception when Calling FB method from another FB method</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/41215599ce/?limit=25#8ee8" rel="alternate"/><published>2020-02-27T14:03:31.929000Z</published><updated>2020-02-27T14:03:31.929000Z</updated><author><name>penngolliwog</name><uri>https://forge.codesys.com/u/penngolliwog/</uri></author><id>https://forge.codesys.com724672b9b08f33276f9f5921468f09da133ba4f3</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I have the Compile and Insert_Input methods of a function block, and they both take as input a VAR_IN_OUT of type UDT_DIs:&lt;/p&gt;
&lt;p&gt;Both methods work fine by themselves, but after adding a line to Insert_Input to call Compile, there is a program exception as shown.&lt;/p&gt;
&lt;p&gt;I've read through the documentation on methods.&lt;br/&gt;
I've tried to use THIS^.xxxx&lt;br/&gt;
I've tried to assign Data to a temporary local variable and passing this to the Compile method.&lt;br/&gt;
What am I doing wrong?&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: Compile method.PNG" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=4059"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: insert_input method " rel="nofollow" src="https://forum.codesys.com//download/file.php?id=4060"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: errors.PNG" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=4061"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>