What is the best way to get snapshot and update blob PI Point using C++? I already have implemented all types except blob type. Some sample code would be nice.
I have no sample code handy, but the PIData.UpdateValue call takes a VARIANT. You should use VT_ARRAY | VT_UI1 for the value type of the VARIANT.
Thanks Charles. I will try it.
I have several additional questions regarding to blob data type. I tried to follow your approach. I created variant of type VT_ARRAY | VT_UI1 and put value there. Update worked fine and I was able to verify value throufh SMT. But I have problem using my reading value method. There is switch with all supported data types, so there are VT_I2, VT_I4, ... , VT_BLOB and of course this PIValue's data type doesn't match with VT_BLOB. I tried to create variant of type VT_BLOB and inserted the same value as in previous case, but it didn't work. So, I have following questions:
1) How can I put value into variant of type VT_BLOB?
2) How can I read value from variant of type VT_BLOB?
Vlad, if you write a VT_ARRAY | VT_UI1, and read the snapshot it does return a VT_ARRAY | VT_UI1
Yes, I see. I was able to to read/write VT_ARRAY | VT_UI1. I would like to read/write directly type VT_BLOB. Or, is it recommended approach to read/write values from/into BLOB as VT_ARRAY | VT_UI1?
As the blob is not a "normal" datatype (for PI it is just 9xx bytes of something) and your application needs to deal with it anyhow specific to your needs, I would follow Charlies suggestion of using a VT_ARRAY | VT_UI1. In fact, I always follow Charlies suggestion when it comes to the PI SDK (hint - Charlie's initials show up quite often in the PI SDK source code) .
Ok, got you. :-) Thank you. I will follow your suggestions!
Retrieving data ...