rpoet
Member
Hi All,
I'm looking at a project coming up that will involve driving some large 7-segment display digits. They're "dumb" and do not have BCD decoders so I will be using seven sinking PLC outputs per digit, A - G.
https://www.sparkfun.com/products/8530
I'm planning on using an AutomationDirect DL-06 with several expansion cards for additional outputs. Hardware-wise, this is easy.
My question is programming: I'll be driving (4) digits; two as a two-digit countdown clock that counts from 90 seconds to zero, and a two-digit counter that counts events starting from zero.
At the end of the time interval, a RESET pushbutton will reset the clock and counter. A START button will start the sequence again.
Starting, stopping, and reseting the timer, as well as handling the counter are easy and I have no problem with that part of the program.
I can see several way to accomplish display the logic:
1) Brute force it with many many many compare statements and lots of C-bits. Not my favorite, as it will be MANY lines to hand code. I see errors creeping in from my fat fingered typing.
2) Use an EDRUM instruction for each digit to form the numbers, and trigger them off an external timer / counter event. Probably better than #1, but I haven't used the DRUM instructions before. I'll have a learning curve, and I'm worried they won't be as flexible as I need them to be. After looking at the programming reference, it may end up being about as much logic as option #1.
3) This would be an ideal solution: Allow the pairs of digits to display the contents of a V-memory register from 0 - 99. I can do the output programming for this option easily, and get each "digit" to display 0-9 when I turn on a particular C-bit, but I'm unsure how to map those bits to a V-memory register. I'm also unsure how I would integrate two digits so that they would display a two-digit number.
I'm cross-posting this to the AD tech forum, as the hardware has been spelled out for this job and I don't have a choice on the "brain."
Thanks!
rpoet
I'm looking at a project coming up that will involve driving some large 7-segment display digits. They're "dumb" and do not have BCD decoders so I will be using seven sinking PLC outputs per digit, A - G.
https://www.sparkfun.com/products/8530
I'm planning on using an AutomationDirect DL-06 with several expansion cards for additional outputs. Hardware-wise, this is easy.
My question is programming: I'll be driving (4) digits; two as a two-digit countdown clock that counts from 90 seconds to zero, and a two-digit counter that counts events starting from zero.
At the end of the time interval, a RESET pushbutton will reset the clock and counter. A START button will start the sequence again.
Starting, stopping, and reseting the timer, as well as handling the counter are easy and I have no problem with that part of the program.
I can see several way to accomplish display the logic:
1) Brute force it with many many many compare statements and lots of C-bits. Not my favorite, as it will be MANY lines to hand code. I see errors creeping in from my fat fingered typing.
2) Use an EDRUM instruction for each digit to form the numbers, and trigger them off an external timer / counter event. Probably better than #1, but I haven't used the DRUM instructions before. I'll have a learning curve, and I'm worried they won't be as flexible as I need them to be. After looking at the programming reference, it may end up being about as much logic as option #1.
3) This would be an ideal solution: Allow the pairs of digits to display the contents of a V-memory register from 0 - 99. I can do the output programming for this option easily, and get each "digit" to display 0-9 when I turn on a particular C-bit, but I'm unsure how to map those bits to a V-memory register. I'm also unsure how I would integrate two digits so that they would display a two-digit number.
I'm cross-posting this to the AD tech forum, as the hardware has been spelled out for this job and I don't have a choice on the "brain."
Thanks!
rpoet