예제 #1
0
        public static double getDoubleVal(PISDK.PIValue value)
        {
            if (value.Value.GetType().IsCOMObject) {
                PISDK.DigitalState myDigState;
                myDigState = value.Value as PISDK.DigitalState;
                return myDigState.Code;

            } else {
                double v = Convert.ToDouble(value.Value);
                return v;
            };
        }
예제 #2
0
 public static String getStringValue(PISDK.PIValue value, String numberFormat = "{0}")
 {
     if (value.Value.GetType().IsCOMObject) {
         PISDK.DigitalState myDigState;
         myDigState = value.Value as PISDK.DigitalState;
         if (value != null)
             return myDigState.Name;
         else
             return "&&&";
     } else {
         return String.Format(numberFormat, value.Value);
     };
 }
예제 #3
0
        // Modified From WHITEPAPER ConvertAFValues
        private static double[] PIValuesToArray(PISDK.PIValues piValues)
        {
            double[] dblArray = new double[piValues.Count];

            for (Int32 i = 0; i < piValues.Count; i++)
            {
                try
                { dblArray[i] = double.Parse(piValues[i + 1].Value.ToString()); }
                catch { }

            }

            return dblArray;
        }
예제 #4
0
 private PIPoint readPIPoint(PISDK.Server piServer, string tagName)
 {
     return piSDK.GetPoint("\\\\" + piServer.Path.ToString() + "\\" + tagName);
 }