<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Access violation exception related to struct and FB_INIT</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/9b3d509bc7/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Runtime/thread/9b3d509bc7/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Runtime/thread/9b3d509bc7/</id><updated>2020-02-27T17:39:42.158000Z</updated><subtitle>Recent posts to Access violation exception related to struct and FB_INIT</subtitle><entry><title>Access violation exception related to struct and FB_INIT</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/9b3d509bc7/?limit=25#359c" rel="alternate"/><published>2020-02-27T17:39:42.158000Z</published><updated>2020-02-27T17:39:42.158000Z</updated><author><name>beachcabana</name><uri>https://forge.codesys.com/u/beachcabana/</uri></author><id>https://forge.codesys.com30dd8ade48dfcaa9a4a33ce6c1baf120fce2587e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hey, there!&lt;/p&gt;
&lt;p&gt;I'm getting an access violation exception related to the struct "WHEEL_VELOCITIES". This DUT is used in the definition of a new struct, which is used in a function block. The struct "WHEEL_VELOCITIES" is also used as the return type of a method from that same function block.&lt;/p&gt;
&lt;p&gt;What I find odd is that if I download the program to the Control Win Soft PLC, everything works well. It is only when I try to download to the beaglebone black (after updating the device) that I get this error. Also, if I remove the struct "WHEEL_VELOCITIES" from my code, Codesys still gives me the same error but regarding a different struct.&lt;/p&gt;
&lt;p&gt;I have not defined any FB_INIT method for any function block and, from what I understand, DUTs don't have a FB_INIT or any other method associated with them, right? Is codesys interpreting my struct as a function block?&lt;/p&gt;
&lt;p&gt;The error:&lt;br/&gt;
&lt;a class="" href="https://drive.google.com/drive/folders/1y5AFK2EZCUrh1scnktNZJvLMgSWup03P" rel="nofollow"&gt;https://drive.google.com/drive/folders/1y5AFK2EZCUrh1scnktNZJvLMgSWup03P&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thank you for your time,&lt;br/&gt;
Paulo&lt;/p&gt;
&lt;p&gt;UPDATE:&lt;br/&gt;
Got it working. I believe it had something to do with having set the attribute "{attribute 'pack_mode' := '0'}" in the struct and not in the sub struct. However that was not enough to correct the issue. I also had to remove the modbus slave I had associated with those variables, download and undo the removal.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>