Applies To: |
|
Summary: |
I wish to import only a selection of tags
via the OPC/Unity via OFS "Tag Import" feature, rather than all
items that belong to a specific branch. For instance, I am using OFS, and would like to import only the variables that contain "ImportMe" in the Comment field. How can I achieve this? |
Solution: |
The "Unity Speedlink via OFS" tag
import feature relies on the OFS.fmt file that is located in the
Bin directory (v6.x and v7.0) or in the config directory
(>v7.1). Before any modification, you need to take the following points in consideration: - the customisation of the xxxx.fmt files is not supported practice and therefore not in the help. - If you still wish to customise the tags import, we would strongly recommend backing up the original fmt file. If you decide to customise the xxx.fmt file, so as not to import all OPC items but only certain tags containing a specific string in the "comment" field, please follow the following steps: 1- open the OFS.fmt file in notepad 2- The [ImportFilterMap] section is the one we need to work on. If you wish to work with the Comment Field, then we need to modify the line starting with Comment2Comment. We should modify this line to be: ModComment = CommentString -> Comment ModCustom being a generic name which points to a new section that will be labelled [ModComment] 3- Add the [ModComment] section, and add the following line: UnityComment = *ImportMe* -> Tag imported from OFS - UnityComment is a generic name as well - . *ImportMe* means that only the Unity variables having a comment field that contains "ImportMe" will be imported. ! the filter is case sensitive ! - "Tag imported from OFS" is the value that will be given to the equivalent Comment field in VijeoCitect. If you wish to import the Unity native comment, then you should leave this blank, ie: UnityCustom = *ImportMe* 4- Save the file and try the import again. In summary, the file should look something like: ==================================== .... (missing header) [Columns] ItemName = 79 -> STRING CanonicalDataType = 16 -> STRING ItemAddress = 128 -> STRING CustomString = 128 -> STRING CommentString = 48 -> STRING [ImportFilterMap] TagName2Name = ItemName -> Name Canonical2Type = CanonicalDataType -> Type TagName2Addr = ItemAddress -> Addr Custom2Custom = CustomString -> Custom ModComment = CommentString -> Comment [ModComment] UnityComment = *ImportMe* -> Tag imported from OFS [Canonical2Type] VT_NULL = 1 -> STRING VT_I2 = 2 -> INT VT_I4 = 3 -> LONG VT_R4 = 4 -> REAL VT_R8 = 5 -> STRING VT_CY = 6 -> STRING VT_DATE = 7 -> STRING VT_BSTR = 8 -> STRING VT_DISPATCH = 9 -> STRING VT_ERROR = 10 -> LONG VT_BOOL = 11 -> DIGITAL VT_VARIANT = 12 -> STRING VT_UNKNOWN = 13 -> STRING VT_DECIMAL = 14 -> STRING VT_I1 = 16 -> STRING VT_UI1 = 17 -> BYTE VT_UI2 = 18 -> UINT VT_UI4 = 19 -> ULONG VT_I8 = 20 -> STRING VT_UI8 = 21 -> STRING VT_INT = 22 -> INT VT_UINT = 23 -> UINT VT_VOID = 24 -> STRING VT_HRESULT = 25 -> STRING VT_PTR = 26 -> STRING VT_SAFEARRAY = 27 -> STRING VT_CARRAY = 28 -> STRING VT_USERDEFINED = 29 -> STRING VT_LPSTR = 30 -> STRING VT_LPWSTR = 31 -> STRING VT_FILETIME = 64 -> STRING VT_BLOB = 65 -> STRING VT_STREAM = 66 -> STRING VT_STORAGE = 67 -> STRING VT_STREAMED_OBJECT = 68 -> STRING VT_STORED_OBJECT = 69 -> STRING VT_BLOB_OBJECT = 70 -> STRING VT_CF = 71 -> STRING VT_CLSID = 72 -> STRING VT_VECTOR = 0x1000 -> STRING VT_ARRAY = 0x2000 -> STRING VT_UCHAR_ARRAY = 8209 -> STRING VT_BYREF = 0x4000 -> STRING VT_RESERVED = 0x8000 -> STRING VT_ILLEGAL = 0xffff -> STRING VT_ILLEGALMASKED = 0xfff -> STRING ============================================= The same similar steps apply to any other import database type, such as Unity Speedlink Static and Unity Speedlink Dynamic. Please read KB Q5424 for more information. It should be noted that some of the fields are supported only with .stu files, and not with .xvm files (eg the "custom" field) |
Keywords: |
FMT, OFS, Speedlink, stu,
import |
Related Links
Attachments