public void readBacnetDevieParameterForScanHardware(int bacnetID, uint bacnetInputPort,string identifier_type)
{
BacnetValue Value;
//BacnetValue ValueX;
bool ret;
// Console.WriteLine("Read ID = %d input0 value = %d");
if(identifier_type == "OBJECT_ANALOG_VALUE")
{
ret = ReadScalarValue(bacnetID, new BacnetObjectId(BacnetObjectTypes.OBJECT_ANALOG_VALUE, bacnetInputPort), BacnetPropertyIds.PROP_PRESENT_VALUE, out Value);
}
else if(identifier_type == "OBJECT_ANALOG_INPUT")
{
ret = ReadScalarValue(bacnetID, new BacnetObjectId(BacnetObjectTypes.OBJECT_ANALOG_INPUT, bacnetInputPort), BacnetPropertyIds.PROP_PRESENT_VALUE, out Value);
}
else
{
//do for output
ret = ReadScalarValue(bacnetID, new BacnetObjectId(BacnetObjectTypes.OBJECT_ANALOG_OUTPUT, bacnetInputPort), BacnetPropertyIds.PROP_PRESENT_VALUE, out Value);
}
if (ret == true)
{
// Console.WriteLine("Read id = {0},input1 value : {1}", bacnetID, Value.Value.ToString());
PresentValueFromBacnet = Math.Round(double.Parse(Value.Value.ToString()), 2);
}
// else
// MessageBox.Show("Error somewhere !");
}