AnsweredAssumed Answered

PI UFL connector - help with Timestamp collection

Question asked by j36701 on Oct 28, 2020
Latest reply on Oct 29, 2020 by ChristophRose

Hi, 

I'm pretty new to PI UFL and defining .ini-files. However, I made som progress parsing the following file: 

Start-message
Id=LvnG0061x3-20201026094407
Message-type=Settlement-data
Version=1.2
Time=2020-10-26.09:44:07
From=LvnG0061x3
GMT-reference=1
Time-series
Reference=LVN-G0.061.3-NIVÅ-U-1T
Start=2020-10-25.11:00:00
Stop=2020-10-26.11:00:00
Step=0000-00-00.01:00:00
Value=<
273.43//
273.42//
273.42//
273.42//
273.41//
273.41//
273.4//
273.4//
273.4//
273.39//
273.39//
273.38//
273.38//
273.37//
273.37//
273.36//
273.36//
273.36//
273.35//
273.35//
273.35//
273.35//
273.35//
273.35//
>
No-of-values=24
Sum=6561.17
End-message
Number-of-objects=1

With this .ini-file:

'============Define Variables========= 
[FIELD]
FIELD(1).NAME="TagName"
FIELD(1).TYPE="String"
FIELD(2).NAME="Timestamp"
FIELD(2).TYPE="DateTime"
FIELD(2).FORMAT="yyyy-MM-dd.hh:mm:ss"
FIELD(3).NAME="Value"
FIELD(3).TYPE="Number"
'================Define Message Statements===========
[MSG]
MSG(1).NAME="GetTagName"
MSG(2).NAME="GetTimeStamp"
MSG(3).NAME="GetValue"
'================Extract Variables and Store PI Points===========
[GetTagName]
GetTagName.FILTER = C1=="From=*"
TagName = ["From=(*)"]
[GetTimeStamp]
GetTimeStamp.FILTER = C1=="Start=*"
Timestamp = ["Start=(*)"]

[GetValue]
GetValue.FILTER = C1==" *//"
Value = [" (*)//"]
StoreInPI(TagName, , Timestamp, Value)

This gives me the TagName "LvnG0061x3" with Timestamp "2020-10-25.11:00:00" and Value "273.43". Since I'm interested in all the values in the file I need to figure out how I can construct a collection of Timestamps based on the Start, Stop and Step information in the input file. Or if it´s possible to construct Timestamps from enumeration of the Values or length of Value-array? Any ideas or examples that can give some guidance? 

 

Regards ///Jonas  

Outcomes