private void ConvertRuntimeValueToBytes(ref RuntimeValue p_runtimeValue, BinaryWriter bw)
        {
            //      [DateTime timestampField] (converted to 64 bit binary)
            bw.Write(p_runtimeValue.timestampField.ToBinary());
            //      [bool timestampFieldSpecified]
            bw.Write(p_runtimeValue.timestampFieldSpecified);
            //      <<Variant>>
            //          [ushort typeField]
            //          [int lengthField]
            //          <embedded ary>
            //              [unsigned int payloadField_length]
            //              [bytes payloadField_bytes 0..n]
            ConvertVariantToBytes(ref p_runtimeValue.valueField, bw);
            //
            //      <<ASBStatus>>
            //          [sbyte countField]
            bw.Write(p_runtimeValue.statusField.countField);
            //          <<embedded ary>>
            //              [unsigned int payloadfield_length]
            //              [bytes payloadField_bytes 0..n]
            if (p_runtimeValue.statusField.payloadField != null)
            {
                bw.Write((uint)p_runtimeValue.statusField.payloadField.Length);
                bw.Write(p_runtimeValue.statusField.payloadField);
            }
            else
            {
                bw.Write((uint)0);
            }


        }
        private void ConvertBytesToRuntimeValue(ref RuntimeValue RValue, BinaryReader br)
        {
            //      [DateTime timestampField] (converted to 64 bit binary)
            RValue.timestampField = DateTime.FromBinary(br.ReadInt64());

            //      [bool timestampFieldSpecified]
            RValue.timestampFieldSpecified = br.ReadBoolean();

            //      <<Variant>>
            //          [ushort typeField]
            //          [int lengthField]
            //          <embedded ary>
            //              [unsigned int payloadField_length]
            //              [bytes payloadField_bytes 0..n]
            ConvertBytesToVariant(ref RValue.valueField, br);

            //
            //      <<ASBStatus>>
            //          [sbyte countField]
            RValue.statusField.countField = br.ReadSByte();
            //          <<embedded ary>>
            //              [unsigned int payloadfield_length]
            //              [bytes payloadField_bytes 0..n]
            int payloadLen = br.ReadInt32();
            if (payloadLen > 0)
            {
                RValue.statusField.Payload = br.ReadBytes(payloadLen);
            }
            else
            {
                RValue.statusField.Payload = null;
            }
        }