AnsweredAssumed Answered

Historic data imported via UFL (from CSV) not showing up in Pi Points

Question asked by CSonntag on Apr 8, 2020
Latest reply on Apr 14, 2020 by CSonntag

Hi, all,

 

I'm rather new to PI, so if the following question is easy to solve, please don't hold it against me :-)

 

I'm using UFL to import historic data from CSV files into a PI Data Archive (the tags already exist). The problem I'm having is that the PI tag only contains a single value after the import, with the last/newest time stamp in the file (as shown in SMT and in DataLink). All other timestamp-value pairs are missing.

 

The structure of the CSV files is rather simple. The name represents the PI tag I'm writing to (of the form "AB12_G3000_Filling--AI1__PV.csv", where I replace "--" with "/" and "__" with "." to get the real tag name "AB12_G3000_Filling/AI1.PV". The contents look like:

 

date,vals
02/02/2017-05:26:02,0
02/02/2017-06:30:46,10
02/02/2017-06:49:27,20
02/02/2017-08:06:38,0
02/02/2017-16:01:54,0
02/02/2017-17:36:51,10

...

 

The PI UFL ini file looks as follows:

 

[INTERFACE]
PLUG-IN=AsciiFiles.dll

[PLUG-IN]
IFM=C:\Work\PIData\Number\*.csv
IFS=N
REN=_OK
ERR=BAD
PURGETIME=1d
PFN=True
PFI=False
PFP=C:\Work\PIData\Processed
NEWLINE=13,10

[SETTING]
DEB=6
MAXLOG=10
MAXLOGSIZE=20
MSGINERROR=C:\Work\err_Number.log
OUTPUT=C:\Work\out_Number.log
LOCALE=en-us

[FIELD]
FIELD(1).NAME="TagName"
FIELD(1).TYPE="String"
FIELD(2).NAME="TimeStamp"
FIELD(2).TYPE="DateTime"
FIELD(2).FORMAT="dd/MM/yyyy-hh:mm:ss"
FIELD(3).NAME="Value"
FIELD(3).TYPE="Number"

[MSG]
MSG(1).NAME="Tag"
MSG(2).NAME="Data"

[Tag]
Tag.FILTER=C1=="V*"
TagName=C1 - C1(".")
TagName = REPLACE(TagName,"--","/")
TagName = REPLACE(TagName,"__",".")

[Data]
Data.FILTER=C1=="#*"
TimeStamp=["(*),*"]
Value=["*,(*)"]
PRINT ("TimeStamp is")
PRINT (TimeStamp)
StoreInPI(TagName, ,TimeStamp,Value, , )

 

The log file says that all pairs are imported to PI successfully, e.g.

 

...

08-Apr-2020 20:35:30 [PI_UFL] [Info] [Line 23 ] 03/02/2017-21:50:17,0.
08-Apr-2020 20:35:30 [PI_UFL] [Info] Write to PI : V020_R1000_Vorlag_THF/AI1.PV : time = 03-Feb-2017 21:50:17, value = 0., status = , flags = .

...

 

However, I do get a few error messages from the data archive (only very few) of the following form:

 

"Add event failed. Mode: 0, Point ID: 64, Rec ID: 0, Event time: 6-Feb-17 23:57:22, Value: S,O,A,S,Q [0,0,0,0,0]: Value = 8056.1, 8056.1. [-11043] No Archive On-Line For Target Time"

 

What am I doing wrong? Thanks very much for your help!

 

All the best,

 

Christian

Outcomes