OPC DA interface documentation says to do this.
Location2 to 1. The PI OPC
Location2 to 1.
But when I set Location2 to 1 and change the tag to float32 interface complains it can't convert string to float and does not update tags.
OPC DA specifications allow converting a string (BSTR) to float32(R4). The following scenario is valid:
ItemID on the OPC server is a string and have a value of 66.79
PI Point on the PI server is a float32 will receive a value of 66.79.
But if the ItemID on the OPC server has a string - "example_String", this cannot obviously be converted into a float and you will see the following message on the interface logs: UnPack2 <tagname> returns error 80020005: 80020005(Type mismatch).
So can you try again by setting location 2 as 0. Location2=1 is used for digital tags; as this does not apply to your case.
Well not according to the documentation for the latest OPC DA interface it says set location2 to 1 to convert string to float. My issue is it is actually a string array so value coming out the opc server are like "2.53","16.125","0"....... and so on.
taken right from the OSI OPC DA documentation for OPC DA 18.104.22.168
Well, your string data is a proper string as it has double quotes around it. So this conversion is not supported. If your data stream had values 2.53,16.125,0....... (without quotes around them), we can use location2=1 and pull them using PI OPC DA.
As an alternative solution here, UFL interface will be able to workaround this problem if the data can be exported into a txt or csv files on a periodic basis (something to think about).
Ram's post is completely valid, but it seems that you might be changing the point type while the interface/ buffering are running? Caching could be in play here, but without seeing all relevant messages that are logged, I could be off track here.
Location2=0 is usually the best... let the interface decide how to read the item based on the item's DataType. If it was reading the string ok with the previous setting, revert to that previous setting... If it still complains, please post the actual messages from the log for the quickest resolution.
Yes the data comes in GREAT as string, but the end user wants it as float, so they can do analytics on the data such as get tag min/max values over a period of time. No matter what I try I just keep cannot convert string to float when setting PI tag as float32. But I don't recall if I have restarted the buffering and everything when changing the tag data type or location setting.
Retrieving data ...