To read value type in UFL Interface

Hi All,

 

I am trying to set up the UFL interface where it will read the data from CSV file which contain 'tagname', 'timestamp', 'value'. There will 42 different tag in that CSV. all tag value are float excel last one which have string value.

I am trying to write the IF else loop in INI file but it is not accepting the syntax. could you please help me to understand how can I ready value type in INI file.

 

FIELD(1).NAME="Tag"

 

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_Number"

 

FIELD(3).TYPE="Number"

 

FIELD(4).NAME="Value_String"

 

FIELD(4).TYPE="String"

 

 

[MSG]

 

MSG(1).NAME="Data"

 

 

[Data]

 

Data.FILTER=C1=="*"

 

Tag=["(*),*,*"]

 

TimeStamp=["*,(*),*"]

 

Value_Number=["*,*,(*)"]

 

Value_String=["*,*,(*)"]

IF (Value_Number is Number) THEN

 

StoreInPI(Tag, ,TimeStamp,Value_Number, , )

 

ELSE StoreInPI(Tag, ,TimeStamp,Value_String, , )

 

ENDIF

 

in IF loop at Number position I am getting syntax error. 

 

Kind Regards,

Prasad

Parents
No Data
Reply Children
  • Hi Kenneth,

     

    Thank you for your reply. it is logical but not working.

     

    I tried this in below two format:

    1st

    Tag=["(*),*,*"]

     

    TimeStamp=["*,(*),*"]

     

    Value_Number=["*,*,(*)"]

     

    Value_String=["*,*,(*)"]

     

    IF (Value_Number is not Null) THEN

     

    StoreInPI(Tag, ,TimeStamp,Value_Number, , )

     

    ELSE

     

    StoreInPI(Tag, ,TimeStamp,Value_String, , )

     

    ENDIF

    2nd

     

    Tag=["(*),*,*"]

     

    TimeStamp=["*,(*),*"]

     

    Value_Number=["*,*,(*)"]

     

    Value_String=["*,*,(*)"]

     

    IF (Value_Number is not Null) THEN

     

    StoreInPI(Tag, ,TimeStamp,Value_Number, , )

    END IF

     

    F (Value_String is not Null) THEN

     

    StoreInPI(Tag, ,TimeStamp,Value_String, , )

     

    ENDIF

     

    both are not working I am getting below error in error log:

    01-Dec-2020 02:03:00 [PI_UFL] [Info] [Line 42 ] 73-###-####_####-MI,2020-12-01 01:59:32,abc.

    01-Dec-2020 02:03:00 [PI_UFL] [Error] Cannot convert abc from String to Number.

     

     

    kind Regards,