Technical Forum

Industrial Software general

Matrix of Input and output

Erstellt von Milosh am 08.06.2012 09:37 (9 Antworten)

« Vorheriges Thema Nächstes Thema »
Seite 1 von 1 (10 Objekte)
  08.06.2012, 09:37
Beigetreten am: 16.08.2010
Letzter Besuch: 21.05.2013
Beiträge: 249
Bewertung:
Bewertung: keine [0 von 5 / 0 mal bewertet]. (0) 
Bewertung: keine [0 von 5 / 0 mal bewertet]. (0) 
Hi all...I hear that some people use 4inputs and 4 outputs to replace 16 input signals.
They use some kind of matrix to check states.
How they do that in hardware and software realization?
let say that we have 64 motors and 64 motor circuit breakers...
Now I want to use matrix 8inputsx8outputs instead 64 inputs...How? :)

Thanks...

Top
  08.06.2012, 10:26
Beigetreten am: 17.01.2007
Letzter Besuch: 21.05.2013
Beiträge: 760
Bewertung:
Bewertung: Exzellent [4,33 von 5 / 141 mal bewertet]. (141) 
Bewertung: keine [0 von 5 / 0 mal bewertet]. (0) 
I take it you mean using a scheme similar to a keyboard matrix circuit.
There is a good example of how this works here.
Obviously the buttons would be replaced by switches in you case.
I hope this is what you are after.

Programming today is the race between software engineers building bigger and better idiot proof programs, and the universe producing bigger and better idiots.

So far, the universe is winning...
Top
Für diesen Beitrag bedankt sich:
  08.06.2012, 12:11
Beigetreten am: 16.08.2010
Letzter Besuch: 21.05.2013
Beiträge: 249
Bewertung:
Bewertung: keine [0 von 5 / 0 mal bewertet]. (0) 
Bewertung: keine [0 von 5 / 0 mal bewertet]. (0) 
So I need to configure hardware like on attached .pdf. M tags is for contacts on motor circuit breaker.
When starting PLC, on OB100 startup I need to set outputs (+24Vdc). Now I can check states of inputs and outputs and set bits to indicate motor cicrcuit open contact.
But, what happens is M2 is off, how to check state of M6. What if whole first row is off (M1,M2,M3,M4). How to configure hardware to work good?

Dateianhang: matrix.pdf  (18 Downloads)



=== Edited by Milosh @ 6/8/2012 12:12 PM [GMT ] ===



Top
  08.06.2012, 12:30
Beigetreten am: 17.01.2007
Letzter Besuch: 21.05.2013
Beiträge: 760
Bewertung:
Bewertung: Exzellent [4,33 von 5 / 141 mal bewertet]. (141) 
Bewertung: keine [0 von 5 / 0 mal bewertet]. (0) 
You have to multiplex the outputs.
1) Basically set all outputs high.
2) Check inputs. If no inputs high, there is nothing to do as no switches are made.
3) If ANY input is high, then start multiplexing.
4) Multiplexing - This involves setting all outputs low. The setting output 1 high, and then checking to see which of the inputs are set. Then set output 1 back low again.
5) Repeat 4) for each of your outputs.

Best to have it so you perform each output set per cycle (or once per a number of cycles if applying some input switch "debouce").  This "debounce" is where the output to be held high for several cycles and input has to be seen as high for several cycles to be confirmed. This will help counter any possible noise on the switch to prevent spurious readings.

The animation in the link I gave you explains this quite well.

Programming today is the race between software engineers building bigger and better idiot proof programs, and the universe producing bigger and better idiots.

So far, the universe is winning...
Top
  08.06.2012, 12:53
Beigetreten am: 16.08.2010
Letzter Besuch: 21.05.2013
Beiträge: 249
Bewertung:
Bewertung: keine [0 von 5 / 0 mal bewertet]. (0) 
Bewertung: keine [0 von 5 / 0 mal bewertet]. (0) 
Ok Thanks.
So I can use scheme in my .pdf and multiplexing(programm) as you say?
Top
  10.06.2012, 11:06
Beigetreten am: 16.08.2010
Letzter Besuch: 21.05.2013
Beiträge: 249
Bewertung:
Bewertung: keine [0 von 5 / 0 mal bewertet]. (0) 
Bewertung: keine [0 von 5 / 0 mal bewertet]. (0) 
Hi again.
I made some changes in my scheme.
Can some provide if my scheme is good?
I think that now I can do checking in OB cyclic interrupt as smiffy said.

Dateianhang: matrix.pdf  (16 Downloads)

Top
  11.06.2012, 13:31
Beigetreten am: 17.01.2007
Letzter Besuch: 21.05.2013
Beiträge: 760
Bewertung:
Bewertung: Exzellent [4,33 von 5 / 141 mal bewertet]. (141) 
Bewertung: keine [0 von 5 / 0 mal bewertet]. (0) 
Unfortunately, the way you have shown it will not work.
The rows and columns (inputs and outputs) are shown pernanently connected at each crossing point. This is wrong. They should not be connected at any point. That is what the field switches will do. The switches you need to check connect a specific row to a specific column.
It would also be a good idea to connect in the diodes so you have the possibiliy to chwck for multiple switches being made simultaneously.

Programming today is the race between software engineers building bigger and better idiot proof programs, and the universe producing bigger and better idiots.

So far, the universe is winning...
Top
  11.06.2012, 15:06
Beigetreten am: 16.08.2010
Letzter Besuch: 21.05.2013
Beiträge: 249
Bewertung:
Bewertung: keine [0 von 5 / 0 mal bewertet]. (0) 
Bewertung: keine [0 von 5 / 0 mal bewertet]. (0) 
Hmm...But there are no crossing points between inputs and outputs.
First I set Q0.0 (Q0.1 reset) which gives +24VDC to the contacts M1,M2,M3 and M4. These contacts going to different inputs. So I can check states of inputs and set some bit (if contacts closed) or reset (if contacts open). In second cycle, reset Q0.0 and set Q0.1 and do the same checking.
Right?



=== Edited by Milosh @ 6/11/2012 3:13 PM [GMT ] ===


Top
  11.06.2012, 16:39
Beigetreten am: 17.01.2007
Letzter Besuch: 21.05.2013
Beiträge: 760
Bewertung:
Bewertung: Exzellent [4,33 von 5 / 141 mal bewertet]. (141) 
Bewertung: keine [0 von 5 / 0 mal bewertet]. (0) 
Appologies, I was looking at your first schematic not your second.
Your second one looks OK, and should work.
Interesting problem. Can I ask why you are doing this?
Is it just curiosity, or are you that desparate to save digital inputs?
It seems at lot of work just to save 12 digital inputs.
I would love to see it working though, merely from an engineering perspective.

Programming today is the race between software engineers building bigger and better idiot proof programs, and the universe producing bigger and better idiots.

So far, the universe is winning...
Top
  12.06.2012, 07:16
Beigetreten am: 16.08.2010
Letzter Besuch: 21.05.2013
Beiträge: 249
Bewertung:
Bewertung: keine [0 von 5 / 0 mal bewertet]. (0) 
Bewertung: keine [0 von 5 / 0 mal bewertet]. (0) 
I have more than 100 inputs from motor circuit breakers. Because of that I want to use matrix.
I will inform you about this.
Thank's a lot,
Miloš
Top
Seite 1 von 1 (10 Objekte)
Aktionen