Freelance OPC Regular Patterns AC800M
I want to know if anyone have an example for the regular pattern configuration for ABB AC800M OPC to use within Freelance OPC Regula Partitioning Pattern.
This is in order to solve the same problen indicated on the fallowing question:
Voted best answer
I do not have a ready pattern, but I can try to describe how you can create one on your own.
The patterns used in connection with Freelance OPC data access are Regular expressions.
A regular expression (or regex) is a formal language used to match any part of a given string.
A good explanation of the Regular Expression syntax can be found at the link below.
Freelance uses those regex patters to identify the different parts in an OPC item name. Because OPC servers from different vendors use different syntax to build the OPC item name one needs something configurable to be able to extract the Tag name out of them.
Because a Tag consists of several components you need to identify the common Tagname out of several components represented in the OPC server as OPC items. And you also need to idebtify the component name out of a given OPC item name to identify whether you have the measuring range start or measuring range end or Input or Output etc at hand.
Those components are called Selectors in Freelance.
Therefore the OPC Regular Pattern dialog allows you to define 4 regex patterns to identify Prefix (the part befor the tag), Tag, Selector and Postfix (the part after the selector) within an OPC Item name
In Freelance, because Tags and Variables are unique within a system, the OPC server represents Tags as "Tagname/Selector", without identifying the Process station. Therefore the Prefix pattern is empty (not needed). The Tag part specifies the part of the OPC item name from the start till the first "/" which represents the Tagname. The regex pattern for this would be ([^/]*) which matches zero any number of characters except the "/". The "(" and ")" define a subexpression. The Selector is defined by /([^/]*) which matches the "/" before the second subexpression similar to the first.
So the whole OPC item name can be writen as ([^/]*)/([^/]*) where the two subexpressions identify Tagname and Selectorname.
For the AC500, the OPC Item name is defined as "PLCname.Taskname.Tagname.Selector". So here you need a Prefix pattern to match "PLCname.TaskName" The whole pattern that makes up the OPC item name is then
(.*)\.([^\.]*)\.([^\.]*). The last 2 subexpressions identify Selector and Tagname.
The "\." identifies the "." literally because the normal "." would actually mean any character.
For a pattern for AC 800M you need to find out how an OPC item name is constructed and then create the matching patterns for the parts. A short description of the language elements used is also available in the Engineering IEC61131-3 Manual, section OPC Items.