mhruzik

PI Connector for UFL 1.3: Unicode(UTF-8) support, statuses, REST headers

Blog Post created by mhruzik Employee on Jun 12, 2018

A new version of PI Connector for UFL is now available. The highlight of this release is added support for Unicode (UTF-8) input.

 

What’s new in PI Connector for UFL 1.3?

- Unicode (UTF-8) support

- Status in StoreEvent (StoreEvents) functions is now mapped to the System Digital Set

- HTTP GET support HTTP Headers in REST Client configuration

 

Unicode (UTF-8) support

Encoding parameter has been added to Data Source configuration options.

It can be set to:
Extended ASCII - processes ASCII encoded data stream. This is the default setting and preserves the original connector behavior.
Unicode (UTF-8) - process UTF-8 encoded data stream.

 

PI and UTF-8 support - UTF-8 characters are supported by PI AF Server. Therefore, UTF-8 strings can be used in Element names, Attribute names, Event Frame names and static attribute values.
Limitations - UTF-8 characters cannot be used in the connector configuration file (.INI), Template names, PI Tag names, and data stored in PI. Furthermore, UTF-8 encoded strings cannot be manipulated using the string functions (CHAR(), REPLACE(), SUBSTR() etc.)

 

utf8.jpg

 

 

Enhanced support of Status values

With UFL Connector version 1.2 or older, every non-zero Status value specified in StoreEvent or StoreEvents function got represented as "Bad" status in the PI System. In version 1.3+, any status from System Digital set can be used.


Custom Status values can be specified by using a string (for example - "Manual") or by a number (for example, 224 resolves to "Bad Quality").

 

StoreEvent("Tag1",,Timestamp,Value,224)
StoreEvent("Tag1",,Timestamp,Value,"Manual")

 

And just as before, if the Status is Good (status value equals 0), the actual value obtained from the data source is stored in PI.

 

HTTP Headers in GET requests
Some servers require custom HTTP headers in the incoming GET request. These can be specified in %PIHOME64%\Connectors\UFL\Configuration\Datasource.config.json file.
The HttpHeaders list is present for each data source and it's empty by default.

 

In the example below, two custom HTTP headers are specified. Each HTTP header needs to be enclosed in square brackets. Multiple headers are separated by a comma.

"HttpHeaders": "[User-Agent:OSISoft UFL Connector/1.2.1.x], [Accept:application/vnd.noaa.dwml+json;version=1]"

 

------------------------------------------------------------------------------------------------------------------------------------------

FULL LIST OF CHANGES

Enhancements:

    WI# 189070 - UTF-8 encoding support of the textual input.

    WI# 190253 - Updated JSON parser.

    WI# 203682 - The status parameter in StoreEvent() is now mapped to the PI System Digital Set.

    WI# 195701 - Option to specify custom HTTP headers has been added to REST Client channel configuration.

Bug Fixes:

    WI# 197293 - In certain rare cases, if the PI Connector receives a stream name with trailing space, after a restart of the process, the data flow can stop with this error message "The given key was not present in the dictionary.". This is now fixed.

    WI# 193952 - AF buffer is not blocked when a message with an unsupported character in AF attribute name gets posted. Such a message will be discarded and AF buffer drain will continue.

    WI# 186556 - The IsNumber() function now recognizes the Locale setting.

    WI# 194120 - SECONDS_GMT and SECONDS_LOCAL are now independent on the Incoming TimeStamps option on the connector config. page.

    WI# 196204 - NULL values in the Collection-type variables are now ignored.

    WI# 196693 - Performance of FOREACH() construct has been improved.

------------------------------------------------------------------------------------------------------------------------------------------

Do you have ideas for enhancements or new features? We'd like to hear from you!
Please let us know here on PI Square or User Voice. The most up-voted item has been interactive editor for configuration files (INI), so that's our priority for the next release. If you need an inspiration for your INI file, take a look to our GitHub repository.

Outcomes