What is the simplest way to programmatically read/write PLC tags (in my case a Siemens S7-1200)? I am writing a custom software wedge that is to mediate between a CMM and PLC.
Thks,
z
If you enable Put/Get access in the S7-1200, then you can get easy access to "not optimized" datablock with many open source communication libraries for the S7-300/400 like Snap7 or libnodave.
The latest 1200 firmware versions support OPC UA access, but this needs to be licensed on the plc. Otherwise I'd say this should be the way to go in the future.
Another option is to enable the webserver on the S7, create a simple basic page with the variables you want to get access to, then you can read/write with http requests (write access after login). But the webserver is rather slow, if you want to read many values or get fast access.
Another option is to enable the webserver on the S7, create a simple basic page with the variables you want to get access to, then you can read/write with http requests (write access after login). But the webserver is rather slow, if you want to read many values or get fast access.
Thank you @Thomas_v2, my original plan is to use OPC-UA. It's giving me pause though, because it seems so indirect. I do like the security features it offers however.
Thank you @Thomas_v2, my original plan is to use OPC-UA. It's giving me pause though, because it seems so indirect. I do like the security features it offers however.
The documentation says "yes", but I haven't tested it. But you can create a fake JSON api even with older firmware versions by creating a custom .json page in JSON format, where you insert the values with the AWP syntax like:
As mk42 said, the OPC-UA server runs directly on the S7-1200 Plc, you can connect your OPC-UA client directly to the plc without any middleware. The license cost is about 50 € if im remember correctly. In percentage for the cost of the 1200 it's much if you have a low specced one, but for a 1500 it's not.