SmartConnector Forum
Schneider Electric support forum about SmartConnector applications for integration of other building management systems (BMS) into EcoStruxure Building Operation.
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.
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.