Thumbwheel Timer Countdown

Hm... Interesting, I worked on a SLC500 that had 4 banks of 3 thumbwheel switches (not my build but done by another company) we did a mod on it and I know the O/F bit was not in the reset in the code as I managed to fault the PLC on one, this was my code causing the problem not the existing and they never had a problem in the previous 12 years I seem to remember these were the pushbutton types but have no idea of the make, these also used the BCD to Dec conversion, talk about coincidence I was talking to the guy who was engineering manager on that plant only yesterday.

It is of course high;y possible that the T/W values were only being FRD'd at a particular point in the process, and not done continuously.



The likelihood of the input bit pattern being illegal at that time would be drastically reduced ...
 
The attached. ZIP has a clunky looping test for validity of BCD input words, if the [S:0/5 Overflow trap] bit, of SLC5/MicroLogix fame, is unvailable.


The code could be a little cleaner by pre-computing nibble masks and bit positions.
 
The attached. ZIP has a clunky looping test for validity of BCD input words, if the [S:0/5 Overflow trap] bit, of SLC5/MicroLogix fame, is unvailable.


The code could be a little cleaner by pre-computing nibble masks and bit positions.


I haven't looked at it yet, just want to say that don't you think that the instruction should have a "valid" flag. I've done exactly that with a Logix5000 add-on instruction I developed, it says the input data does not decode properly as BCD 0-9. The Logix5000 FRD is, to say the least, bizarre !
 
I ..want to say that don't you think that the instruction should have a "valid" flag. I've done exactly that with a Logix5000 add-on instruction I developed, it says the input data does not decode properly as BCD 0-9. The Logix5000 FRD is, to say the least, bizarre !

100% agree!

At least the micrologix has the trap, what is there for the logix side?
 
absolutely nothing [on the Logix side] !


Will the Logix FRD at least refrain from putting an incorrectly-interpreted decimal value in the result? Because then at least we get the last value, although what if we had to e.g. multiply it by 2 for scaling, and we did that to the same tag that the FRD normally writes to, so if the value is then bad then the tag's value keeps doubling each scan, and there is an overflow in milliseconds!
 
Last edited:
So I did't realize so many people posted until just now. After I had a day away from trying this is what i came up with. Just an FYI i am buy no means trying to be an engineer or programmer at the moment, work asked me to take this as an extra class for my Machine Repair card. For me its more for minor troubleshooting on the equipment then programming.
Thanks for all the help though gentlman!!!

final14.PNG
 
Last edited:
Funnily enough I struggled to sleep last night thinking of the one I did a mod all those years ago and decided to ring the old engineering manager this morning (been a good friend for years), He did have this problem many years ago when they replaced a broken unit as the ones they had in stock that were not the same type, they ended up getting the same make (he cannot remember the make) but that was the only time he had the issue, he has confirmed the conversion was every scan.
 
So I did't realize so many people posted until just now. After I had a day away from trying this is what i came up with. Just an FYI i am buy no means trying to be an engineer or programmer at the moment, work asked me to take this as an extra class for my Machine Repair card. For me its more for minor troubleshooting on the equipment then programming.
Thanks for all the help though gentlman!!!




Did it work?
 
The attached. ZIP has a clunky looping test for validity of BCD input words, if the [S:0/5 Overflow trap] bit, of SLC5/MicroLogix fame, is unvailable.

The code could be a little cleaner by pre-computing nibble masks and bit positions.

I realized that brute force for four nibbles is far less clunky than the loop:
xxx.png
 
Nice, I could see such code ending up in operation.

For me its more for minor troubleshooting on the equipment than programming.

Okay, so I won't tell you how to reduce the instruction count between four and seven instructions to (possibly) increase clarity.

That said, there is one design choice that piqued my interest, which could come up as a troubleshooting issue.


Let's say operations came to you with a query: "We had a fat-finger error and entered 600 seconds instead of 60, then pressed START before we noticed, and we ended up sitting around for nine minutes waiting. Pressing START with a new value did not restart the countdown. We think it should reset. Is it operating as written?"

  1. Is the answer yes or no? What parts of the code make that the case?
 
Thumbwheel? You gave me a flashback to around 2001 when I was responsible for a bunch of machines that used thumbwheel inputs to set the number of wrap cycles. These machines were notorious for faulting out. It was common practice for the maintenace tech to drag the rollaround PC cart over there to get online with the Micrologix 1000 just to clear the fault and put them back in run mode.

They never bothered to ask WHY these PLCs were faulting. I finally had it happen on my shift and I narrowed it down to a math error caused by a flaky thumbwheel switch causing an illegal result from the FRD instruction. So I added a trap for that and dumped it in all the machines.

It was not long after that they designated me (undeservedly) the PLC guru.
 
.... I narrowed it down to a math error caused by a flaky thumbwheel switch ....


Not flaky, Mr. PLC Guru, most thumbweel or button detent BCD switches will present "illegal" BCD codes as you rotate the wiper barrel.

Although I've never used one, I suppose it's also possible for the discrete (not BCD) switches (with outputs 0-9) to suffer the same issue, by driving more than one input on as the fingers rotate.

Genuinely the only way to stop it is to not let the "fingers" drag over the connecting traces - either by insulation, or by making them with double-sided PCBs. All down to cost ....


To demonstrate this with a video of it happening, I've just dug out my 4-digit BCD Thumbweel Switch/Display training add-on box that I made years ago. Discovered that the display was not working. Stripped it down, tested on the bench ok, put it back on the PLC and not working again. After much head-scratching eventually tracked it down to the 24V power supply in my training rig only delivering a maximum of 19V ! Even less when my output LEDs are on - with the T/W set at "7777", (and hence 12 output LEDs showing), the rail voltage dropped to 11V ! My BCD display inputs "high" voltage is 21 to 24V, so they weren't decoding the 19V signals, hence showing "0000". Replacement power supply on order ....
 
Last edited:

Similar Topics

Hello all, Though no stranger to computers and programming, I am a newbie to PLCs. I have a simple task but am not sure how to connect the dots...
Replies
7
Views
2,331
1. The first thumbwheel stuck, only able to switch between 0 and 9. It can go from 000-099 or 900-999. 2. If I set it to 009, I can ping to...
Replies
3
Views
2,036
hi, guys. I am using the Siemens setp 7. I have a thumbwheel input in the panel, which has four bit input all boolean ones? How can I get the...
Replies
17
Views
4,568
How many wiring terminals are their on a 3 digit thumbwheel switch? I've read some notes that a two digit switch has for the LSD 5 terminals and...
Replies
1
Views
1,672
Hi all, I am looking for a BCD or hex thumbwheel switch. I only plan to use 0-7 (3 bits). I prefer something that has leads already. I would...
Replies
6
Views
2,745
Back
Top Bottom