Page 1 of 1

changing property values

Posted: Tue Apr 20, 2010 10:02 am
by peter
Hi Scott,
probably an easy question for you.
How can I change a property's value inside of my own DLL without!!! triggering the DeviceRun function. Normally, so my understanding, I have to call the ChangeRequest function. That is what I'm doing all the time and what works well. But this will cause adding this property to the server's change queue. What I want is, to avoid that the server calls my DeviceRun function for this particular property in this case. I tried ChangeRequestCompleted instead of ChangeRequest. It seems to work but I'm not sure if there are any side effects.

Thanks in advance
peter

Re: changing property values

Posted: Thu Apr 22, 2010 1:43 pm
by ScottBot
You got it.

Just create the propertyvalue object, call ChangeRequestCompleted() on it, then delete the property value object.

The system time device does it every second.

Re: changing property values

Posted: Thu Apr 22, 2010 2:15 pm
by ScottBot
And a helper function for doing it is included in Device.cpp. If you call CreatePropertyValueAndChange( CProperty* pProperty, const char* szNewValue ) on the Device object, it will take care of creating the PV object, calling the changerequestcomplete method and then deleting the object.