9/28/2006 3:33 PM | |
Posts: 70 Rating: (13) |
Hi That OPC item is correct. I tried on my test system: "S7:[OPC_ITCP]DB100,WORD0,15", which correctly opens an Array of 15 WORD values (see attached pic). Here is my OPC test program if you like: http://www.allottware.co.za/raweb.dll/Page?n=downloads_opctestclient I have noticed a lot of OPC client software does not correctly handle array items. I'm not sure how you would work with this in WinCC. I defined the OPC tag as "Raw Data Type" using the item name above and specified it as "Unsingd 16-bit Array" in the OPC address dialog. If you then display this in WinCC as a string value, it will convert each word to an ASCII character and terminate at the first 0 - hence the data is there but not sure how to use it in WinCC. If there are no zeros in your data you could define an array of BYTES and read in a long string and convert the BYTE data back to an array of WORDs. With an OPC interface you simply access elements of the array. Using VB Script it doesn't look like you can access sub-elements of a tag value. You should be able to do something like this: Dim tag Dim v Set tag = HMIRuntime.Tags("ArrayTag") 'read second element in array tag v = tag.Value(2) But this does not work [:(] In OPC the array is a VT_ARRAY variant - is this supported in WinCC, and if not why is there a setting for "Ungined 16-bit Array" when it seems the only way to access the data is in a string of bytes? |
Last edited by: Reuben at: 9/28/2006 4:27 PMLast edited by: Reuben at: 9/28/2006 4:17 PM |
|
Follow us on