|| Back to Support & Help Documentation ||

Ardbox Relay I/Os

General I/Os features




Ardbox Relay I/O pinout







Switch configuration

LEFT ZONE

Communications and inputs/outputs can not work simultaneously.



1.      1. NC – Not Connected

 2. H/F – Choosing between Half/Full Duplex for the RS485 communication. In order to use Full Duplex, it has to be considered the TOP ZONE and the JUMPER ZONE.


3. SCL/R5 – Choosing between SCL (I2C) and R5. If the switch is ON, the R5 will be enabled and the SCL will be disabled. If the switch is OFF, SCL will be now enabled and R5 disabled.

4. SDA/I0.0 - Choosing between SDA (I2C) and I0.0. If the switch is ON, the I0.0 will be enabled and the SDA will be disabled. If the switch is OFF, SDA will be now enabled and R5 disabled.

1. RE-RS485 – If this switch is ON, the I0.4 switch must be set to OFF. Being in ON mode it enables RE for the RS-485.


2. I0.4 – If this switch is ON, the RE-RS485 switch must be set to OFF. Being in ON mode it enables the input I0.4.

3. DE-RS485 – If this switch is ON, the I0.5 switch must be set to OFF. Being in ON mode it enables DE for the RS-485.


4. I0.5 – If this switch is ON, the DE-RS485 switch must be set to OFF. Being in ON mode it enables the input I0.5.


TOP ZONE


    1. D1 – RS-485: If this switch is ON, the R8 switch must be set to OFF. Being in ON mode it enables DI for the RS-485 and RS-232 Hardware Serial ( see section 9 for jumper configuration)


    2. R8: If this switch is ON, the DI – RS-485 switch must be set to OFF. Being in ON mode it enables the Relay 8.



    3. D0 – RS-485: If this switch is ON, the R7 switch must be set to OFF. Being in ON mode it enables D0 for the RS-485 or RS-232 Hardware Serial ( see section 9 for jumper configuration).



    4. R7: If this switch is ON, the D0 – RS-485 switch must be set to OFF. Being in ON mode it enables the Relay 7.



Jumpers configuration



SOFTWARE


IMPORTANT: Make sure to download the Arduino based PLC boards for Arduino IDE.


In this section we proceed to test digital and analog I/Os. These tests are prepared to make writings and readings in analog and digital pins.


Reading a Digital Input: 


Next is showed the syntax:


DigitalRead(pin);

Pin: Could be any industrial shields equipment pin or any Arduino board pin that you wish to set.

The function for reading from a digital input using Arduino IDE is DigitalRead().  This function is used to read a digital signal (high or low).

 On Industrial Shields equipments is followed with the corresponding pinout. This functions are normally used inside the loop() function.

void setup() {

    pinMode(I0_2, INPUT);

}

void loop() {

    digitalRead(I0_2);

}

Writing in a Digital Input: 

Next is showed the syntax:

DigitalWrite(pin, value);

Pin: Could be any industrial shields equipment pin or any Arduino board pin that you wish to set. 

Value: HIGH or LOW (See more information on Arduino references)

Code Example, blinking of two digital outputs:

void setup() {
  pinMode(Q0_1, OUTPUT);
}

void loop() {
  digitalWrite(Q0_1, HIGH);
  delay(1000);             // delay 1s

  digitalWrite(Q0_1, LOW);
  delay(1000);
}


Reading an Analog Input:

Next is showed the syntax:

AnalogRead(pin);

Pin: Could be any industrial shields equipment pin or any Arduino board pin that you wish to set. 

Code Example, reading from an analoglRead:

void setup() {

    pinMode(I0_2, INPUT);
}

void loop() {
    analogRead(I0_2);
}


Writing in an Analog Input: 

Next is showed the syntax:

AnalogWrite(pin, value);

Pin: Could be any industrial shields equipment pin or any Arduino board pin that you wish to set. 

Value: 0 to 255(See more information on Arduino references)

Code Example, blinking of an analog outputs:

void setup() {
  pinMode(A0_5, OUTPUT); // configure A0.5 as OUTPUT
}

void loop() {
  analogWrite(A0_5, 0);
  delay(1000);             // delay 1s
  digitalWrite(A0_5, 255); 
  delay(1000);
}

Writing in a Relay:

In this example relay output R1 (Ardbox Relay)  is switched ON (switch closed) and switched OFF  (switch opened).

#define R1 10   

void setup() {   
  

}   
void loop() { 
  
digitalWrite(R1,HIGH); // close the relay switch
delay(500);  // wait 500ms
digitalWrite(R1,LOW); // opens the relay switch
delay(500);
 }
 * The relays of our equipment have a switching frequency of 120 operations/min.

By following these steps carefully, you will be able to achieve the use of the I/Os using the Industrial Shields equipment.


1 Star 2 Star 3 Star 4 Star 5 Star