void rqQueryEncoderLeftAbsolute_onValueReceived(object sender, MeasuredValuesEventArgs ev)
        {
            RQQueryEncoderLeftAbsolute query = (RQQueryEncoderLeftAbsolute)sender;
            double encoderLeftAbsolute       = query.doubleValues[0];

            if (encoderLeftAbsolute != prev_encoderLeftAbsolute)                // note: nonnull value is not equal to a null value
            {
                //Tracer.Trace("ControllerRQAX2850: EncoderLeftAbsolute changed : " + prev_encoderLeftAbsolute + " -> " + encoderLeftAbsolute);
                prev_encoderLeftAbsolute = encoderLeftAbsolute;

                if (onValueReceived_EncoderLeftAbsolute != null)
                {
                    //ev = new MeasuredValuesEventArgs();
                    ev.timestamp = query.whenReceivedTicks;
                    ev.value1    = encoderLeftAbsolute;
                    onValueReceived_EncoderLeftAbsolute(this, ev);
                }
            }
        }
        private DateTime querySetLastSent = DateTime.MinValue; // when we last sent from m_querySet

        #endregion Fields

        #region Constructors

        public ControllerRQAX2850(string portName)
        {
            Tracer.Trace("ControllerRQAX2850(" + portName + ")");

            m_portName = portName;

            m_queues[0] = m_commandQueue = new RQInteractionQueue("command", 3);    // highest priority factor
            m_queues[1] = m_commandPowerLeftQueue = new RQMotorCommandQueue("commandPowerLeft");    // one-slot queue; must be "equalized" with the m_commandPowerRightQueue in terms of processing order. PriorityFactor = 2;
            m_queues[2] = m_commandPowerRightQueue = new RQMotorCommandQueue("commandPowerRight");
            m_queues[3] = m_queryQueue = new RQInteractionQueue("query", 1);        // lowest priority factor

            RQQuery rqQueryEncoderSpeed = new RQQueryEncoderSpeed(m_measuredValues);
            rqQueryEncoderSpeed.onValueReceived += new OnValueReceived(rqQueryEncoderSpeed_onValueReceived);
            m_querySet.Add(rqQueryEncoderSpeed);
            m_querySetShort.Add(rqQueryEncoderSpeed);

            RQQuery rqQueryEncoderLeftAbsolute = new RQQueryEncoderLeftAbsolute(m_measuredValues);
            rqQueryEncoderLeftAbsolute.onValueReceived += new OnValueReceived(rqQueryEncoderLeftAbsolute_onValueReceived);
            m_querySet.Add(rqQueryEncoderLeftAbsolute);
            m_querySetShort.Add(rqQueryEncoderLeftAbsolute);

            RQQuery rqQueryEncoderRightAbsolute = new RQQueryEncoderRightAbsolute(m_measuredValues);
            rqQueryEncoderRightAbsolute.onValueReceived += new OnValueReceived(rqQueryEncoderRightAbsolute_onValueReceived);
            m_querySet.Add(rqQueryEncoderRightAbsolute);
            m_querySetShort.Add(rqQueryEncoderRightAbsolute);

            RQQuery rqQueryAnalogInputs = new RQQueryAnalogInputs(m_measuredValues);
            rqQueryAnalogInputs.onValueReceived += new OnValueReceived(rqQueryAnalogInputs_onValueReceived);
            m_querySet.Add(rqQueryAnalogInputs);

            RQQuery rqQueryDigitalInputs = new RQQueryDigitalInputs(m_measuredValues);
            rqQueryDigitalInputs.onValueReceived += new OnValueReceived(rqQueryDigitalInputs_onValueReceived);
            m_querySet.Add(rqQueryDigitalInputs);
            m_querySetShort.Add(rqQueryDigitalInputs);  // whiskers are in priority queue

            RQQuery rqQueryHeatsinkTemperature = new RQQueryHeatsinkTemperature(m_measuredValues);
            rqQueryHeatsinkTemperature.onValueReceived += new OnValueReceived(rqQueryHeatsinkTemperature_onValueReceived);
            m_querySet.Add(rqQueryHeatsinkTemperature);

            RQQuery rqQueryMotorAmps = new RQQueryMotorAmps(m_measuredValues);
            rqQueryMotorAmps.onValueReceived += new OnValueReceived(rqQueryMotorAmps_onValueReceived);
            m_querySet.Add(rqQueryMotorAmps);

            RQQuery rqueryMotorPower = new RQQueryMotorPower(m_measuredValues);
            rqueryMotorPower.onValueReceived += new OnValueReceived(rqueryMotorPower_onValueReceived);
            m_querySet.Add(rqueryMotorPower);

            RQQuery rqQueryVoltage = new RQQueryVoltage(m_measuredValues);
            rqQueryVoltage.onValueReceived += new OnValueReceived(rqQueryVoltage_onValueReceived);
            m_querySet.Add(rqQueryVoltage);

            foreach (RQQuery query in m_querySet)
            {
                foreach(string vName in query.ValueNames)
                {
                    m_loggedValueNames.Add(vName);
                }
            }

            isUnknownState = true;
            isInError = false;

            //startMonitoringThread();
        }
        public ControllerRQAX2850(string portName)
        {
            Tracer.Trace("ControllerRQAX2850(" + portName + ")");

            m_portName = portName;

            m_queues[0] = m_commandQueue = new RQInteractionQueue("command", 3);                 // highest priority factor
            m_queues[1] = m_commandPowerLeftQueue = new RQMotorCommandQueue("commandPowerLeft"); // one-slot queue; must be "equalized" with the m_commandPowerRightQueue in terms of processing order. PriorityFactor = 2;
            m_queues[2] = m_commandPowerRightQueue = new RQMotorCommandQueue("commandPowerRight");
            m_queues[3] = m_queryQueue = new RQInteractionQueue("query", 1);                     // lowest priority factor

            RQQuery rqQueryEncoderSpeed = new RQQueryEncoderSpeed(m_measuredValues);

            rqQueryEncoderSpeed.onValueReceived += new OnValueReceived(rqQueryEncoderSpeed_onValueReceived);
            m_querySet.Add(rqQueryEncoderSpeed);
            m_querySetShort.Add(rqQueryEncoderSpeed);

            RQQuery rqQueryEncoderLeftAbsolute = new RQQueryEncoderLeftAbsolute(m_measuredValues);

            rqQueryEncoderLeftAbsolute.onValueReceived += new OnValueReceived(rqQueryEncoderLeftAbsolute_onValueReceived);
            m_querySet.Add(rqQueryEncoderLeftAbsolute);
            m_querySetShort.Add(rqQueryEncoderLeftAbsolute);

            RQQuery rqQueryEncoderRightAbsolute = new RQQueryEncoderRightAbsolute(m_measuredValues);

            rqQueryEncoderRightAbsolute.onValueReceived += new OnValueReceived(rqQueryEncoderRightAbsolute_onValueReceived);
            m_querySet.Add(rqQueryEncoderRightAbsolute);
            m_querySetShort.Add(rqQueryEncoderRightAbsolute);

            RQQuery rqQueryAnalogInputs = new RQQueryAnalogInputs(m_measuredValues);

            rqQueryAnalogInputs.onValueReceived += new OnValueReceived(rqQueryAnalogInputs_onValueReceived);
            m_querySet.Add(rqQueryAnalogInputs);

            RQQuery rqQueryDigitalInputs = new RQQueryDigitalInputs(m_measuredValues);

            rqQueryDigitalInputs.onValueReceived += new OnValueReceived(rqQueryDigitalInputs_onValueReceived);
            m_querySet.Add(rqQueryDigitalInputs);
            m_querySetShort.Add(rqQueryDigitalInputs);  // whiskers are in priority queue

            RQQuery rqQueryHeatsinkTemperature = new RQQueryHeatsinkTemperature(m_measuredValues);

            rqQueryHeatsinkTemperature.onValueReceived += new OnValueReceived(rqQueryHeatsinkTemperature_onValueReceived);
            m_querySet.Add(rqQueryHeatsinkTemperature);

            RQQuery rqQueryMotorAmps = new RQQueryMotorAmps(m_measuredValues);

            rqQueryMotorAmps.onValueReceived += new OnValueReceived(rqQueryMotorAmps_onValueReceived);
            m_querySet.Add(rqQueryMotorAmps);

            RQQuery rqueryMotorPower = new RQQueryMotorPower(m_measuredValues);

            rqueryMotorPower.onValueReceived += new OnValueReceived(rqueryMotorPower_onValueReceived);
            m_querySet.Add(rqueryMotorPower);

            RQQuery rqQueryVoltage = new RQQueryVoltage(m_measuredValues);

            rqQueryVoltage.onValueReceived += new OnValueReceived(rqQueryVoltage_onValueReceived);
            m_querySet.Add(rqQueryVoltage);

            foreach (RQQuery query in m_querySet)
            {
                foreach (string vName in query.ValueNames)
                {
                    m_loggedValueNames.Add(vName);
                }
            }

            isUnknownState = true;
            isInError      = false;

            //startMonitoringThread();
        }