Problem with struct data in FC (Simatic)

userxyz

Member
Join Date
May 2002
Location
any
Posts
2,768
Hello,

I have an FC with follwing code in the beginning of the block:

Code:
     L     P##Membits
      LAR1  
      L     #MEM_AREA.MEMBITS
      T     W [AR1,P#0.0]

The struct MEM_AREA has 5 countintegers and then the MEMBITS word. When I delete this peace of code, the counterintegers don't give problems, but when the code is running, the counterintegers are messed up.

Untitled.jpg

How is this possible, that COUNT_VAL_1 gets messed up (overwritten with something) ?

Thanks,

Kind regards,
G
 
Found

Found,

I was loading an IN/OUT area in the adress register... i changed my code to this:

L #MEM_AREA.MEMBITS
T #TEMP_MEM_AREA

L P##Membits
LAR1
L #TEMP_MEM_AREA
T W [AR1,P#0.0]


Loading an In/OUT after the LAR1 messes up the AR1, didn't know that...

Regards,
G
 
Last edited:
It is the fact that you are accessing a parameter that has a structure, not that it is an IN/OUT.
 

Similar Topics

Hi, I have had problem with upgrading some projects from v16 to v18. I tried it on 3 diffrent computers. I want to post this so that anyone that...
Replies
3
Views
101
Hi, I am having a challenge installing a new drive ACS355-03E-44A0-4 as it keeps on displaying Fault code F00018 even when the load is not...
Replies
3
Views
125
I have an issue on my vessel, we have water tight door system created in China, company is no longer operating. We have 7 doors each with their...
Replies
3
Views
113
Hi all. Simple as simple can be, I don't understand what's happening. I'm toggling he OSR on, GX_LUB_PUMP1_LEAD should switch. It doesn't. The...
Replies
27
Views
643
Hi; In a cabinet of a machine, a Fatek PLC with an Ethernet communication card is working. In the same cabinet, there is a 1 kW inverter. When...
Replies
16
Views
489
Back
Top Bottom