Browsed by
Categoría: 20 IOs PLC (Ardbox)

Ardbox blog information

RS-485 TEST ON Ardbox HD

RS-485 TEST ON Ardbox HD

In this post it is showed how to test the RS-485 on Ardbox HF version.

The first thing that you need to know is that the  RS-485 HF version have full and half duplex communication. Controlling the dip switch you must select if you want to work on full or half duplex. There is internally installed a half duplex MAX485 and MAX485 transmitter. If you are working on full duplex you will use the MAX485 half duplex to receive data and MAX485 transmitter to send the data.

If you are working half duplex or full duplex the mapping is:

Max485 Arduino Pins
RX (RO) RX Serial1 (0)
TX (DI) TX Serial1 (1)
RE (inverted logic) 11
DE 10

 

To do the full duplex test you must connect the A, B (receivers) to the Y, X(transmitters). For half duplex you must connect with another device with RS-485 and select if you want to transmit or receive data with comment or uncomment “#define” command.

Next it is showed the test code for half duplex:

#define TEST_RS485_TX
//#define TEST_RS485_RX
 
int _rs485DE = 10;
int _rs485RE = 11;

///////////////////////////////////////////////////////////////////////////////
void setup() {
  Serial.begin(9600L);
  Serial.println("M-Duino PLUS RS-485 test started");
  
  Serial1.begin(9600L);
  pinMode(_rs485RE, OUTPUT);
  digitalWrite(_rs485RE, LOW);
  pinMode(_rs485DE, OUTPUT);
  digitalWrite(_rs485DE, LOW);
}
//////////////////////////////////////////////////////////////////////////////
void loop() {

#if defined TEST_RS485_TX
  digitalWrite(_rs485RE, HIGH);
  digitalWrite(_rs485DE, HIGH);
  Serial1.write(0x12);
  Serial1.flush();
  digitalWrite(_rs485DE, LOW);
  digitalWrite(_rs485RE, LOW);
  delay(1000);
#endif // TEST_RS485_TX

#if defined TEST_RS485_RX
  if (Serial1.available()) {
    if (Serial1.read() == 0x12) {
      Serial.println("RX");
    }
   }
#endif // TEST_RS485_RX
}

 

Next it is showed the test code for half duplex:

int _rs485DE = 10;
int _rs485RE = 11;

///////////////////////////////////////////////////////////////////////////////
void setup() {
  Serial.begin(9600L);
  Serial.println("M-Duino PLUS RS-485 test started");
  
  Serial1.begin(9600L);
  pinMode(_rs485RE, OUTPUT);
  digitalWrite(_rs485RE, LOW);
  pinMode(_rs485DE, OUTPUT);
  digitalWrite(_rs485DE, LOW);
}
//////////////////////////////////////////////////////////////////////////////
void loop() {
  digitalWrite(_rs485RE, HIGH);
  digitalWrite(_rs485DE, HIGH);
  Serial1.write(0x12);
  Serial1.flush();
  digitalWrite(_rs485DE, LOW);
  digitalWrite(_rs485RE, LOW);
  delay(1000);

  if (Serial1.available()) {
    if (Serial1.read() == 0x12) {
      Serial.println("RX");
    }
   }
}

See also:

RS-485 TEST ON M-DUINO PLUS

How to connect PLC to power supply

How to connect PLC to power supply

  • MDuino Family PLC are 12-24Vdc supplied. IMPORTANT: The polarity IS NOT REVERSAL!
  • Ensure that the live and GND connector of the power supply match the PLC.
  • Ensure that the power supply mains output is not higher than 24Vdc.

  • Suggested power suppliers

See also:

M-DUINO CONFIGURATION SWITCHTYPICAL CONNECTIONS FOR M-DUINO RELAY OR M-DUINO DIGITAL/ANALOGTYPICAL CONNECTIONS FOR M-DUINO RELAY OR M-DUINO DIGITAL/ANALOGM-DUINO MECHANICALM-DUINO RELAYM-DUINO ANALOG/DIGITALARDBOX ANALOGARDBOX RELAY

 
Instalación de los equipos de Industrial Shields al Arduino IDE

Instalación de los equipos de Industrial Shields al Arduino IDE

Para poder programar nuestros equipos de forma aún más fàcil, es posible instalarlos al Arduino IDE. Una vez instalados no será necesario saber la placa Arduino que incorpora cada equipo, ni consultar el mapeo entre los pines de la placa Arduino y las entradas y salidas de los PLCs, ni tan solo será necesario el uso de nuestra librería: toda esta información ya estará integrada en el Arduino IDE. Cuando se seleccione uno de nuestros PLCs, ya estarán disponibles las entradas y salidas con sus nombres, además de librerías que facilitarán el uso de los diferentes puertos de comunicaciones (RS-232, RS-485, …).

Read More Read More

RTC library for Arduino based PLC (DS1307 RTC)

RTC library for Arduino based PLC (DS1307 RTC)

The Industrial Shields PLCs use original Arduino boards. Then the PLCs can be used as individually Arduino boards by The Arduino IDE. To use the original boards let the users to programm the PLCs by others programs which can program Arduino boards too. 

You can use different models of RTC with the PLCs. This example shows how tu use the DS1307 RTC board.

It is necessary to download the RTC library from GitHub:

https://github.com/PaulStoffregen/Time

After the downloaded you can upload that library on the Arduino sketch. (you can see an example about how to upload a library on: 

Industrial Shields library in Arduino IDE.

Then, to use the RTC board it is necessary to make 2 steps. 

  • The first one put the RTC board on time.
  • The second step confirm that the RTC is running.

STEP 1:

Upload to the Arduino the settime.ino file.

STEP 2:

Upload to the Arduino the readtest.ino file.

See Also:

Using the original Arduino IDE

Ardbox Analog

Ardbox Analog

 
plc-arduino-ardbox-analog-20-din
The Ardbox Analog is a PLC based on Open Source Hardware including Arduino Leonardo board. It has a 16MHz crystal oscillator and a micro USB connection.
 
Power
This PLC can be powered at 12 – 24Vdc
 
Memory
The Ardbox Relay has 32KB (4KB used for the bootloader). It also have 2.5KB of SRAM and 1KB of EEPROM (Wich can be read and written with the EEPROM library) all from the Arduino Leonardo.
 
Input and Output
It has 20 input/output signals,
  • 10 Inputs, of which:
    • 9 can be used as Analog Input 0-10Vdc, 10bits,(using Pins A0, A1, A2, A3, A4, A5, D4-A6, D8-A9, D12-A7). All of them can also be used as Digital Inputs.
    • 1 are Digital Input which can work as a Interrupt Input also. (using Pins D2).
  • 10 Outputs, of which:
    • 3 are Digital Output. Using Pins D0, D1, D7.
    • 7 are Analog Output 0-10Vdc, 8bits. Using Pins D3, D5, D6, D9, D10, D11, D13. All of them can also work as Digital Output and PWM output.
Ardbox Relay

Ardbox Relay

plc-arduino-arbox-relay-20-din
The Ardbox Relay is a PLC based on Open Source Hardware including Arduino Leonardo board. It has a 16MHz crystal oscillator and a micro USB connection.
 
Power
This PLC can be powered at 12 – 24Vdc
 
Memory
The Ardbox Relay has 32KB (4KB used for the bootloader). It also have 2.5KB of SRAM and 1KB of EEPROM (Wich can be read and written with the EEPROM library) all from the Arduino Leonardo.
 
Input and Output
It has 20 input/output signals,
  • 10 Inputs, of which:
    • 6 can be used as analog Input 0-10Vdc,(using Pins A0, A1, A2, A3, A4, A5). All 6 can also be used as Digital Inputs.
    • 4 are Digital Input which can work as a Interrupt Input also. (using Pins D0, D1, D2, D3).
  • 10 Outputs, of which:
    • 8 are Relay Outputs (220Vac, 5A max). (Using Pins D4, D7, D8, D9, D10, D11, D12, D13).
    • 2 are analog Output 0-10Vdc. (Using Pins D5, D6).
(English) Ardbox Software Interface

(English) Ardbox Software Interface

Software Interface:

Arduino IDE is compatible to program these PLCs. You must download a start code in www.industrialshields.com at product page in “document files” section and then open it with Arduino IDE.

Configuration of Arduino IDE:

All Ardbox PLCs use an Arduino Leonardo and you need to choose these option in Arduino IDE.

arduino_ide

Read More Read More

Ardbox Analog I/O Pinout

Ardbox Analog I/O Pinout

plc-arduino-ardbox-analog-20-dinArdbox Analog has diferent types of Inputs and Outputs.

Base

(common unit)  

RIGHT Zone

Ardbox  Connector

Arduino Pin

Function

 
A0.6
A0.5
A0.4
A0.3
A0.2
A0.1
A0.0
Q0.9
Q0.8
Q0.7
Q0.6
Q0.5
Q0.4
Q0.3
Q0.2
Q0.1
Q0.0
(-) Com
24VCOM
3
5
6
9
10
11
13
0 
1
7
3
5
6
9
10
11
13
Analog Out
Analog Out
Analog Out
Analog Out
Analog Out
Analog Out
Analog Out
PWM/digital Output
PWM/digital Output
PWM/digital Output
PWM/digital Output
PWM/digital Output
PWM/digital Output
PWM/digital Output
PWM/digital Output
PWM/digital Output
PWM/digital Output
Isolated GND
Isolated Vdc Out
 ardbox_analog_side00

On the right zone is available a Switch to configurate output configuration functions as a digital or analog mode. 

Read More Read More