Question

Hi I was searching the whole Internet, but I guess I'm not searching it right. I am trying to find dll or library or something that would help me, reading and writing values from a PLC(Siemens S7-1200 for example).

I found the Arduino (i think that is a middleware between a PLC and PC) in which functions like

pinMode
digitalWrite
analogRead 

gives me very easy to read and write to the pins. Is somehow possible to read/write data from/to PLC (Siemens S7-1200 ex.) with functions understandable for programmers. I know that it could be done with low-level programming like bitshifting and etc. but I am not familiar with it.

So is there reference, documentation or some code examples that should help me to understand how to turn on/off lights and read the value from the temperature sensor using C/C++/C# and understandable functions.

Thank you in advance

Was it helpful?

Solution

The easiest way to interact with PLCs of various brands is using OPC. The PLC acts as server and your program is the client. OPC has several interfaces and one of them is OPCDA which allows you to read/write data and to setup subscriptions of data events like getting a callback if a value changes.

You can read more at opcfoundation

If you do not want to use OPC you need to handle the protocol that the PLC supports, depending on PLC you will need to get hands on the specification. Often also PLCs have their own custom specialities (quirks) in the protocols so you would need to take care of them as well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top