Adding Bool & INT

maico

Member
Join Date
Jun 2012
Location
Belfast
Posts
27
Hi All,
In siemens S7 is it possible to add the value of a Bool to an interger ie if I am adding 15 intergers together but have a further 2 Bool parameters to add is it possible to add them to the total sum?
Thx
 
Well a BOOL will either be equal to '1' or '0' so it would be easy enough to just have some Ladder logic to say...
If 'myBOOL' then ADD 1 to 'total' (where 'total' is the sum of your other INTs)

Or something like this in STL...
Code:
A  myBOOL
JNB  M001
L  myTotal
L 1
+I
T myTotal

M001: NOP 0

You would obviously have to make sure it didn't add every scan but something along those lines would work.
 
with couple move blocks or selection block you can make temperary variable which has value of zero or one, then add all ints together.

Siemens STL don't type compare variables, so you can also count variables there.
 

Similar Topics

Hi, I need help adding a new interlock switch to an existing circuit. I have never done on the existing circuit. I did set it up on the...
Replies
5
Views
148
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
64
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
125
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
104
Hello, Im building project with 1756-L82ES controller and 1756-IB16S card but i cant find it when trying to add the card to IO configuration...
Replies
3
Views
177
Back
Top Bottom