Step7 S7317 problem with a temp varibale

spook

Member
Join Date
Jul 2006
Location
Paris
Posts
5
Hello,

I met last week a problem with a temp variable in a FC. I changed the program since but i want to understand because other FC/FB uses temp variable.

In the same rung i write then load a tempreal value, and get different values, when i read values online.

Code:
      L     "DBWaterAir".SetPoint_LevelTeepolTank    80.0
      L     5.000000e+000                5.00
      -R    
      T     "TempReal"                    75.00

      U(    
      O     "DBWaterAir".TeepolRequest
      O(    
      L     "DBWaterAir".LevelTeepolTank_Pourcent    
      L     #TempReal                    26664 (something like this)
      <=R   
      )     
      )     
      U(    
      L     "DBWaterAir".LevelTeepolTank_Pourcent
      L     "DBWaterAir".SetPoint_LevelTeepolTank
      <R    
      )     
      =     "DBWaterAir".TeepolRequest
This temp real was used in an other rung in the same way, but it was ok. When i changed in the second rung the name of the tempreal, in the first rung, the load value wasn't the same??? then i had to change very fast the programm and delete the first tempreal value.

I don't use any L datas, and all temps (3) are real and transferd with real.

If anyone has an idea
Thanks
 
Last edited:
Maybe someone can understand what you write, but I cannot.
Also, is the code you have listed the "bad" code or the "good" code ?

If the listing is the complete code, then you are loading a temporary variable (#TempReal) without initialising it. That wont work.
 
Tx, it was actually this problem between local and memento variable.
Shame on me

Sorry for my bad english
 

Similar Topics

This is the first time I am working with Simatic Manager Step7 as I started my siemens journey with TIA which is pretty easy and do a lot of stuff...
Replies
3
Views
146
When you download a DB, the values get overwritten by what is in the "actual" column in offline DB. Does this happen at the start of the PLC...
Replies
6
Views
142
Hello Inside a FB, I´m trying to transfer a string from a DB to a IN_OUT var that was define as a UDT. The problem is that i can´t determine the...
Replies
4
Views
131
Hi all, I am trying to convert RSLogix 5000 program to Step7. I need to bit shift left my array of double integers for tracking the product on...
Replies
2
Views
521
I have a word in some DB which I want to load to AR1 and use as a pointer. In order to do this I need to write L DBxy.DBW xy SLD 3 LAR1 I...
Replies
3
Views
534
Back
Top Bottom