Technical Forum

Industrial Software general

Matrix of Input and output

Thread Starter: Milosh   Started: 6/8/2012 9:37 AM   Replies: 9

« Previous thread Next thread »
Page 1 of 1 (10 items)
  6/8/2012, 9:37 AM
Joined 8/16/2010
Last visit: 4/30/2013
Posts: 245
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (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
  6/8/2012, 10:26 AM
Joined 1/17/2007
Last visit: 5/20/2013
Posts: 759
Rating:
Rated: Excellent [4.33 out of 5 / rated 141 time(s)]. (141) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (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
Thank you for this post from:
  6/8/2012, 12:11 PM
Joined 8/16/2010
Last visit: 4/30/2013
Posts: 245
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (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?

Attachment: matrix.pdf  (18 Downloads)



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



Top
  6/8/2012, 12:30 PM
Joined 1/17/2007
Last visit: 5/20/2013
Posts: 759
Rating:
Rated: Excellent [4.33 out of 5 / rated 141 time(s)]. (141) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (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
  6/8/2012, 12:53 PM
Joined 8/16/2010
Last visit: 4/30/2013
Posts: 245
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Ok Thanks.
So I can use scheme in my .pdf and multiplexing(programm) as you say?
Top
  6/10/2012, 11:06 AM
Joined 8/16/2010
Last visit: 4/30/2013
Posts: 245
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (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.

Attachment: matrix.pdf  (16 Downloads)

Top
  6/11/2012, 1:31 PM
Joined 1/17/2007
Last visit: 5/20/2013
Posts: 759
Rating:
Rated: Excellent [4.33 out of 5 / rated 141 time(s)]. (141) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (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
  6/11/2012, 3:06 PM
Joined 8/16/2010
Last visit: 4/30/2013
Posts: 245
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (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
  6/11/2012, 4:39 PM
Joined 1/17/2007
Last visit: 5/20/2013
Posts: 759
Rating:
Rated: Excellent [4.33 out of 5 / rated 141 time(s)]. (141) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (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
  6/12/2012, 7:16 AM
Joined 8/16/2010
Last visit: 4/30/2013
Posts: 245
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (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
Page 1 of 1 (10 items)
Actions