Anyone here use rev for plc programming?

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Anyone here use rev for plc programming?

Post by sturgis » Wed Nov 18, 2009 5:51 pm

I'm interested in learning to manage plc hooked devices and am wondering if anyone has done this with rev. And if so, does anyone have sample code? Recommendations for an affordable easy to work with plc controller and the like?

Its way way above my head still, but due to future health concerns i'm wanting to learn how to do home grown home automation type stuff up to and including window open/close using stepper motors, thermostat controls and.. I have quite a few things in mind.

I know I could use built in stuff and use ladder programming and build stuff up that way, but I love rev.

So, if anyone has any experience with this sort of thing at all i'd appreciate any and all input to help me get started. And yeah, I know this is such a general question it could be tough to answer but I know so little about plc stuff that I'm not even sure yet what the proper questions are.

I would probably want to avoid x-10 systems and the like. I've become interested in this stuff after seeing a company near here in action. The whole place is wired, the air compressor auto drains condensation, all the moulders, rip saws, resaws, planers, scanners send production data, and its all fed to a central hand written (ladder) program that then embeds live data in an excel spreadsheet using dde. I think I could get a handle on doing things that way but.. Did I mention I love rev? While I know i'll have to learn much of the underlying tech to make this work, rev is my front end of choice.

Any and all imput is welcome, thx!

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Post by mwieder » Wed Nov 18, 2009 10:21 pm

Well, plc devices are generally programmed in basic - you download the code to the device and send it a start signal, so I'm not sure what you'd gain by putting a rev front end on things. You're not going to have the plc device running revTalk, if that's what you've got in mind.

(Edit)
I just reread your original post and I thought you were talking about PIC chips, not PLCs. Ignore this post.
Last edited by mwieder on Thu Nov 19, 2009 7:21 am, edited 1 time in total.

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Post by sturgis » Thu Nov 19, 2009 12:38 am

Nope, not running revtalk, however in the setup I described excel is used to grab data across the network (networked plc units) and show things live. Like the feed rate for the moulders can be viewed live inside excel using dde methods.
I'd be wanting to code a front end that would grab status info for the automated items in my house. Light on/off messages, window open and closed, front door open or closed, motion sensor triggered, that sort of thing. As for programming the behaviors themselves, i'm mostly comfortable in basic, and from what i've seen of ladder programming i'm pretty sure i can get a handle on that side of things.
Alas, so far i have zero hardware to work with so am shooting in the dark. Any chance you could recommend a plc controller (that uses ladder logic rather than basic since i have a person here whose brain i can pick) that is affordable?
I know I could probably just go for an x10 based home automation package and not do all this work and learning myself, but (other than lately) i'm pretty much locked into being at home, so starting a project thats completely over my head will help pass the time, and teach me things to boot.
mwieder wrote:Well, plc devices are generally programmed in basic - you download the code to the device and send it a start signal, so I'm not sure what you'd gain by putting a rev front end on things. You're not going to have the plc device running revTalk, if that's what you've got in mind.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10354
Joined: Wed May 06, 2009 2:28 pm

Post by dunbarx » Thu Nov 19, 2009 12:53 am

Check out a gadget called "service USB":

http://www.bkohg.com/service_e.html

It is much better than any PIC, though much more expensive. but unless you are dedicating PICs to a particular stand-alone project, this may not matter.

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Post by mwieder » Thu Nov 19, 2009 1:16 am

I know you've mentioned that device on the list before and it looks quite cool. It looks like it would need some external attachments to switch line voltage, no?

And they get extra bonus points for listing runrev at the top of the compatibility list. I'm assuming that the external library they mention ships with the product?

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Post by sturgis » Thu Nov 19, 2009 1:42 am

Very cool! Think that may be the way I go, especially since I can get one of the kits to learn with.

Thank you both very much.
dunbarx wrote:Check out a gadget called "service USB":

http://www.bkohg.com/service_e.html

It is much better than any PIC, though much more expensive. but unless you are dedicating PICs to a particular stand-alone project, this may not matter.

RRobert
Posts: 151
Joined: Sat Feb 28, 2009 8:20 pm

Post by RRobert » Thu Nov 19, 2009 1:53 am

I would recommend the Arduino platform and talk to it by a serial connection (the board owns a USB-to-serial adapter chip).

Code: Select all

local tCommand

read from file "COM4:" until end
put "Result:" && it

put "RUN 1" into tCommand
write tCommand to file "COM4:" 
Robert
Last edited by RRobert on Thu Nov 19, 2009 1:56 am, edited 1 time in total.

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Post by sturgis » Thu Nov 19, 2009 1:56 am

Ty, will read up on that one too.
RRobert wrote:I would recommend the Arduino platform and talk to it by a serial connection (the board owns a USB-to-serial adapter chip).

Code: Select all

read from file "COM4:" until end
write "Play" to file "COM4:" 
Robert

rjackson
Posts: 1
Joined: Mon Nov 16, 2009 4:07 am

Post by rjackson » Thu Nov 19, 2009 5:25 am

As I understand it, you want to be able to communicate with a PLC. For starter, look at the http://www.Automationdirect.comPLCs. They have the Click line of PLC which is cheap with free Ladder Logic Software. You will most likely communicate with the Modbus protocol. Also look at the Host Engineering Web site. They have an example of Report by Exception. Good luck.

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Post by sturgis » Thu Nov 19, 2009 5:34 am

Thx yet again! Will add these to my research reading!
rjackson wrote:As I understand it, you want to be able to communicate with a PLC. For starter, look at the http://www.Automationdirect.comPLCs. They have the Click line of PLC which is cheap with free Ladder Logic Software. You will most likely communicate with the Modbus protocol. Also look at the Host Engineering Web site. They have an example of Report by Exception. Good luck.

greggarcia
Posts: 33
Joined: Mon Apr 27, 2009 3:32 pm
Contact:

about PLC

Post by greggarcia » Thu Nov 19, 2009 4:08 pm

Hello i would recommend first at all, looking first for a PLC that have a communications module, this is the module where you can talk with the PLC using a Open protocol (OPC) so may be you can write the code using Revolution and then using the OPC interface talk with the PLC.
Regards.

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Post by sturgis » Thu Nov 19, 2009 5:01 pm

Its becoming increasingly obvious to me that.. I haven't a clue. Am looking up everything recommended and trying to learn enough so that I can make better decisions when it comes time to buy hardware. Thanks to the responses here I'm finding lots of helpful tutorial/intro sites as well as places to shop.

Now I just need to figure out if I can figure it out.

*goes to look up OPC*

Thank you everyone!

Post Reply