Propeller as a PLC?
lindseydallas
Posts: 14
I am considering using the Propeller chip to make my own PLC-type controller (programmable logic controller). I looked into doing this with the Basic Stamp a while back since I have some skill in PBasic but ran into trouble with having enough memory space and I/Os. Ive looked around online a bunch for an off the shelf option, but they are just not doing it for me. I figured that if Im going to have to learn a new language anyway, I might as well make it one that has a huge support network and Parallax definitely has that. I admit that I am cheating a little bit by posting this on the forums instead of doing all the research myself, but there is a lot of info out there and I was getting a little lost.
So:
My questions are:
How does the Prop chip do with memory storage? I could be looking into storing as many as 100-150 variables.
How about communications? This is a big deal for us since the controller will be on a remote location and well need to receive data from it. Can I connect a Spinneret to a modem in the field and use that to see my variables? Also, can I have several Props in the field and have them talk to each other (for instance, if one is a kind of slave with a specific task to do, can I have it send data back to the Controller or master prop)?
Can a Prop communicate with a Basic Stamp? We are already using those for specific tasks and it would be nice to send the data from them to the Prop controller.
Any suggestions/cautions/recommendations for learning Spin after using PBasic?
I think those are the big concerns. Ill also need I/Os for sensor input and control output but that doesnt look like it will be a problem.
Thanks for any insight you can provide!
So:
My questions are:
How does the Prop chip do with memory storage? I could be looking into storing as many as 100-150 variables.
How about communications? This is a big deal for us since the controller will be on a remote location and well need to receive data from it. Can I connect a Spinneret to a modem in the field and use that to see my variables? Also, can I have several Props in the field and have them talk to each other (for instance, if one is a kind of slave with a specific task to do, can I have it send data back to the Controller or master prop)?
Can a Prop communicate with a Basic Stamp? We are already using those for specific tasks and it would be nice to send the data from them to the Prop controller.
Any suggestions/cautions/recommendations for learning Spin after using PBasic?
I think those are the big concerns. Ill also need I/Os for sensor input and control output but that doesnt look like it will be a problem.
Thanks for any insight you can provide!
Comments
Storing hundreds of variables as bytes/words/longs is no issue. Communicating from the Prop to any other device is no issue using one of the Full Duplex Serial variants, there is also a 4 port that allows 4 serial ports per one cog. Talking to a Stamp is easy, just set baud the same on each end and talk. Communication over distance in no problem, RS485 is a very easy method to transmit serial data from Master to many slaves. There are many RS485 chips on the market that are extremely easy to set add to your project. I use MAX3430. Wifi is just only a little more effort to set up, but there are a number of Wifi options as you have already mentioned one of them. Learning Spin is pretty easy, it is very basic like and is intuitive on many levels. You will basically get some type of Prop board, and start attacking one problem at a time to learn the aspects of each thing you will need to incorporate. After tackling each aspect ( RS485, serial from device to device, connecting sensors etc) then you can have a set of methods already assembled that you can use as building blocks for the final program. Start with one thing to tackle, learn it, then move to another thing. Don't try to make one big program at once. At least this is my opinion on how to do it as someone that has done the whole process of starting from scratch with a microprocessor and building a system.
The 8 cogs of a Propeller can be used in two ways. You can use a cog to create a software I/O device like the 4-port serial driver or you can use a cog as a separate microcontroller. These all share the 32K of "hub" memory. All the variables of all the cogs plus all the interpretive code for the cogs has to fit in the 32K, usually not a big deal. I have one program (FemtoBasic) that does serial I/O, PC-compatible SD card I/O, is about 1500 lines of Spin, and has maybe 12K to spare.