PI SDK 1.4 & PIAnnotations

Discussion created by PIAdminUnison on Jul 5, 2011
Latest reply on Jul 7, 2011 by PIAdminUnison

Hi guys,


Well I am still testing the PI SDK 1.4 Beta and I have a working program that reads data from a file and places it into PI tags, including PI annotations if present.  I thought all was going well, so I decided moving this program to a windows service and this is where I ran into a problem.  When my code runs as a service it works fine writing a value without any PIAnnotations, but once I try to add one or more PIAnnotations, it errors with the following message:


"The application called an interface that was marshalled for a different thread."


Here is my call to PI to place the value in the tag:


"tmpErrs = tmpPIPoint.Data.UpdateValues(tmpPIValues, DataMergeConstants.dmInsertDuplicates, tmpStatus)"


I understand it seems my PIAnnotations are on a different thread then my PIValues but not sure how or why, especally since PIAnnotations are multithreaded with PI SDK 1.4?


Any thoughts or samples of this working would save me from pulling on my hair some more.