I am creating a Web API for a local network in the .net framework(C#). In that user can import/export IO Tags from excel or set them as a static string array. I have added (Siemens.Engineering.Hmi.dll) but still, it shows a not found compile-time error.
We have also connected to TIAPortal and it works well the only roadblocks are I/O tags import/export or set static values and HMISoftware.
Project: Web API(.Net Framework 4.6.1)
Tia Portal: v16.0
License Type: Trial
Kindly revert me if anyone have idea or any suggestion. It would be highly appriciated.
The issue you are experiencing is that (most probably) you didn't set the
copy local
property of the referenced Siemens.Engineering.Hmi.dll to false. So, the dependencies of the referenced Siemens.Engineering.Hmi.dll cannot be found. As a remark: add the Siemens.Engineering.dll as a reference besides Siemens.Engineering.Hmi.dllHaving a not-local-assembly then requires
AssemblyResolving
. The simplest way of doing it is to use the App.config file.Please see this page from Siemens about this topic: support.industry.siemens.com
The second issue I see is the access of Tags. As you most certainly know, there are HMI Tags and PLC Tags. Accessing them is possible through the respective
DeviceItems
. TheseDeviceItems
expose differentServices
. You can access theServices
through the<YourEngineeringObject>.GetService<T>()
method. In this case you will need theSoftwareContainer
service.To become familiar with the data model of TIA Openness, please have a look at the TIA Openness Explorer
Also, to deepen your understanding of working with TIA Openness, please refer to SIMATIC TIA Portal Openness: API for automation of engineering workflows