YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

PI Ufl Options · View
ben.5891
#1 Posted : Tuesday, September 13, 2011 6:21:45 AM
Rank: Newbie
Groups: Member

Joined: 5/18/2011
Posts: 5
Location: Madagascar
How to store alphanumeric value in one tag with PI ufl.

It should not be a string because if we pull the data on excel, we cannot do any calculation as the cells is set as text and cannot format the cell.

To copy the value into another sheet is a bad solution as it requires a lot of manual operation

Please help
Sponsor  
 

OSIsoft vCampus is a subscription-based, online offering that consists of providing everything people need to develop applications on the PI System.
We invite you to take a "tour" of the OSIsoft Virtual Campus - also feel free to consult the FAQ  or contact OSIsoft vCampus for more details.
squatty
#2 Posted : Tuesday, September 13, 2011 9:36:25 AM
Rank: Advanced Member

Groups: Member

Joined: 4/7/2011
Posts: 137
Location: KZN, South Africa
Hi, welcome.

You can't store Alphanumerical values as floats, integers. You can either use strings or if there is a set structure to your data you can use digital sets. The other option is to write the Alphabetical part to one tag and the numerical to another and then do your Harry Potter magic in excel or a PE tag. Give us some more detailed information then we can give you some detailed help.
ben.5891
#3 Posted : Tuesday, September 13, 2011 12:20:31 PM
Rank: Newbie
Groups: Member

Joined: 5/18/2011
Posts: 5
Location: Madagascar
What I have is a lab data and I set it into two different tag: one for alphanumeric value and one for floating point value. The issue on the report and calculation.
We can't do calculation for a wide of cell in excel because one tag may have <10 value but it is reported as 10 with the floating point. Then our mean and sum outcome are always wrong.
My setup is:

tagname,timestamps,floating_value,alpha_value

So if I have a set of data like below

22bo130lqcond,01-02-2011 09:00,10,<10
22bo130lqcond,01-02-2011 09:25,0.5,0.5
22bo130lqcond,01-02-2011 09:00,8,<8

The value can go under DL detection limit that why we have the value >xx and <xx

thks fr your help
squatty
#4 Posted : Tuesday, September 13, 2011 2:19:45 PM
Rank: Advanced Member

Groups: Member

Joined: 4/7/2011
Posts: 137
Location: KZN, South Africa
Correct me if I'm wrong but you are only interested in Tag,Timestamp,Value, you want to ignore the <10 or >10 values at the back. Forgive my ignorance by I still can't see what the problem is.

Do you have issues getting the data from the file into PI?
Do you have issues with the data in Excel, in their corrent format?

The sample below is probably in your config file in the UFL Interface, is it possible that you can supply us with the sample of the actual source.
22bo130lqcond,01-02-2011 09:00,10,<10
22bo130lqcond,01-02-2011 09:25,0.5,0.5
22bo130lqcond,01-02-2011 09:00,8,<8

Regards
ben.5891
#5 Posted : Tuesday, September 13, 2011 2:34:17 PM
Rank: Newbie
Groups: Member

Joined: 5/18/2011
Posts: 5
Location: Madagascar
We have the all the data on PI but we cannot explore them, I mean to do calculation with excel.

Here is an exact file that we process

Tag_Name,Tag_Descr,Sampling_Date,Login_Date,Completion_Date,TT_Process,TT_Lab,Value_F,Value_S,UOM,Method
74HE102LQNa,Boiler Feed Water - Sodium,2011/09/13 11:00,2011/09/13 11:50,2011/09/13 14:12,50,142,5,<5,ppb,
74HE102LQK,Boiler Feed Water - Potassium,2011/09/13 11:00,2011/09/13 11:50,2011/09/13 14:12,50,142,8,8,ppb,

On the first entry: value_f is 5 and value_s(string) <5

So if I use the float value on my report and pull the result with datalink on range(A1,A100), calculate the mean, I got wrong result and we cannot trust with because at leat one of this value have <10 but reported as 10
If I use the string one, I cannot format the cell on excel to be a number

tks
squatty
#6 Posted : Tuesday, September 13, 2011 2:53:33 PM
Rank: Advanced Member

Groups: Member

Joined: 4/7/2011
Posts: 137
Location: KZN, South Africa
Have you tried the AVERAGEIF function in excel.

=Averageif(range,">0",range)

10 Average of data to the left is:15
10
10
10
>10
<90
20
20
20
20
ben.5891
#7 Posted : Tuesday, September 13, 2011 3:02:32 PM
Rank: Newbie
Groups: Member

Joined: 5/18/2011
Posts: 5
Location: Madagascar
I tried but these data are string number and cannot be manipulated.

To be able to do that, I have to copy all the value into new sheet then format as number. But that is lot of manual operation and waste a lot of time as we have lot of tags to monitor

squatty
#8 Posted : Tuesday, September 13, 2011 3:09:54 PM
Rank: Advanced Member

Groups: Member

Joined: 4/7/2011
Posts: 137
Location: KZN, South Africa
Eurika!! Now I see your problem

You will have to write an if statement in your ini file were you filter by results. I haven't worked in UFL files for some time now but below is a sample of what we use, can you post your ini file and then we can see if we resolve this together.

' Fields definition
[FIELD]
FIELD(1).NAME = "TAG"
FIELD(2).NAME = "TAG"
FIELD(3).NAME = "TAG"
FIELD(4).NAME = "TAG"
FIELD(5).NAME = "TAG"
FIELD(6).NAME = "TAG"
FIELD(7).NAME = "TAG"
FIELD(8).NAME = "REEL"
FIELD(8).Type = "Number"
FIELD(9).NAME = "TYPE"
FIELD(9).Type = "String"
FIELD(10).NAME = "LENGTH"
FIELD(10).Type = "Number"
FIELD(11).NAME = "WIDTH"
FIELD(11).Type = "Number"
FIELD(12).NAME = "AREA"
FIELD(12).Type = "Number"
FIELD(13).NAME = "MD"
FIELD(13).Type = "Number"
FIELD(14).NAME = "CD"
FIELD(14).Type = "Number"
FIELD(15).NAME = "TIMESTAMP"
FIELD(15).TYPE = "DateTime"
FIELD(15).FORMAT= "yyyy-MM-dd hh:mm:ss.000"

[MSG]
MSG(1).Name = "MSG1"

[MSG1]
MSG1.Filter = C1 == "*"

FIELD(1) = "PM35-PQV-ReelNo"
FIELD(2) = "PM35-PQV-Defect-Type"
FIELD(3) = "PM35-PQV-Defect-Length"
FIELD(4) = "PM35-PQV-Defect-Width"
FIELD(5) = "PM35-PQV-Defect-Area"
FIELD(6) = "PM35-PQV-Defect-MD"
FIELD(7) = "PM35-PQV-Defect-CD"

FIELD(8) = ["(*);*;*;*;*;*;*;*"]
FIELD(9) = ["*;(*);*;*;*;*;*;*"]
FIELD(10) = ["*;*;(*);*;*;*;*;*"]
FIELD(11) = ["*;*;*;(*);*;*;*;*"]
FIELD(12) = ["*;*;*;*;(*);*;*;*"]
FIELD(13) = ["*;*;*;*;*;(*);*;*"]
FIELD(14) = ["*;*;*;*;*;*;(*);*"]

FIELD(15) = ["*;*;*;*;*;*;*;(???????? ??:??:??)"]

StoreInPI(FIELD(1),, FIELD(15), FIELD(8),,)
StoreInPI(FIELD(2),, FIELD(15), FIELD(9),,)
StoreInPI(FIELD(3),, FIELD(15), FIELD(10),,)
StoreInPI(FIELD(4),, FIELD(15), FIELD(11),,)
StoreInPI(FIELD(5),, FIELD(15), FIELD(12),,)
StoreInPI(FIELD(6),, FIELD(15), FIELD(13),,)
StoreInPI(FIELD(7),, FIELD(15), FIELD(14),,)
ben.5891
#9 Posted : Wednesday, September 14, 2011 5:32:45 AM
Rank: Newbie
Groups: Member

Joined: 5/18/2011
Posts: 5
Location: Madagascar
I have two ufl interface one store the string and one store the float

String

[INTERFACE]
PLUG-IN=ASCIIFiles.dll

[PLUG-IN]
IFM=\\10.73.3.198\pims\out\UN2PI*._OK
IFS=C
REN=_DONE
ERR=BAD2
PURGETIME=2d
PFN=true
NEWLINE=13,10

[SETTING]
DEB=4
MAXLOG=10
MAXLOGSIZE=512
MSGINERROR=\\10.73.3.198\pims\ERR\Error2.log
OUTPUT=\\10.73.3.198\pims\log\LogFile2.log
LOCALE=en-us

[FIELD]
Field(1).NAME="Timestamp"
Field(1).TYPE="DateTime"
Field(1).FORMAT="yyyy/MM/dd hh:mm"
Field(2).NAME="TagName"
Field(2).TYPE="String"
Field(3).NAME="Value_String"
Field(3).TYPE="String"
FIELD(4).NAME="UnitOM"
FIELD(4).TYPE="String"
FIELD(5).NAME="Method"
FIELD(5).TYPE="String"
FIELD(6).NAME="Description"
FIELD(6).TYPE="String"
FIELD(7).NAME="CompletionDate"
FIELD(7).TYPE="String"
FIELD(8).NAME="LoginDate"
FIELD(8).TYPE="String"
FIELD(9).NAME="ProcessTime"
FIELD(9).TYPE="String"
FIELD(10).NAME="LabTime"
FIELD(10).TYPE="String"

[MSG]
MSG(1).NAME="BatchFL"
MSG(1).EPC="String"

[BatchFL]
BatchFL.FILTER = C1=="*"
' Field extractions (variables)
'
' Send the values to PI Archive
' Numerical value
'
TagName=["(*),*,*,*,*,*,*,*,*,*,*"]
Description=["*,(*),*,*,*,*,*,*,*,*,*"]
Timestamp=["*,*,(*),*,*,*,*,*,*,*,*"]
LoginDate=["*,*,*,(*),*,*,*,*,*,*,*"]
CompletionDate=["*,*,*,*,(*),*,*,*,*,*,*"]
ProcessTime=["*,*,*,*,*,(*),*,*,*,*,*"]
LabTime=["*,*,*,*,*,*,(*),*,*,*,*"]
Value_String=["*,*,*,*,*,*,*,*,(*),*,*"]
UnitOM=["*,*,*,*,*,*,*,*,*,(*),*"]
Method=["*,*,*,*,*,*,*,*,*,*,(*)"]
StoreInPI(TagName + "_Value",Description,Timestamp,Value_String,,,"UOM: " + UnitOM + " Method : " + Method + " ProcessTime: " + ProcessTime + "m LabTime:" + LabTime + "m")
StoreInPI(TagName + "_CompletionDate",Description,Timestamp,CompletionDate,,,"UOM: " + UnitOM + " Method : " + Method + " ProcessTime: " + ProcessTime + "m LabTime:" + LabTime + "m")
StoreInPI(TagName + "_LoginDate",Description,Timestamp,LoginDate,,,"UOM: " + UnitOM + " Method : " + Method + " ProcessTime: " + ProcessTime + "m LabTime:" + LabTime + "m")

Float


[INTERFACE]
PLUG-IN=ASCIIFiles.dll

[PLUG-IN]
IFM=\\10.73.3.198\pims\out\UN2PI*.csv
IFS=C
REN=_OK
ERR=BAD
PURGETIME=30m
PFN=true
NEWLINE=13,10

[SETTING]
DEB=4
MAXLOG=10
MAXLOGSIZE=512
MSGINERROR=\\10.73.3.198\pims\ERR\Error.log
OUTPUT=\\10.73.3.198\pims\log\LogFile.log
LOCALE=en-us

[FIELD]
Field(1).NAME="Timestamp"
Field(1).TYPE="DateTime"
Field(1).FORMAT="yyyy/MM/dd hh:mm"
Field(2).NAME="TagName"
Field(2).TYPE="String"
Field(3).NAME="Value_Number"
Field(3).TYPE="Number"
FIELD(6).NAME="UnitOM"
FIELD(6).TYPE="String"
FIELD(7).NAME="Method"
FIELD(7).TYPE="String"
FIELD(8).NAME="Description"
FIELD(8).TYPE="String"
FIELD(9).NAME="ProcessTime"
FIELD(9).TYPE="String"
FIELD(10).NAME="LabTime"
FIELD(10).TYPE="String"

[MSG]
MSG(1).NAME="BatchFL"
MSG(1).EPC="Float32"

[BatchFL]
BatchFL.FILTER = C1=="*"
' Field extractions (variables)
'
' Send the values to PI Archive
' Numerical value
'
TagName=["(*),*,*,*,*,*,*,*,*,*,*"]
Description=["*,(*),*,*,*,*,*,*,*,*,*"]
Timestamp=["*,*,(*),*,*,*,*,*,*,*,*"]
Value_Number=["*,*,*,*,*,*,*,(*),*,*,*"]
UnitOM=["*,*,*,*,*,*,*,*,*,(*),*"]
Method=["*,*,*,*,*,*,*,*,*,*,(*)"]
ProcessTime=["*,*,*,*,*,(*),*,*,*,*,*"]
LabTime=["*,*,*,*,*,*,(*),*,*,*,*"]
StoreInPI(TagName,Description,Timestamp,Value_Number,,,"UOM: " + UnitOM + " Method : " + Method + " ProcessTime: " + ProcessTime + "m LabTime: " + LabTime + "m" )



Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.