News:

  • October 14, 2025, 08:42:11 AM

Login with username, password and session length

Author Topic: Communications with WebServices?  (Read 4988 times)

Bobby

  • Sr. Member
  • ****
  • Posts: 60
Communications with WebServices?
« on: July 12, 2016, 02:40:52 PM »
Hello all,

   I have a client that is requesting the use of webservices to communicate instead of TCP/IP. Are there any PLC's on the market that do this? What really is it anyways? I am just trying to come up with a good response as to why we do not support it so his IT team can grasp it this time.

plcnut

  • Hero Member
  • *****
  • Posts: 813
    • premiersi.com
Re: Communications with WebServices?
« Reply #1 on: July 12, 2016, 03:14:12 PM »
I do it regularly with Do-more. It is done using the custom protocol tools that are built into DMD.
What web service is he wanting to talk to? Or is it a server running custom software?
The part that can cause trouble is dealing with security.
These are the kind of projects that I enjoy ;D
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: 6126
  • Yes Pinky, Do-more will control the world!
Re: Communications with WebServices?
« Reply #2 on: July 12, 2016, 04:13:47 PM »
As was mentioned, Do-more is well capable of implementing web servers or clients through the custom protocol tools.

The reason we haven't built anything in was because we really weren't sure what people wanted. If you are looking for simple status and/or port configuration, that isn't particularly hard and is something that we want to add in the not-to-distant future, probably the release after we ship our new platform. If you are talking about a full web facility where you can create your own pages and do back end queries into the PLC, that is far more involved and takes a lot of development resources that we don't have at the moment.

Regardless, hanging a PLC on the web with exposed ports is begging for trouble. There are many not-so-nice people out there that want to hurt you or your plant. I'm not at liberty to share some situations I am aware of, but here's the summary: Things have been hacked and people have died. It isn't a huge problem when a DoS attack dogs a web store server or enterprise network, but when that DoS attack is preventing your PLC from doing its job properly, that's a problem.
"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: 6126
  • Yes Pinky, Do-more will control the world!
Re: Communications with WebServices?
« Reply #3 on: July 12, 2016, 04:25:24 PM »
And just to clarify, Do-more PLCs haven't been involved, we're just aware of some situations through discussions with others, in and out of government. The DHS has made steps to help infrastructure technology providers become more aware of vulnerabilities, and we've made several changes to help harden our products.
"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

Bobby

  • Sr. Member
  • ****
  • Posts: 60
Re: Communications with WebServices?
« Reply #4 on: July 13, 2016, 09:21:10 AM »
Thanks for the input both of you. I will explain what we do and see if you think it would be simple to setup since I am a noob with it.

All I do when a "package" is released from our equipment is STREAMOUT a message about that package. IE. "OrderID,PKGWidth,PKGLength,PKGWeight,ExitID<CR/LF>" Then I look for a response back with "Carrier#,ExitID<CR/LF>".

Is that something I could easily handle with webservices? How would I go about setting something up like this?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6126
  • Yes Pinky, Do-more will control the world!
Re: Communications with WebServices?
« Reply #5 on: July 13, 2016, 09:46:03 AM »
I'm still not fully clear by what you mean by "webservices". If you are asking whether it would be possible to connect to a webserver, send a command/request string, and receive back a response, the answer is an unqualified "yes". The question of what web service you are planning to have do the back end work is something that your IT guys have to answer. Once we know what that is, we could probably give you more specifics.

For the record, plcnut has done exactly that a bunch of times.
"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

Bobby

  • Sr. Member
  • ****
  • Posts: 60
Re: Communications with WebServices?
« Reply #6 on: July 13, 2016, 09:50:23 AM »
Got you, so this would require someone to write software separate from the plc to handle the communications? Usually our customers either hire someone to write some middleware or we hire someone to do it for them. I usually just send the data through a tcp port and that is easy for me. I am just trying to get some idea of how much work would be involved on the PLC end of it. I am confused in general and was just told "webservices" by them. I am guessing that is a broad term...

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6126
  • Yes Pinky, Do-more will control the world!
Re: Communications with WebServices?
« Reply #7 on: July 13, 2016, 10:02:23 AM »
Middleware? Not necessarily, unless you consider OTS stuff like MySQL to be middleware.

From the PLC's standpoint it is quite easy. OPENTCP to establish the session. STREAMOUT to send. STREAMIN to get the response. CLOSE to terminate the session.  Use Stage programming, and create a dedicated program block to do the work. RUN the program when needed, and be sure to EXIT the program when done. There are projects in the example section that demonstrate it, and we're happy to answer questions.
"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

Bobby

  • Sr. Member
  • ****
  • Posts: 60
Re: Communications with WebServices?
« Reply #8 on: July 13, 2016, 10:15:53 AM »
I could probably handle MySQL sure. We build packaging equipment for mainly online companies like gamestop for example. So we need to communicate with there warehouse management systems to get order information & Carrier data. That is why we usually have a middle ware since none of us do any computer programming. Each customer seems to always have a different warehouse management system and the one is question apparently uses a cloud based one. I will dig into some examples and see if it would be something we could do here.

And thanks for all the responses! I love the do-more plc and find it a joy to work with. I am still learning all the technical stuff like this one though. I just want to be able to give educated responses.

plcnut

  • Hero Member
  • *****
  • Posts: 813
    • premiersi.com
Re: Communications with WebServices?
« Reply #9 on: July 13, 2016, 10:30:12 AM »
The preferred method would be to use a local server (on the same LAN as the PLC) that would communicate with the cloud-based service. This server would be responsible for the security of the system. The PLC would talk to the local server, and then the server would talk to the cloud. This is how I have done it.
The PLC is perfectly capable of talking directly to the cloud, but that is where you get into security vulnerabilities.
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: 6126
  • Yes Pinky, Do-more will control the world!
Re: Communications with WebServices?
« Reply #10 on: July 13, 2016, 03:01:54 PM »
If you are trying to get from the PLC to random unknown cloud based servers, then yes, a semi standard middleware approach might be best. Write the PLC facing interface to a standard of your choosing, then tailor the back end to the changing target. The PC running the middleware bridges the internal and external networks and keeps ugly stuff of your control network.
"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