Why move global data variable to temp?

Wilso

Member
Join Date
Nov 2012
Location
Newcastle
Posts
144
This has arisen while looking at another issue. I've found that a value from a HMI is written to a DB. Within one function they've taken that DB variable integer, written it to a temporary variable integer, then used that within the function. Why? The value isn't processed in any way that changes it, so why write it to the temp in the first place?
 
Is there the possibility that another DB is open during the access of the temp variable? Accessing DBx.DBWy will result in the currently open DB being DBx
 
Don't understand any part of that question.
If you want use any value for one DB you need to use
OPN DBxxx.
If you need other data from other DB, then you need to open other DB.
In STL you could only one time operate 2 DBs(shar DB and IDB), which you see as L DBBxxx or L DIBxxx.

So it's better to first copy these value which you will need to the Temp at begining of the block, if any value you would like to change then copy back to DB at the end of block.
 

Similar Topics

V 10.00.01 Patch 9 Looking for the best way to have two or more variations of the same global object. Say a pump with a valve and sometimes you...
Replies
2
Views
2,610
Hello everybody, for Siemens 1200 I have a question need help, Through HMI, I use absolute address tags MW100--MW500 to set their values. but in...
Replies
5
Views
2,369
Hi everyone, I am working with micro850, a proximity sensor (FOTEK, PL-05P) and a 3DOF serial arm robot. I use MC_MoveRelative to control the...
Replies
1
Views
56
So I'm pretty green when it comes to troubleshooting in the field so bear with me. We have a Danfoss valve that opens/closes from an analog output...
Replies
23
Views
951
Hi. This is pretty basic but I'm struggling to find an efficient solution. I have a float value of let say 666.555 that I want to move / split...
Replies
3
Views
201
Back
Top Bottom