S7-1500 and temporary variables - strange behavior

Doomsword,

Based on the screenshot tmp.png, I can see that the FC is set for "standard access", ie not optimized. This means that the temp tags are using absolute addresses just like they would have in the 300's, and the local memory is not initialized.

Best practice is to make sure you write to your temp tags before you read them. That can be a pain to fix, so it may be easier to just clear out the data. You have two options for initializing your temp tags:

1) Switch to optimized, which will initialize the tags for you, but could potentially affect your program's execution. 75% of the time, when I see standard code in a 1500, it is because it was migrated from a 300, and things COULD be optimized, but no one went and changed the settings in each block. The other 25% of the time, there is a reason the code is standard access.

2) Clear out your temp memory at the beginning of each block. Doing a Fill of 0 into everything could work, but I'm not sure how that would affect your REALs.


Do you know if optimized blocks can be read from HMI? I see there's option in HMI (we use legacy for compatibility with older stuff), but has this been tested?
We had a lot of issues with 1500s, I think it's mostly because we tried to program it as 400, and another being compatibility with technological packages software on PCs which are also part of automation in my company.
 
Do you know if optimized blocks can be read from HMI? I see there's option in HMI (we use legacy for compatibility with older stuff), but has this been tested?
We had a lot of issues with 1500s, I think it's mostly because we tried to program it as 400, and another being compatibility with technological packages software on PCs which are also part of automation in my company.

The current panels can definitely handle optimized stuff, but if you're still using MP277's or something 3rd party, then you would probably need to keep any DB's accessed by the HMI

Same goes for PC packages, if they communicate via put/get type mechanisms.

It is possible to use optimized in some parts of the PLC, and standard in others, but there is a fair bit of overhead when passing data from one style to the other via pointers. Sometimes it ends up being simpler to keep everything the same. Note that individual DBs, FBs, FCs, and OBs each have an optimized access checkbox, so you can get pretty specific if you want to. If the HMI code and data is separate from the, leaving that standard and optimizing the rest could make sense. If it is all mixed together, then might be less headache to leave it all standard.
 

Similar Topics

I have been working on this for a while now and I can't seem to get it. I was finally able to view the 1500 on the PanelView under the serial...
Replies
1
Views
32
Hello, I have a 1764 1500 LSP Series A that keeps failing with DTL_E_FAIL I/O error. Searching around it seems there's a weird issue specifically...
Replies
2
Views
98
Hi all Trying to remotely connect to a TIA Portal PLC. I can ping it without a problem but can't get my software to connect. I've opened port...
Replies
8
Views
317
Been fighting all morning with a stubborn HMI. It just won´t connect with the plc. attaching from settings. Have i missed anything? Both plc and...
Replies
5
Views
283
Hi there, Maybe I am overthinking this issue, but here is what I have going on. I have a program running for a water valve on a DI system. We...
Replies
4
Views
443
Back
Top Bottom