seven segment display operation

rpoet

Member
Join Date
Jun 2008
Location
New York, NY
Posts
536
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
 
remarks:
the displays are 12 Volt, So you will need a separate power supply for the displays. the plc seems to get fine with 12 volts. especcialy sinking.
map the outputs in 4 arrays for each digit 1
in these arrays so array[3] has a byte containing the segments that should be on.
they are from a separate array.

for loop
for each digit take the value and get segmentarray (value) and put it in digitarray.

then put this on the outputs; yes this is a long ST of 8*4 lines (all the same and is needed as you can not put physical outputs to a array
so digit0segmenta:=array[0,0]
etc.
You can also have a look at how the arduino does this (many examples on the arduino.cc website.
and on sparkfun aswell.
 
Thank you, Bernie. There really is a command for just about everything. That's exactly what I need. I remember SEG now; I stumbled across it several years ago but promptly forgot it.

Thanks again!


rpoet
 

Similar Topics

How is it possible to get "-"sing with BCD seven segment LED display. With combination of four bits we get digits from 0 to 9. What should we do...
Replies
3
Views
2,295
Q I am brand new to plc's but I had a couple courses in college. Any help in detail would be much appreciated. What I would like to do is make...
Replies
36
Views
12,223
Dear Friends, simply iam taking my very early steps into the SIEMNS S5 and iam surprised by the first task i need to figure out i have in my S5...
Replies
2
Views
1,816
hi, im using the program flowcode to make a counter on a quad seven segment display. i need to know how to affect the second digit(the tens)...
Replies
5
Views
3,444
I am currently using Omron CQM1 PLC to interface with seven segment display. However, I don't know how to interface the dual digit 7 segment...
Replies
1
Views
6,211
Back
Top Bottom