Hello all! I'm new to programming and I would have some help. I have a Schneider m221 plc and i use somachine basic for programming. The question is the following. How can i make calculations like combinations of 7 take 5? and here I am strictly referring to the IN. It can be made simple with NO and NC contacts, but from many program lines it does not move anymore, and the work is colossal. Can a user defined block be able to calculate the number of active IN and to activate an output or something else depending of the numbers of IN? Or any other solution. For example, I want to start 7 machines, and for each machine I have a pump that goes at a certain speed. For a machine i have a value for 2 others and so on .... The analog output side is not a problem, with calculating the number of inputs I do not know how to do it. You can randomly start machine 3 with machine 7, for example, do not turn on, which is why I need for any combination of the 7 machines I started, maybe I have 4 out of 7, just do not know which ones will be 4. How can I count the number of active entries? thankx you!