Dear Community,
yet another question for you; regarding the Beckhoff TwinCat driver;
I only want to import OPC Variables which I have marked/commented in TwinCat.
I commented them as intented for the OPC-Import:
(*~ (OPC:1:available for OPC Clients)(OPC_PROP[0005] : 1 : read only)*)
Unfortunately, when I import the device with
"Respect OPC Read/Write Item Properties", "Respect Tag Case On Import" and "Only Import Variables Marked for OPC" enabled no tags at all are created.
Why? Am I doing something wrong? I do not have any additional filters configured.
Thanks in advance for your help.
Kind regards,
Kepware User
Looking at the following syntax examples the filtering comment should look like: VariableName:INT; (*~(OPC:1))
Filtering in Beckhoff Twincat 3 is used to limit the number of tags that are brought into KepServer when ATGing. The use of filters is optional can be set in the 'Symbolic Settings' page of the device properties. See the Beckhoff driver help file for the particulars of how to use that interface.
Filtering and commenting in Beckhoff Twincat 3 Projects is somewhat difficult to understand for end users. This is because the syntax is somewhat open, as well as the existence of bugs in the Twincat 3 software, and potentially bugs in the KepServer software as well.
This page is an attempt to document the various behaviors and create ways to work around them when the behaviors are unexpected.
The default OPC filtering syntax in a Twincat 3 project is:
VariableName:INT; // ~(OPC:1)
OR
VariableName:INT; (*~(OPC:1))
Note: The tilde character (~) is a marker to indicate that the text which follows it should not be made visible in a client.
The default OPC comment syntax is:
VariableName:INT; // comment
OR
VariableName:INT; (* comment *)
These can be used together, most typically with the following syntax:
VariableName:INT; // comment ~(OPC:1)
OR
VariableName:INT; (*comment ~(OPC:1)*)
There is also a syntax for combining the comment with the filter:
VariableName:INT; // ~(OPC:1:comment)
(though, in this case, because the comment is after the tilde, it should not be carried to the client.
Thanks,
*Chris