I have a PB 8 that connects to an OPC server using the opc-da standard. It basically calls a ole/com object dll to communicate to the server which talks to plcs. I am having an issue with the following AddItems external function call.
opc_struc.opc_items.AddItems(llEnd, ls_items, ll_client_handles, ref ll_item_server_handles, ref ll_server_errors )
long ll_item_server_handles[], ll_server_errors[],ll_client_handles[], llEnd
string ls_items[]
ls_items is an array of strings, tag names on the opc server we want to connect to.
for example:
This call worked fine in PB 8 but we have never got it to work on later versions. I believe it is a unicode/ansi string issue.
I tried to convert these strings to ansi using the following code. ls_tmp contains the strings in the above snip.
Blob lbl_data
lbl_data = Blob(ls_tmp, EncodingANSI!)
ls_items[ll_idx] = String(lbl_data, EncodingANSI!)
But it still blows up on the additmes call.
Any help would be greatly appreciated.