HITI Data

Refer to this article to learn more about HITI Data.

Digital Data

There are 32 Digital Data available (index 0 to 31). You can read or write a boolean value to it.

  • HC_digitalDataRead(index)               => read value (bool) from the Digital Data.
  • HC_digitalDataWrite(index, value)  => write value (bool) to the Digital Data

The Command Panel of a Digital Data can be used as :

  • An Indicator to monitor a boolean value in your Arduino program
  • Switch or a Button to control a boolean value in your Arduino program (usually to trigger actions)

Example 1

To use a Command Panel as a Switch.

void loop()
{
    // communicate with HITIPanel
    HC_communicate();

    // if the Switch is activated (from Command Panel DD2)
    if (HC_digitalDataRead(2) == HIGH)
    {
        // do some actions ...
    }
}

Refer to this example : Digital Data (Switch)

Example 2

To use a Command Panel as a Button (click) :

void loop()
{
    // communicate with HITIPanel
    HC_communicate();

    // if the Button is activated (from Command Panel DD0)
    if (HC_digitalDataRead(0) == HIGH)
    {
        // deactivate Button
        HC_digitalDataWrite(0, LOW);

        // do some actions ...
    }
}

Refer to this example: Digital Data (Button).

Example 3

To use a Command Panel as an Indicator.

void loop()
{
    // communicate with HITIPanel
    HC_communicate();

    // read sensor on AI0
    int value = analogRead(0);

    // check for warnings
    bool warning_tooLow  = digitalRead(value < 10);
    bool warning_tooHigh = digitalRead(value > 60);

    // display warnings in Command Panels DD0 and DD1
    HC_digitalDataWrite(0, warning_tooLow);
    HC_digitalDataWrite(1, warning_tooHigh);
}

Refer to this example : Digital Data (Indicator)

Analog Data

There are 20 Analog Data available (index 0 to 19). You can read or write a float value to it.

  • HC_analogDataRead(index)             => read value (float) from the Analog Data.
  • HC_analogDataWrite(index, value)  => write value (float) to the Analog Data

The Command Panel of an Analog Data can be used as :

  • A Metric to display an analog value in your Arduino program
  • A Setpoint to set an analog value in your Arduino program

Example 1

To use a Command Panel as a Metric.

void loop()
{
    // communicate with HITIPanel
    HC_communicate();

    // read sensor on AI0
    int value = analogRead(0);

    // convert to V and °C
    float voltage = convertToVoltage(value);
    float degrees = convertToDegrees(value);

    // display converted values in Command Panels AD11 and AD12
    HC_analogDataWrite(11, voltage);
    HC_analogDataWrite(12, degrees);
}

Refer to this example : Analog Data (Metric)

Example 2

To use a Command Panel as a Setpoint.

void loop()
{
    // communicate with HITIPanel
    HC_communicate();

    // get position setpoint entered in Command Panel AD0
    int position = analogDataRead(0);

    // move motor to requested position
          moveMotor(position);
}

Refer to this example : Analog Data (Setpoint)

CONTENTS

HITISoftware

Control and Monitoring Software for Arduino