Applies To: |
|
Summary: |
According to the Citect help, every tag in a CitectSCADA project now has an associated Object ID (OID). The OID uniquely identifies the tag for use by tag-based drivers that read/write using tag names instead of addresses in the I/O device. How do OIDs work? |
Solution: |
When reading and writing tags, CitectSCADA
normally uses the address of each tag in internal client-server
communications. With tag-based drivers this is not possible, so the
variable.dbf file's record number for each tag was used instead.
This caused problems if the client and server had different record
numbers or if tags were defined in included projects and had the
same record numbers as other tags in other projects. In
CitectHMI/SCADA version 5.41, an OID for each tag is used instead.
For example, one I/O server is running ProjectA and another I/O server is running ProjectB. A display client is running a global project that includes ProjectA and ProjectB. This will now work. However, since OIDs combine an ID number and a project number you cannot combine tags from multiple projects into one. For example, if you tried to merge the tag lists from ProjectA and ProjectB into a single project on the display client, it would cause a compile error. Internal Usage of OIDs OIDs are values consisting of a project ID and an index number. CitectSCADA stores tag OIDs in variable.dbf in hexadecimal format. The next available index number is stored in oid.dbf in decimal format. OIDs are automatically created for all tags when the project is compiled. To create an OID, CitectSCADA converts the project ID into hexadecimal (see Project IDs subheading), multiplies by 0x400000 and adds the index value from oid.dbf. For example, if the project ID was 10 (0xA) and the index listed in oid.dbf was 17 (0x11), the next tag created would be assigned OID 0x02800011 (0xA * 0x400000 + 0x11) Currently, the following drivers use OIDs: OPC, SNMP, TPERM, DDE and ABLOGIX. It may be necessary to install an updated driver for OID support. Project IDs According to the Citect help, the Project ID is a unique number between 1 and 500 (1 to 1022 prior to version 6.10--See Q5405) that is automatically set for each project. This can be seen in the project properties form in the Citect Explorer. If you enter an ID that has already been used for another project, CitectSCADA will detect and correct this when it compiles the project. If you enter 0 or delete the ID number, your project ID will be set automatically the next time you compile. If multiple PCs have copies of the same project they must all have the same project ID. Otherwise, the resulting OIDs will be invalid. Project IDs are backed up and restored along with the rest of the project so this will only be a problem if another project has the same ID. CitectSCADA 5.50 no longer requires that all projects have unique IDs. However, if one project includes other projects, IDs must be unique among them. Editing Tags in the Project Editor When a tag is added, the OID is left blank. It will be set when the project is compiled. When a tag is deleted, its OID is not reused. In either case, you will not be required to reset the OIDs. Editing Tags in a 3rd Party Editor New tags should be added to the end of the database. The OID may be left blank as CitectSCADA will set the OIDs on the next compile. When a tag is deleted, its OID is not reused. Performance can be improved by sorting the tag list by I/O device, and then by data type. The OIDs, however, should not be moved. They must be kept in numerical order or a reset will be required. Resetting OIDs The [OID]Reset parameter causes all the tags to be renumbered consecutively on the next compile. After renumbering them, CitectSCADA automatically sets the Reset parameter value back to 0. When OIDs are reset, any other copies of the tag list (e.g. on client PCs) must be updated with the same OIDs. The following cases will cause a compile error that instructs the user to reset the OIDs:
Invalid OIDs The OID for each tag on the client must match the OID for that
tag on the server. For example, if you reset the OIDs in the
server's project but not the client's project, the client may
request an OID that now belongs to a different tag on the server
and display the wrong value. Or, the client may request an OID that
no longer exists on the server. In that case, it will display the
value as 0 with no error reported. CitectSCADA versions 6.00
and 6.10 have improved OID security. If the client and server OIDs
don't match, #COM will display instead of the wrong value or 0. See
Q4641 Since the tag database is cached in memory, the CitectSCADA runtime on the client(s) and server(s) needs to be restarted for OID changes to take effect. |
Keywords: |
Related Links
Attachments