siemens outputs

Sagejimmy23

Member
Join Date
Apr 2016
Location
Victoria
Posts
3
Hi guys I have 10 inputs but need to fire one output with any two or less on. i.e if three come on it turns output off?
without using lines and lines of AND or OR gates?

I'm not familiar with the blocks of siemens S7

thanks Jimmy
 
Math

I'm throwing an idea out there. I don't know if it will work but you could try using math to solve this.

1.Converting each input bool value to an integer of 1.
2.Use an adding function like a+b+c+d+e+f+g+h=x.
3.Use a compare function like, if x <= 2 then output=HIGH.

I've included a little, big drawing. Maybe adding pulse contacts to the inputs so that the MOVE and ADDING rate is slower than the scans. Not to sure how the MOVE function will behave if it is continously enabled.

Maybe some more experienced people here have more insight as to how you can develope this ladder.

http://i63.tinypic.com/sos6mo.jpg

.
 
For speed, have a lookup table of 1024 boolean values (32 DWORDs), and use your ten inputs as the index.

My understanding is you need to use STL for indexed addressing.

You will have to figure out indirect addressing yourself, but if the 1024 boolean values are stored from %MD0, And your index at %MW100

Code:
L IW0
L W#16#3FF // (Might be FFC0 depending on the endian)
AW  // Mask so you only get your ten inputs
T MW100     //Save the mask in MW100
A M [MW100] // If the memory address %M x.x = 1 then
= Q0.0          // Turn on output
 
Easy.
Map in inputs to a dword, any dword.
Use FC99 to count the number of bits that are true.
If <3 then turn output on.

FC99 can be found in the Standard library > TI-S7 converting blocks > FC99 BITSUM


Harder.
Map inputs to a (d)word, any (d)word.
Reset counter to 0.
If bit (d)word.0 is true, add 1 to counter.
Use SLW/SLD to shift (d)word right.
Loop back to "If bit is true" 15/31 times.
Once loop is done, if counter < 3, set output.
 

Similar Topics

Hi, I have tried everything but still having no luck. This will be a easy solution I just know it. Ok I want to be able to set off an output...
Replies
5
Views
1,765
Given this code: L DBD 8 LAR1 L PID(AR1, P#8.0) T DBD 38 I understand that whatever is in DBD 8 is loaded into AR1 and then 8 is added to it and...
Replies
13
Views
6,196
Hi all, Now I am working with Sicam P50 multi function meters. It have 2 sets of Analogue outputs. I want to know how we can check its working or...
Replies
0
Views
1,514
when the operator (hmi) changes (slightly) the Begin or End data on the FM452 Siemens module, the cam outputs flicker for one cycle. how can we...
Replies
0
Views
1,454
I have an S7 plc and none of the outputs are working, however all of the inputs are fine. The output cards all have a supply. Can anyone help? I...
Replies
18
Views
5,483
Back
Top Bottom