AnsweredAssumed Answered

UFL Interface. One instance for two data structures. StoreInPi writes empty data.

Question asked by Piotr_Stach on Feb 16, 2017
Latest reply on Feb 22, 2017 by cramsey

Hi everyone.

I have a little problem with UFL Interface.

 

I have two structures od data (*.csv files).

First:

Station,"",PR1M[mm],WABS[g]
01001,2011-10-11 22:41,0.026,1445.872
01001,2011-10-11 22:42,0.021,1446.295
01001,2011-10-11 22:43,0.016,1446.617
01001,2011-10-11 22:44,0.013,1446.879
01001,2011-10-11 22:45,0.018,1447.229
01001,2011-10-11 22:46,0.027,1447.773

 

Second, which has more data than the first:

Station,"",PR1M[mm],SD1M[s],RH[%],DM1M[deg],WD1M[deg],DX1M[deg],WS1M[m/s],SX1M[m/s],TA[deg],PA[hPa],WABS[g]
00000,2014-05-21 05:05,0.000,60,39,336,155,312,0.9,1.8,17.8,1004.6,1531.417
00000,2014-05-21 05:06,0.000,60,39,336,157,333,0.9,1.8,17.9,1004.6,1531.383
00000,2014-05-21 05:07,0.000,60,39,1,152,336,0.8,1.8,17.9,1004.6,1531.368
00000,2014-05-21 05:08,0.000,60,39,333,152,312,0.8,1.8,18.0,1004.5,1531.361
00000,2014-05-21 05:09,0.000,60,39,333,156,312,0.9,1.8,18.1,1004.6,1531.349

 

I've prepared .ini file as below.

[INTERFACE]
PLUG-IN=AsciiFiles.dll

[PLUG-IN]
IFM=C:\Program Files\PIPC\Interfaces\PI_UFL\TEST\Dane\*.csv
IFS=N
REN=_OK
ERR=BAD
PURGETIME=1d
PFN=False
NEWLINE=13,10

[SETTING]
DEB=6
MAXLOG=10
MAXLOGSIZE=20
MSGINERROR=C:\Program Files\PIPC\Interfaces\PI_UFL\TEST\Out\err.log
OUTPUT=C:\Program Files\PIPC\Interfaces\PI_UFL\TEST\Out\out.log
LOCALE=en-us

[FIELD]
'Nazwa punktu pomiarowego
FIELD(1).NAME="TITLE"
FIELD(1).TYPE="String"
'Data i czas
FIELD(2).NAME="TIME"
FIELD(2).TYPE="DateTime"
FIELD(2).FORMAT="yyyy-MM-dd hh:mm"
'PR1M[mm]
FIELD(3).NAME="PR1M"
FIELD(3).TYPE="Number"
'WABS[g]
FIELD(4).NAME="WABS"
FIELD(4).TYPE="Number"
'SD1M[s]
FIELD(5).NAME="SD1M"
FIELD(5).TYPE="Number"
'RH[%]
FIELD(6).NAME="RH"
FIELD(6).TYPE="Number"
'DM1M[deg]
FIELD(7).NAME="DM1M"
FIELD(7).TYPE="Number"
'WD1M[deg]
FIELD(8).NAME="WD1M"
FIELD(8).TYPE="Number"
'DX1M[deg]
FIELD(9).NAME="DX1M"
FIELD(9).TYPE="Number"
'WS1M[m/s]
FIELD(10).NAME="WS1M"
FIELD(10).TYPE="Number"
'SX1M[m/s]
FIELD(11).NAME="SX1M"
FIELD(11).TYPE="Number"
'TA[deg]
FIELD(12).NAME="TA"
FIELD(12).TYPE="Number"
'PA[hPa]
FIELD(13).NAME="PA"
FIELD(13).TYPE="Number"
'Rodzaj danych: deszczomierz, stacja pogodowa
FIELD(14).NAME="DATA_TYPE"
FIELD(14).TYPE="String"

[MSG]
MSG(1).NAME="LINE_CHECK_DESZCZ"
MSG(2).NAME="LINE_CHECK_STACJA"
MSG(3).NAME="LINE_DESZCZ"
MSG(4).NAME="LINE_STACJA"

[LINE_CHECK_DESZCZ]
LINE_CHECK_DESZCZ.FILTER=C21 == "WABS*"
DATA_TYPE="DESZCZ"

[LINE_CHECK_STACJA]
LINE_CHECK_STACJA.FILTER=C21 == "SD1M*"
DATA_TYPE="STACJA"

[LINE_DESZCZ]
LINE_DESZCZ.FILTER=C11=="-" AND C14 == "-" AND C20 == ":"
IF(DATA_TYPE == "DESZCZ") THEN
TIME=["*,(*),*,*"]
PR1M=["*,*,(*),*"]
WABS=["*,*,*,(*)"]
StoreInPI("TEST_TAG21", ,TIME,PR1M, , )
StoreInPI("TEST_TAG22", ,TIME,WABS, , )
ENDIF

[LINE_STACJA]
LINE_STACJA.FILTER=C11=="-" AND C14 == "-" AND C20 == ":"
IF(DATA_TYPE == "STACJA") THEN
TITLE=["(*),*,*,*,*,*,*,*,*,*,*,*,*"]
TIME=["*,(*),*,*,*,*,*,*,*,*,*,*,*"]
PR1M=["*,*,(*),*,*,*,*,*,*,*,*,*,*"]
SD1M=["*,*,*,(*),*,*,*,*,*,*,*,*,*"]
RH=["*,*,*,*,(*),*,*,*,*,*,*,*,*"]
DM1M=["*,*,*,*,*,(*),*,*,*,*,*,*,*"]
WD1M=["*,*,*,*,*,*,(*),*,*,*,*,*,*"]
DX1M=["*,*,*,*,*,*,*,(*),*,*,*,*,*"]
WS1M=["*,*,*,*,*,*,*,*,(*),*,*,*,*"]
SX1M=["*,*,*,*,*,*,*,*,*,(*),*,*,*"]
TA=["*,*,*,*,*,*,*,*,*,*,(*),*,*"]
PA=["*,*,*,*,*,*,*,*,*,*,*,(*),*"]
WABS=["*,*,*,*,*,*,*,*,*,*,*,*,(*)"]
StoreInPI("TEST_TAG1", ,TIME,PR1M, , )
StoreInPI("TEST_TAG2", ,TIME,SD1M, , )
StoreInPI("TEST_TAG3", ,TIME,RH, , )
StoreInPI("TEST_TAG4", ,TIME,DM1M, , )
StoreInPI("TEST_TAG5", ,TIME,WD1M, , )
StoreInPI("TEST_TAG6", ,TIME,DX1M, , )
StoreInPI("TEST_TAG7", ,TIME,WS1M, , )
StoreInPI("TEST_TAG8", ,TIME,SX1M, , )
StoreInPI("TEST_TAG9", ,TIME,TA, , )
StoreInPI("TEST_TAG10", ,TIME,PA, , )
StoreInPI("TEST_TAG11", ,TIME,WABS, , )
ENDIF















 

First type of data works correctly (line 80-88). All data are written to PI Archive.

 

The problem appears, when I want to get data from the second type of csv file.

Something goes wrong between line 90 - 117 in the above code

StoreInPI writes empty data (Log file line 68)

Out log below.

 

15-Feb-2017 14:52:45 [PI_UFL] [Info] Begin reading PI point updates.
15-Feb-2017 14:52:45 [PI_UFL] [Info] End reading PI point updates.
15-Feb-2017 14:52:45 [PI_UFL] [Info] Begin scan.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] C:\Program Files\PIPC\Interfaces\PI_UFL\TEST\Dane\Stacja_ok.csv file will be processed.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] _5_Stacja_ok.csv file open.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] [Line  1 ] Station,"",PR1M[mm],SD1M[s],RH[%],DM1M[deg],WD1M[deg],DX1M[deg],WS1M[m/s],SX1M[m/s],TA[deg],PA[hPa],WABS[g].
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] [Line  2 ] 00000,2014-05-22 10:43,0.000,60,40,351,144,288,3.8,8.4,28.7,1000.2,1398.843.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] [Line  3 ] 00000,2014-05-22 10:44,0.000,60,40,351,146,288,4.0,8.7,28.7,1000.3,1398.678.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] [Line  4 ] 00000,2014-05-22 10:45,0.000,60,40,351,145,288,4.0,8.7,28.7,1000.2,1398.519.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] [Line  5 ] 00000,2014-05-22 10:46,0.000,60,40,351,145,288,4.0,8.7,28.6,1000.2,1398.281.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] [Line  6 ] 00000,2014-05-22 10:47,0.000,60,40,351,147,288,4.2,9.3,28.7,1000.2,1398.169.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] [Line  7 ] 00000,2014-05-22 10:48,0.000,60,40,351,150,288,4.3,9.3,28.7,1000.2,1398.127.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] [Line  8 ] 00000,2014-05-22 10:49,0.000,60,40,351,151,278,4.3,9.3,28.6,1000.2,1397.769.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] [Line  9 ] 00000,2014-05-22 10:50,0.000,60,40,351,151,292,4.4,9.3,28.6,1000.2,1397.605.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] [Line  10 ] 00000,2014-05-22 10:51,0.000,60,40,64,153,292,4.5,9.3,28.7,1000.2,1397.453.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] [Line  11 ] 00000,2014-05-22 10:52,0.000,60,40,37,154,322,4.3,9.3,28.7,1000.2,1397.226.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] [Line  12 ] 00000,2014-05-22 10:53,0.000,60,40,37,153,322,4.3,9.3,28.8,1000.2,1397.084.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] [Line  13 ] 00000,2014-05-22 10:54,0.000,60,40,37,153,322,4.3,9.3,28.8,1000.1,1396.950.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] [Line  14 ] 00000,2014-05-22 10:55,0.000,60,40,37,154,322,4.3,9.3,28.8,1000.2,1396.779.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] [Line  15 ] 00000,2014-05-22 10:56,0.000,60,40,37,156,322,4.5,9.5,28.8,1000.2,1396.661.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] [Line  16 ] 00000,2014-05-22 10:57,0.000,60,40,37,155,322,4.3,9.5,28.8,1000.2,1396.446.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] [Line  17 ] 00000,2014-05-22 10:58,0.000,60,40,37,156,322,4.3,9.6,28.8,1000.1,1396.238.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] [Line  18 ] 00000,2014-05-22 10:59,0.000,60,40,37,157,322,4.4,9.6,28.8,1000.1,1396.170.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] [Line  19 ] 00000,2014-05-22 11:00,0.000,60,40,37,158,322,4.4,9.6,28.8,1000.2,1396.029.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] [Line  20 ] 00000,2014-05-22 11:01,0.000,60,40,350,156,322,4.2,9.6,28.8,1000.2,1395.806.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] [Line  21 ] 00000,2014-05-22 11:02,0.000,60,40,350,156,271,4.3,9.6,28.8,1000.2,1395.611.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] [Line  22 ] 00000,2014-05-22 11:03,0.000,60,40,350,156,271,4.3,9.6,28.9,1000.0,1395.524.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] [Line  23 ] 00000,2014-05-22 11:04,0.000,60,40,350,154,271,4.2,9.6,28.9,1000.1,1395.451.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] [Line  24 ] 00000,2014-05-22 11:05,0.000,60,40,350,155,271,4.3,9.6,28.9,1000.1,1395.167.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] [Line  25 ] 00000,2014-05-22 11:06,0.000,60,40,350,154,271,4.1,9.6,28.9,1000.1,1394.973.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] [Line  26 ] 00000,2014-05-22 11:07,0.000,60,40,350,156,271,4.3,9.6,28.9,1000.2,1394.805.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] [Line  27 ] 00000,2014-05-22 11:08,0.000,60,40,350,153,271,4.2,9.4,28.9,1000.2,1394.718.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] [Line  28 ] 00000,2014-05-22 11:09,0.000,60,40,350,151,271,4.0,9.4,28.9,1000.1,1394.585.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] [Line  29 ] 00000,2014-05-22 11:10,0.000,60,40,350,152,271,4.2,9.4,28.9,1000.1,1394.266.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] [Line  30 ] 00000,B799A9C21474D237E58495B23044D4BE.
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] _5_Stacja_ok.csv file closed. 30 line(s) read.
15-Feb-2017 14:52:45 [PI_UFL] [Info] PL_GetBufferedData() 30 data lines read.
15-Feb-2017 14:52:45 [PI_UFL] [Info] [Line  1 ] Station,"",PR1M[mm],SD1M[s],RH[%],DM1M[deg],WD1M[deg],DX1M[deg],WS1M[m/s],SX1M[m/s],TA[deg],PA[hPa],WABS[g].
15-Feb-2017 14:52:45 [PI_UFL] [Info] [Line  2 ] 00000,2014-05-22 10:43,0.000,60,40,351,144,288,3.8,8.4,28.7,1000.2,1398.843.
15-Feb-2017 14:52:45 [PI_UFL] [Info] [Line  3 ] 00000,2014-05-22 10:44,0.000,60,40,351,146,288,4.0,8.7,28.7,1000.3,1398.678.
15-Feb-2017 14:52:45 [PI_UFL] [Info] [Line  4 ] 00000,2014-05-22 10:45,0.000,60,40,351,145,288,4.0,8.7,28.7,1000.2,1398.519.
15-Feb-2017 14:52:45 [PI_UFL] [Info] [Line  5 ] 00000,2014-05-22 10:46,0.000,60,40,351,145,288,4.0,8.7,28.6,1000.2,1398.281.
15-Feb-2017 14:52:45 [PI_UFL] [Info] [Line  6 ] 00000,2014-05-22 10:47,0.000,60,40,351,147,288,4.2,9.3,28.7,1000.2,1398.169.
15-Feb-2017 14:52:45 [PI_UFL] [Info] [Line  7 ] 00000,2014-05-22 10:48,0.000,60,40,351,150,288,4.3,9.3,28.7,1000.2,1398.127.
15-Feb-2017 14:52:45 [PI_UFL] [Info] [Line  8 ] 00000,2014-05-22 10:49,0.000,60,40,351,151,278,4.3,9.3,28.6,1000.2,1397.769.
15-Feb-2017 14:52:45 [PI_UFL] [Info] [Line  9 ] 00000,2014-05-22 10:50,0.000,60,40,351,151,292,4.4,9.3,28.6,1000.2,1397.605.
15-Feb-2017 14:52:45 [PI_UFL] [Info] [Line  10 ] 00000,2014-05-22 10:51,0.000,60,40,64,153,292,4.5,9.3,28.7,1000.2,1397.453.
15-Feb-2017 14:52:45 [PI_UFL] [Info] [Line  11 ] 00000,2014-05-22 10:52,0.000,60,40,37,154,322,4.3,9.3,28.7,1000.2,1397.226.
15-Feb-2017 14:52:45 [PI_UFL] [Info] [Line  12 ] 00000,2014-05-22 10:53,0.000,60,40,37,153,322,4.3,9.3,28.8,1000.2,1397.084.
15-Feb-2017 14:52:45 [PI_UFL] [Info] [Line  13 ] 00000,2014-05-22 10:54,0.000,60,40,37,153,322,4.3,9.3,28.8,1000.1,1396.950.
15-Feb-2017 14:52:45 [PI_UFL] [Info] [Line  14 ] 00000,2014-05-22 10:55,0.000,60,40,37,154,322,4.3,9.3,28.8,1000.2,1396.779.
15-Feb-2017 14:52:45 [PI_UFL] [Info] [Line  15 ] 00000,2014-05-22 10:56,0.000,60,40,37,156,322,4.5,9.5,28.8,1000.2,1396.661.
15-Feb-2017 14:52:45 [PI_UFL] [Info] [Line  16 ] 00000,2014-05-22 10:57,0.000,60,40,37,155,322,4.3,9.5,28.8,1000.2,1396.446.
15-Feb-2017 14:52:45 [PI_UFL] [Info] [Line  17 ] 00000,2014-05-22 10:58,0.000,60,40,37,156,322,4.3,9.6,28.8,1000.1,1396.238.
15-Feb-2017 14:52:45 [PI_UFL] [Info] [Line  18 ] 00000,2014-05-22 10:59,0.000,60,40,37,157,322,4.4,9.6,28.8,1000.1,1396.170.
15-Feb-2017 14:52:45 [PI_UFL] [Info] [Line  19 ] 00000,2014-05-22 11:00,0.000,60,40,37,158,322,4.4,9.6,28.8,1000.2,1396.029.
15-Feb-2017 14:52:45 [PI_UFL] [Info] [Line  20 ] 00000,2014-05-22 11:01,0.000,60,40,350,156,322,4.2,9.6,28.8,1000.2,1395.806.
15-Feb-2017 14:52:45 [PI_UFL] [Info] [Line  21 ] 00000,2014-05-22 11:02,0.000,60,40,350,156,271,4.3,9.6,28.8,1000.2,1395.611.
15-Feb-2017 14:52:45 [PI_UFL] [Info] [Line  22 ] 00000,2014-05-22 11:03,0.000,60,40,350,156,271,4.3,9.6,28.9,1000.0,1395.524.
15-Feb-2017 14:52:45 [PI_UFL] [Info] [Line  23 ] 00000,2014-05-22 11:04,0.000,60,40,350,154,271,4.2,9.6,28.9,1000.1,1395.451.
15-Feb-2017 14:52:45 [PI_UFL] [Info] [Line  24 ] 00000,2014-05-22 11:05,0.000,60,40,350,155,271,4.3,9.6,28.9,1000.1,1395.167.
15-Feb-2017 14:52:45 [PI_UFL] [Info] [Line  25 ] 00000,2014-05-22 11:06,0.000,60,40,350,154,271,4.1,9.6,28.9,1000.1,1394.973.
15-Feb-2017 14:52:45 [PI_UFL] [Info] [Line  26 ] 00000,2014-05-22 11:07,0.000,60,40,350,156,271,4.3,9.6,28.9,1000.2,1394.805.
15-Feb-2017 14:52:45 [PI_UFL] [Info] [Line  27 ] 00000,2014-05-22 11:08,0.000,60,40,350,153,271,4.2,9.4,28.9,1000.2,1394.718.
15-Feb-2017 14:52:45 [PI_UFL] [Info] [Line  28 ] 00000,2014-05-22 11:09,0.000,60,40,350,151,271,4.0,9.4,28.9,1000.1,1394.585.
15-Feb-2017 14:52:45 [PI_UFL] [Info] [Line  29 ] 00000,2014-05-22 11:10,0.000,60,40,350,152,271,4.2,9.4,28.9,1000.1,1394.266.
15-Feb-2017 14:52:45 [PI_UFL] [Info] [Line  30 ] 00000,B799A9C21474D237E58495B23044D4BE.
15-Feb-2017 14:52:45 [PI_UFL] [Info] Write to PI : TEST_tag1 : time = , value = , status = , flags = .
15-Feb-2017 14:52:45 [PI_UFL] [Info] Write to PI : TEST_tag2 : time = , value = , status = , flags = .
15-Feb-2017 14:52:45 [PI_UFL] [Info] Write to PI : TEST_tag3 : time = , value = , status = , flags = .
15-Feb-2017 14:52:45 [PI_UFL] [Info] Write to PI : TEST_tag4 : time = , value = , status = , flags = .
15-Feb-2017 14:52:45 [PI_UFL] [Info] Write to PI : TEST_tag5 : time = , value = , status = , flags = .
15-Feb-2017 14:52:45 [PI_UFL] [Info] Write to PI : TEST_tag6 : time = , value = , status = , flags = .
15-Feb-2017 14:52:45 [PI_UFL] [Info] Write to PI : TEST_tag7 : time = , value = , status = , flags = .
15-Feb-2017 14:52:45 [PI_UFL] [Info] Write to PI : TEST_tag8 : time = , value = , status = , flags = .
15-Feb-2017 14:52:45 [PI_UFL] [Info] Write to PI : TEST_tag9 : time = , value = , status = , flags = .
15-Feb-2017 14:52:45 [PI_UFL] [Info] Write to PI : TEST_tag10 : time = , value = , status = , flags = .
15-Feb-2017 14:52:45 [PI_UFL] [Info] Write to PI : TEST_tag11 : time = , value = , status = , flags = .
15-Feb-2017 14:52:45 [PI_UFL] [PL_Info] _5_Stacja_ok.csv file renamed.
15-Feb-2017 14:52:45 [PI_UFL] [Info] PL_GetBufferedData() 0 data lines read.
15-Feb-2017 14:52:45 [PI_UFL] [Info] End scan.
15-Feb-2017 14:52:45 [PI_UFL] [Info] Begin updating PI Health Tags.
15-Feb-2017 14:52:45 [PI_UFL] [Info] End updating PI Health Tags.
15-Feb-2017 14:52:45 [PI_UFL] [Info] Begin updating PI PERF.Cntr.













 

I've checked everything hundreds of times.

What's interesting, when I delete messages 1 and 3 everything works correctly.

 

Thanks in advance for your help.

Outcomes