Brandon_K
Member
I have a project where I need to drive a dozen 7-segment LED displays from values of 0-9.
Initially, I was doing to use panel mount digital volt meters driven by 0-10v analog output cards, but in effort to try to reduce cost I thought of other ways to do this and decided to give a matrix output a shot.
This would use a total of 19 discrete outputs, 12 to drive the sink leg of each display and 7 to drive the actual segments. I would use a counter to cycle through the outputs that drive the common leg of each individual display so that each display updates every 12ms (assuming a 1ms timer to cycle the counter).
My issue is that I know how I would go about it and it would end up being hundreds of rungs and incredibly inefficient. The basics of cycling through the displays is easy enough, but getting the output correct to drive the segments has me stumped. I would end up doing this with a ton of compare contacts and I know that's not the right way to do it. I *think* the right way to go about this is to create an array or shift register or something, but I have no practical experience doing this. Those are things I've never needed to use before and I'm all self-taught on ladder logic, owing my knowledge to trial and error or you fine gents here.
I know I need to create a table of some sort, the following is about to get very verbose;
If; Top center = DO.1; top left = DO.2; top right = DO.3; center = DO.4; bottom center = DO.5; bottom left = DO.6; bottom right = DO.7
So to create "4", outputs 2, 4, 3 and 7 need to be on. Again, short of a metric *** load of compare contacts, I don't know how to go about this.
So that's the output side.
The input side is super easy, it's a continuous rotary switch (IE, rotary lamp switch with no stops), each rotation will cycle a counter from 1 to 10, then rollover. When switch 1 counter is "2", a "2" needs displayed on switch 1's display (each display will have a rotary switch under it).
Now with my novel of a post done, this may all be for nothing but an exercise in learning. I have a Productivity 2000 rack in front of me that I'm using for development, but ultimately this game will be deployed on a Click for cost reasons. The Click has a very limited instruction set, with the most advanced instructions being Shift Register (which I don't understand how they work, at all) and a drum (which may be the correct way to go about this). Past that, I don't know that a Click will scan fast enough for the outputs to update at a fast enough rate so that the switching of the displays aren't discernible to the human eye. If I have to move to a faster system, I'll just use a Click with three 0-10v analog cards to direct drive voltage meters as I was initially going to do. Just to get my foot in the door with a P2K system (backplane, power supply and processor) will cost more than the entire Click setup, including the analog cards)
Sorry for the novel of a post, but I figured the more details, the better. I would love to hear what everyone thinks!
Initially, I was doing to use panel mount digital volt meters driven by 0-10v analog output cards, but in effort to try to reduce cost I thought of other ways to do this and decided to give a matrix output a shot.
This would use a total of 19 discrete outputs, 12 to drive the sink leg of each display and 7 to drive the actual segments. I would use a counter to cycle through the outputs that drive the common leg of each individual display so that each display updates every 12ms (assuming a 1ms timer to cycle the counter).
My issue is that I know how I would go about it and it would end up being hundreds of rungs and incredibly inefficient. The basics of cycling through the displays is easy enough, but getting the output correct to drive the segments has me stumped. I would end up doing this with a ton of compare contacts and I know that's not the right way to do it. I *think* the right way to go about this is to create an array or shift register or something, but I have no practical experience doing this. Those are things I've never needed to use before and I'm all self-taught on ladder logic, owing my knowledge to trial and error or you fine gents here.
I know I need to create a table of some sort, the following is about to get very verbose;
If; Top center = DO.1; top left = DO.2; top right = DO.3; center = DO.4; bottom center = DO.5; bottom left = DO.6; bottom right = DO.7
So to create "4", outputs 2, 4, 3 and 7 need to be on. Again, short of a metric *** load of compare contacts, I don't know how to go about this.
So that's the output side.
The input side is super easy, it's a continuous rotary switch (IE, rotary lamp switch with no stops), each rotation will cycle a counter from 1 to 10, then rollover. When switch 1 counter is "2", a "2" needs displayed on switch 1's display (each display will have a rotary switch under it).
Now with my novel of a post done, this may all be for nothing but an exercise in learning. I have a Productivity 2000 rack in front of me that I'm using for development, but ultimately this game will be deployed on a Click for cost reasons. The Click has a very limited instruction set, with the most advanced instructions being Shift Register (which I don't understand how they work, at all) and a drum (which may be the correct way to go about this). Past that, I don't know that a Click will scan fast enough for the outputs to update at a fast enough rate so that the switching of the displays aren't discernible to the human eye. If I have to move to a faster system, I'll just use a Click with three 0-10v analog cards to direct drive voltage meters as I was initially going to do. Just to get my foot in the door with a P2K system (backplane, power supply and processor) will cost more than the entire Click setup, including the analog cards)
Sorry for the novel of a post, but I figured the more details, the better. I would love to hear what everyone thinks!