Ask our Experts
Didn't find what you are looking for? Ask our experts!
Launch of Consumer/Home Owner registration process! We are pleased to announce the commencement of the Consumer/Home Owner Registration Process on Community. Consumers/Home Owners may now proceed to register by clicking on Login/Register. The process is straightforward and designed to be completed in just a few steps.
Schneider Electric support forum about SmartConnector applications for integration of other building management systems (BMS) into EcoStruxure Building Operation.
Search in
Link copied. Please paste this link to share this article on your social media post.
Is there any API to update the smartconnector configuration parameter value by code at runtime? Or should I update the database Parameters table.
My smartconnector integration application has a parameter ‘StartMode’whose default value is ‘ColdStart’, I want to update it to ‘WarmStart’ after
first run.
Link copied. Please paste this link to share this article on your social media post.
Neeraj,
There is no API specifically to accomplish that but the ConfigurationId is available as a property of your Processor class. So, you could do something like this:
You would need to add a reference to Mongoose.Configuration first and then you could write something like this:
using (var db = MongooseObjectFactory.Current.GetInstance<IProcessConfigurationDataSource>())
{
var config = db.ProcessConfigurations.FirstOrDefault(x => x.Id == ConfigurationId);
var parameter = config.Parameters.FirstOrDefault(x => x.Name == "PROPERTY_NAME_HERE");
if (parameter != null)
{
parameter.Value = "WarmStart";
db.Save();
}
}
A Parameter maps to a scalar value property. My code snippet assumes that "PROPERTY_NAME_HERE" is the name property on your processor. If the property is a property of a reference type attached to your Processor, it would be a little more complicated but still doable.
M
Link copied. Please paste this link to share this article on your social media post.
Neeraj,
There is no API specifically to accomplish that but the ConfigurationId is available as a property of your Processor class. So, you could do something like this:
You would need to add a reference to Mongoose.Configuration first and then you could write something like this:
using (var db = MongooseObjectFactory.Current.GetInstance<IProcessConfigurationDataSource>())
{
var config = db.ProcessConfigurations.FirstOrDefault(x => x.Id == ConfigurationId);
var parameter = config.Parameters.FirstOrDefault(x => x.Name == "PROPERTY_NAME_HERE");
if (parameter != null)
{
parameter.Value = "WarmStart";
db.Save();
}
}
A Parameter maps to a scalar value property. My code snippet assumes that "PROPERTY_NAME_HERE" is the name property on your processor. If the property is a property of a reference type attached to your Processor, it would be a little more complicated but still doable.
M
Link copied. Please paste this link to share this article on your social media post.
Thanks Mark ! It works for me.
You’ve reached the end of your document
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.