News:

  • September 19, 2019, 07:04:50 AM

Login with username, password and session length

Author Topic: SS memory and pointers  (Read 15625 times)

plcnut

  • Hero Member
  • *****
  • Posts: 801
    • premiersi.com
Re: SS memory and pointers
« Reply #15 on: October 13, 2012, 11:25:53 AM »
Thanks, my new H2-DM1E will be here on tuesday, and the IT dept. is supposed to have the server set up where I can access the information I need. They are going to limit the size of data transmissions from their end so I won't have to worry about any of that. My IT tech seems to think this will be pretty easy... Well see next week.

In regards to your suggestion to seek the help of someone familiar with these things, I don't have anybody to ask about this stuff aside from web forums, I do know an AB guy, but that isn't much help with these problems(his suggestion is: "Get a ControlLogix") :o

So once again, Thank you for the help!
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 4680
  • Yes Pinky, Do-more will control the world!
Re: SS memory and pointers
« Reply #16 on: October 13, 2012, 12:22:34 PM »
In regards to your suggestion to seek the help of someone familiar with these things, I don't have anybody to ask about this stuff aside from web forums, I do know an AB guy, but that isn't much help with these problems(his suggestion is: "Get a ControlLogix") :o

We're happy to help you, and we'll be here as long as you need us. My point was driven by a sense that you were coloring outside the lines, and if this is a 'getting paid to do something' scenario, you might get bogged in the details and find that you aren't getting paid enough for the time you end up investing. I don't think the app is particularly difficult with Do-more...of course I am a bit biased though...and I've been writing comm code for about 25 years. ;)

As for ControlLogix, I'm not familiar with AB stuff, do they have a good platform for custom protocol development? I'm certain Do-more does, and I'm certain you can make this work.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

plcnut

  • Hero Member
  • *****
  • Posts: 801
    • premiersi.com
Re: SS memory and pointers
« Reply #17 on: October 13, 2012, 03:06:27 PM »
"coloring outside the lines"!!!!! More like scribbling  :D I've used the basic CoPro for ASCII communications for a scale, printer, and barcode reader, but this is a whole new level, so scribbling is probably an understatement. This is a "paid by the hour" situation, at a rate that takes into account a good bit of learning. I do have a deadline for the easy part of the system (2-1/2 months), but the I can push the database part out a little longer if I have too. Thanks again!
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 4680
  • Yes Pinky, Do-more will control the world!
Re: SS memory and pointers
« Reply #18 on: October 13, 2012, 03:35:13 PM »
By the hour? Well that's a different story! ;)

I'm working on sample code to read a text file from an HTTP server into a large string. I think it is a good sample and others can benefit from it too. Have the server open and talking to me, now trying to read the file. Once I have it all clean and documented, I'll post it.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 4680
  • Yes Pinky, Do-more will control the world!
Re: SS memory and pointers
« Reply #19 on: October 13, 2012, 04:35:38 PM »
In progress...
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 592
    • thePLCguy
Re: SS memory and pointers
« Reply #20 on: October 13, 2012, 04:59:01 PM »
I think this will be a massive help. There had been mentions of the 'capability' of building a custom protocol handler but to see a specific one in actual development will help many (read that as 'me'!).
An output is a PLC's way of getting its inputs to change.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 4680
  • Yes Pinky, Do-more will control the world!
Re: SS memory and pointers
« Reply #21 on: October 13, 2012, 08:10:17 PM »
After studying the basic HTTP GET command, I think it would be useful to add an instruction for it, and possibly POST as well. It is very manageable as a custom protocol, but I suspect using an HTTP server as a simple way of providing production content or recipes or whatever to the PLC would be very popular. What I learn from rolling the protocol in Do-more will make it pretty simple to do the instruction. Not sure when, but maybe DmD 1.1.

Thinking I might like to add a DNS lookup instruction as well, although everything I've read tells me to run away. We'll see. I think it would be very handy.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2734
  • Darth Ladder
Re: SS memory and pointers
« Reply #22 on: October 13, 2012, 09:27:08 PM »
As for ControlLogix, I'm not familiar with AB stuff, do they have a good platform for custom protocol development?

No.  It's a good PLC, even very good, but it ain't a protocol engine.  Even if AB has some prebuilt AOI's (Add-On-Instructions), I bet they're protocols, not protocol tools.

Among the majors, Omron is probably the one who's invested the most effort in protocol creation tools (even have a standalone product in their suite called CX-Protocol), but I think DM will be at least as good if not better.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2734
  • Darth Ladder
Re: SS memory and pointers
« Reply #23 on: October 13, 2012, 09:34:23 PM »
After studying the basic HTTP GET command, I think it would be useful to add an instruction for it, and possibly POST as well. It is very manageable as a custom protocol, but I suspect using an HTTP server as a simple way of providing production content or recipes or whatever to the PLC would be very popular. What I learn from rolling the protocol in Do-more will make it pretty simple to do the instruction. Not sure when, but maybe DmD 1.1.

Thinking I might like to add a DNS lookup instruction as well, although everything I've read tells me to run away. We'll see. I think it would be very handy.

HTTP.Get and .Post would be very handy.  I'm doing a Get from the MMI on a project I'm doing now, and could easily see the PLC wanting to do one.

I think the lack of being able to talk to DNS servers shouldn't be a big deal.  If you really needed it, you could have some PC on the same network as the PLC resolve the IP address from the URL once a day or something and send the IP address to the PLC via Modbus or something.  They're not constantly changing or anything are they?
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 1833
  • YKPAIHA
    • ATU, Inc.
Re: SS memory and pointers
« Reply #24 on: October 13, 2012, 10:37:51 PM »
If you provided Post and Get, you could write a simple script (like in PHP) to access a database.
Would be simple and royalty free.

deep6ixed

  • Sr. Member
  • ****
  • Posts: 89
Re: SS memory and pointers
« Reply #25 on: October 15, 2012, 02:08:38 AM »
If you provided Post and Get, you could write a simple script (like in PHP) to access a database.
Would be simple and royalty free.

As a former webmaster who is familiar with PHP, I'd be more than happy to help with that side of things to make a PHP lib for MySQL access...

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 4680
  • Yes Pinky, Do-more will control the world!
Re: SS memory and pointers
« Reply #26 on: October 15, 2012, 02:26:55 PM »
Here is the first shot.

Put desired file in RequestFilename (SL0).

Put server address in ServerAddress (D0).

Toggle C0 to run it.

ReadFileSuccess or ReadFileFailure will be set on completion. On failure ReadFileErrMsg may contain useful info.

Result is in HttpDataFile. Max size is 1024 bytes.

There are two methods of reading the actual file employed. When the server returns Content-Length header, I do a one-shot read. If it isn't and the length is unknown, I read until the socket is closed. Either is valid based on the what the server does.

Probably won't enhance it more since I am leaning toward adding HTTPGET and HTTPPOST to DmD 1.1.

Enjoy. Comments welcome.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

plcnut

  • Hero Member
  • *****
  • Posts: 801
    • premiersi.com
Re: SS memory and pointers
« Reply #27 on: October 16, 2012, 12:56:14 PM »
Thank You very much Bob!

I'm looking forward to trying it out this afternoon.
Just waiting on FedEx...

I will let you know how it goes.
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

plcnut

  • Hero Member
  • *****
  • Posts: 801
    • premiersi.com
Re: SS memory and pointers
« Reply #28 on: October 16, 2012, 05:30:56 PM »
One little problem I have ran into. The dataview window, when set to ASCII, will not display, nor allow me to type an =(equal)sign. Is it just me or is something wrong?
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 2625
    • Host Engineering
Re: SS memory and pointers
« Reply #29 on: October 16, 2012, 07:53:55 PM »
The equal sign entry is a known bug.

You have to be online to the PLC to see the ASCII status, and turn status ON for the Data view.  Click on the Data View, then click on the Status sticky button to enable status for the current view (2nd toolbar from the top).