コード例 #1
0
            /// <summary>Read the value of a basic data attribute (BDA) of type integer (MMS_INTEGER).</summary>
            /// <description>This function should also be used if enumerations are beeing read. Because
            /// enumerations are mapped to integer types for the MMS mapping</description>
            /// <param name="objectReference">The object reference of a BDA.</param>
            /// <param name="fc">The functional constraint (FC) of the object</param>
            /// <exception cref="IedConnectionException">This exception is thrown if there is a connection or service error</exception>
            public Int64 ReadIntegerValue(string objectReference, FunctionalConstraint fc)
            {
                var mmsValuePtr = readObjectInternal(objectReference, fc);

                var mmsValue = new MmsValue(mmsValuePtr, true);

                if (mmsValue.GetType() == MmsType.MMS_INTEGER)
                {
                    return(mmsValue.ToInt64());
                }
                else
                {
                    throw new IedConnectionException("Result is not of type integer (MMS_INTEGER)", 0);
                }
            }
コード例 #2
0
            /// <summary>Read the value of a basic data attribute (BDA) of type integer (MMS_INTEGER).</summary>
            /// <description>This function should also be used if enumerations are beeing read. Because
            /// enumerations are mapped to integer types for the MMS mapping</description>
            /// <param name="objectReference">The object reference of a BDA.</param>
            /// <param name="fc">The functional constraint (FC) of the object</param>
            /// <exception cref="IedConnectionException">This exception is thrown if there is a connection or service error</exception>
            public Int64 ReadIntegerValue(string objectReference, FunctionalConstraint fc)
            {
                var mmsValuePtr = readObjectInternal (objectReference, fc);

                var mmsValue = new MmsValue (mmsValuePtr, true);

                if (mmsValue.GetType () == MmsType.MMS_INTEGER)
                    return mmsValue.ToInt64 ();
                else
                    throw new IedConnectionException ("Result is not of type integer (MMS_INTEGER)", 0);
            }