In this tips and tricks post I will demonstrate the usage of the attribute: ‘instance-path’. The instance path attribute allows you to get the instance path of the containing POU in a string variable. Something I find particularly useful for error-logs and debug messages. How to use it 1. We need a string variable which […]
Tag: Attributes
Invoking RPC methods with TwinCAT ADS .NET
RPC method are methods in TwinCAT which can called from outside the scope of your application. For example an OPC UA client or an ADS client. In this post I show how to invoke RPC methods in your TwinCAT PLC from a .NET application.
Keep your online view clean: The hiding attributes
In the post ‘How to use monitoring attributes’ I showed how to use the monitoring attributes: attribute ‘monitoring’ := ‘variable’ and attribute ‘monitoring’ := ‘call’. With these pragma attributes we can monitor and modify our function blocks properties. This comes however with a small drawback. As the online view now shows your properties and their backing fields your online view gets less clear. In this post I will show how to solve this with the hiding attributes.
How to use monitoring attributes
Every programmer spends a considerable amount of time debugging their software. In the world of PLC programming it’s common to login to the PLC and monitor and write your variables. However, with the introduction of properties for your function blocks monitoring is not as plain as it used to be. In this post I’ll explain how to use monitoring attributes for your properties in TwinCAT.