Reprogramming a PLC on the fly, based only off of X inputs

Brandon_K

Member
Join Date
Mar 2016
Location
Pittsburgh, PA
Posts
150
I'm wondering if anyone has any ideas how I could go about this. Let's say I have a Automation Direct Click (8x\6y) and when the following sequence is entered, Y1 activates; X3, X1, X2, X5, X4, X6. But later down the line, I want to change that sequence without having access to the controller or connecting a PC. It needs to be able to be reprogrammed by the 6 inputs exposed to the operator. The additional two inputs can be used if needed. Maybe one would be used to enter "programming mode" and the other could be used, once in programming mode, to copy data back to a default value.

I'm thinking if I have a counter assigned to each input which changes the value in a particular data field (I think these are DS in Click?), then use compare, maybe something along those lines will work?

I've put zero time into the code on this, something I've only been tossing around in my head. I figured before I put any time into writing ladder, I would post to see how you guys would go about this. I'm sure there are ways to do this with higher end PLC's, but at that point it becomes cost prohibitive compared to the somewhat specialized microprocessor I'm using now. Unfortunately, the Click has a fairly limited instruction set. Basic NO, NC, edge and compare contacts; set\reset, basic counter and timer; math, drum, copy data and shift registers are about all it can do. It is capable of doing subroutines and they can be called, but I'm not sure that will be helpful.
 
I think you could do it with two tables. One holds the reference numbers, the other holds the arguments. Once both are loaded do a sequential, item by item compare. Let X1 load a value of '1' to the table input, and so on. You'll need to investigate pointer addressing.
 
I think you could do it with two tables. One holds the reference numbers, the other holds the arguments. Once both are loaded do a sequential, item by item compare. Let X1 load a value of '1' to the table input, and so on. You'll need to investigate pointer addressing.

I will look into this. Thanks!


How many sequences do you have?
What about using the inputs as a binary code for the program that you want to run.
X0 and X8 will be able to produce 4 programs. This code can then trigger what program (Subroutines) that you want to run.

http://www.automationdirect.com/static/specs/clickinstr.pdf

Without knowing all of the details, the Click will be able to do this for you.

Regards,

There could be a possible of 46,656 combinations (6 X inputs with a requirement of 6 key presses of any combination, so 6^6). So, writing a program for each is not realistic.

This is for a game and I need to be able to have the customer have the ability to reprogram it for their needs. In the world of show and prop controls that I come from, this would be known as a "key banger". You put the controller into it's program mode, then "bang" in the inputs on the "keys" or buttons. Basically, I'm trying to make a little more profit by replacing a $150 controller with a $70 Click. It actually ends up saving a bit more as there are (6) hobbyist style servo leads that are required to connect to the board and those are a few bucks a piece, plus the shipping as well. It's not a huge amount in the grand scheme of things, but if I can save $100 in parts cost on a box that sells for $300, that really boosts the profit margin!

Ideally what I imagine is for them to have a key which activates X8 to enable programming mode. The customer then punches in the 6 button combo that they want, turn the X8 key off and now it works with that setting. Currently any 6 digit combination is able to be used, IE 111111, 123456, 121314, etc.
 
If you want to save money and just want to do as you said press a programming button and remember the sequence for a game, then maybe you should look into using an Arduino?

That kind of thing is probably easier to program in something that is like C++.

If you change the code of this Simon says game a bit, you will probably have what you want:
https://learn.sparkfun.com/tutorials/sik-experiment-guide-for-arduino---v32/experiment-16-simon-says

Do it with a cheap Arduino clone from China and it will only cost you $3 or so.
https://learn.sparkfun.com/tutorials/sik-experiment-guide-for-arduino---v32/experiment-16-simon-says
 
Last edited:
If you want to save money and just want to do as you said press a programming button and remember the sequence for a game, then maybe you should look into using an Arduino?

That kind of thing is probably easier to program in something that is like C++.

If you change the code of this Simon says game a bit, you will probably have what you want:
https://learn.sparkfun.com/tutorials/sik-experiment-guide-for-arduino---v32/experiment-16-simon-says

Do it with a cheap Arduino clone from China and it will only cost you $3 or so.
https://learn.sparkfun.com/tutorials/sik-experiment-guide-for-arduino---v32/experiment-16-simon-says

Actually, this is exactly what we're trying to get away from. We have one game that is designed around a Mega and it has issues. It's just simply not as reliable as a PLC.

Plus, by the time you start adding relays or higher current discrete outputs, opto isolated input's, enclosure, additional power supply (or regulator), your $35 Uno just turned in to a $70+ Uno. Yes, I'm aware of the cheap chinese clones, but my friends company that I'm contracting for was built upon reliability. He is one of the few vendors in the industry (haunted attractions) that builds things to not fail. This is actually the reason that we are moving from hobbyist boards to proven PLC's.

Compare the total overall cost of a Uno package to a $70 Click, which one are you going to pick? Plus, the other "tech" guy that works for him (as well as myself) have zero desire to learn yet another programming language. The other tech guy can at least make some heads and tails of ladder logic, at least the theory of operation.

We use a good bit of Basic Stamp based stuff right now and without question, I can bang out a ladder logic program in 1/10 the time, hence one of the reasons to move to PLC's on everything.
 
Here is a link that will show you how to write such a program. It is done using the AD D0-More PLC, but the Click has similar ability.
This should give you a few ideas.
http://accautomation.ca/building-a-plc-program-that-you-can-be-proud-of-part-6/

Regards,


Thanks for the links. I've printed them out and will start with this project this evening.
 

Similar Topics

I have FP WIN PRO and FP WIN GR Panasonic programming software, i have been trying to reprogram the FP-XC60R PLC from the back up program which i...
Replies
9
Views
5,351
Hello, im trying to do some development with reprogramming a PLC via a pocket PC. I know it can be done, but I cant seem to get the PLC program...
Replies
8
Views
3,073
Hey guys, I have an AB PV 600, 2711-B6C1 (RIO) Series B, Rev B, Frn 3.15 which unfortunately fails the CRC firmware check. I have multiple...
Replies
2
Views
1,820
Hi I am new to plc programming. I would like to build a notification signal with 2 inputs and two output. The problem is that I need to control...
Replies
3
Views
1,553
I am trying to get info on an omron sysmac c40k. The plc works, but 2 of the inputs are shorted and i would like to just move the inputs to an...
Replies
2
Views
1,971
Back
Top Bottom