how to prepare the content of a variable to be displayable on seven segments (by MOSTAFA QUARRASH)
I've been working to design a programmable ten hours timer , with two independent on/off time preset-able outputs . including a 5-digits , seven segment display . this timer is used with air compressors for periodically discharging of collected water from the bottom of the air tank via a discharge solenoid valve .
Considering the overall plan of my design , I found myself in front of a funny problem . that is , my design is based on three counting variables used as counters for seconds , minutes , and hours . in addition – of course – to the variables containing preset values .
the question was : how shall I display the content of a variable on seven segments , since the variable will contain a two-digits number (in a single variable) , while each seven segment can display a single digit only !
the solution was – logically – that I must convert the two digits - single variable value format to another format with two digits – two variables . I had a lot of trials , trying to separate the two digits into two separate variables , thinking of , and trying , many interlocks and additional variables and rungs .
but – how happy - I found at last that it was very easy to achieve by using the simple instruction of Ldmicro .
here is the file you can try it and enjoy .