Shop OBEX P1 Docs P2 Docs Learn Events
Propeller as a PLC? — Parallax Forums

Propeller as a PLC?

lindseydallaslindseydallas Posts: 14
edited 2014-12-17 09:05 in General Discussion
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. I’ve looked around online a bunch for an “off the shelf” option, but they are just not doing it for me. I figured that if I’m 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 we’ll 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. I’ll also need I/Os for sensor input and control output but that doesn’t look like it will be a problem.
Thanks for any insight you can provide!

Comments

  • T ChapT Chap Posts: 4,223
    edited 2014-12-17 07:25
    lindseydallas

    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.
  • Mike GreenMike Green Posts: 23,101
    edited 2014-12-17 08:08
    To add to T Chap's comments ...

    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.
  • PropGuy2PropGuy2 Posts: 360
    edited 2014-12-17 08:46
    I often thought this would be a neat and useful project to do with a Prop. The biggest task as I see it, is developing an easy to use graphic interface language, so that input & output pins could be used in any configuration, along with logic blocks (AND, NAND, OR, NOR) timers and the usual functions found in an industrial controller PLC. You might search the forums to see if anyone else has done this.
  • kwinnkwinn Posts: 8,697
    edited 2014-12-17 09:05
    There have been at least a couple of projects to do this already. PicoPLC is the one that I recall, but I am sure there were others.
Sign In or Register to comment.