Changing the name of the items?

We already have a system configured (MSSQL) where the tags are named; opcserver.opcgroup.opcitem.
Where is the mapping-file / table for the name of the “tags” in FactorySQL (column-name) and the name of the OPC-item?
Where is this stored? I can not find it in the database. Is it stored in a text-based configuration-file or something?

There is no mapping file. When you add an OPC item to a group, it creates the Field Name automatically using the OPC Item name (ignoring the rest of the OPC path), replacing any spaces or periods with underscores. The Field Name is used as the SQL database column name.

You can edit the Field Name of an item by single-clicking the item in the group box, or by double-clicking the item to display its edit box. The edit box will show you both its Field Name and its full Item Path (OPC path).


Ok, lets say that we have a structure like this:


This information is stored in a column in database. In another table i have the name of the opc-server linked to the MAT/KEP.

MAT: Is a Matricon opc server
KEP: Is a Kepware OPC server

I want is to keep this structure for now.
So what i want is a simple way to import this information into FactorySQL so that it automatically starts logging data to the database.
The name of the columns in the table should be named the same as the itemnames (removing . with _ is ok). Value, Quality and Timestamp must be logged for each item and the column names must end with _Values, _Quality and _TS.

It must be possible to change the configuration on the fly:
KEP:Building2.36001.TF90_Temp4 --> KEP:Building2.36001.TF90_Temp444

or add new items :

I want this automatically without any manual job being done with FactorySQL.
Is this possible? If so - do you have a good example of how to do this?


So (to be clear), you have your OPC addresses stored in a database table, and you want FactorySQL to read and log them.

Unfortunately, FactorySQL really doesn’t work like that. The primary use of FactorySQL is to create groups of items that write to the database. The configuration of the items is internal to FactorySQL.

The only part of FactorySQL’s configuration that is stored in the database would be the SQLTags configuration. SQLTags is a way for FactorySQL and FactoryPMI to share real-time tag status and control. However, the configuration and values are just tables in the DB. As I said, they’re just status, but we’ve had customers use them to do something close to what you want by periodically “snapshotting” the values into a history table. Ultimately, you wouldn’t be able to keep your existing table structure (though you could definitely use it to create the SQLTags the first time), but if that’s OK, you might be able to do it.


Ok, thanks for the anwer!

Just inserting a thought: would you be able to use a third party app like AutoIt to automate this somewhat? Once the script is debugged, you could certainly use it for future things, even compile the script into an EXE… again, just a thought.


1 Like