Adding together DB values

maico

Member
Join Date
Jun 2012
Location
Belfast
Posts
27
Hi All,
I want to take values from a DB say four separate values of db100.dbw10 + db100.dbw12 + db100.dbw14 + db100.dbw16 and add them together so as I have one combined value, what would this look like?

Thx
 
Code:
      L     DB100.DBW   10
      L     DB100.DBW   12
      +I    
      L     DB100.DBW   14
      +I    
      L     DB100.DBW   16
      +I  
      T Result
Works if result value don't exceed the max value of an integer 32767 if above 32767 then you need to do double integer math
 
Last edited:
Code:
      L     DB100.DBW   10
      ITD   
      L     DB100.DBW   12
      ITD   
      +D    
      L     DB100.DBW   14
      ITD   
      +D    
      L     DB100.DBW   16
      ITD   
      +D 
      t Result // Result must be a double integer
 

Similar Topics

Hi! I need to add 2 different variables together at Siemens. Variables are with type: time/ t#__s On FBD-editor I can't find direct block for...
Replies
5
Views
4,833
Hi, I have an array of 30 integers :- db1.tracking[0] to db1.tracking[29] What's the best / easiest way to add them all together ? They are...
Replies
5
Views
2,985
Hi all I’m looking at adding a RFID card reader to comfort panel pro , how do you set the rfid up can you connect to existing users and password...
Replies
0
Views
37
Hello all! So I have one project with a S7-1214 and a MTP1500 "Project1" and one project with another S7-1214 "Project2". Both of these PLC:s need...
Replies
6
Views
110
Hi Everyone, Currently we have three plants running with Controllogix PLCs (L72, L73, L74). In each of these plants we have 2 FTView SE...
Replies
0
Views
86
Back
Top Bottom