Browsed by
Category: Ethernet PLC (M-Duino)

Ethernet PLC (M-Duino) blog information

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

Using the original Arduino IDE

Using the original Arduino IDE

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. 

To start using this devices it is necessary:

  • Download the Arduino IDE from www.arduino.org

Arduino Ide let to use these devices as a individually Arduino boards. It is necessary to see the diferent technical details from each product user guide and see the pinout details about the pin configuration because each pin can be configurated as:

Read More Read More

Software available to use Arduino based PLC

Software available to use Arduino based PLC

Software available to use Arduino based PLC:

All PLCs use an original Arduino board inside.

For this reason it is possible to use several softwares to develop your project. See below a list of some of availables software you can use on Arduino based PLCs:

Resultado de imagen de arduino ide

The original one. This is the most used platform to use Arduino boards.  It is not necessary to modify any libraries to use Industrial Shields PLCs with this software. Anyway there is available an open Industrial Shields library available in GitHub.

Read More Read More

How to connect the Ethernet Port using w5100 library

How to connect the Ethernet Port using w5100 library

In this example, you will use the Ethernet port on the Ethernet family products.

Harware Required:

Comments:

All Ethernet family products use an Arduino Mega 2560 connected to the w5100 Ethernet chip.

The standard Ethernet shield for arduino use the SPI port where are connected the pins 50 (MISO), 51 (MOSI), 52 (SCK), 53 (SS), but for the M-duino Ethernet PLC the standard w5100 library from Arduino IDE the SS function is done by the digital PIN 10 because of was developed for the Arduino UNO board.

Then it is necessary to replace the original w5100.h library  to use the right library on that product.

note:

You can replace that library on:

using WINDOWS:

C:\Program Files (x86))
<Directori standard d’instal·lació>\Arduino\libraries\Ethernet\src\utility\w5100.h

using LINUX:

/Arduino/libraries/Ethernet/src/utility/w5100.h

 

UPLOADING EXAMPLE CODE:

In this example you can get the time from an NTP server

Read More Read More

Modbus TCP M-Duino

Modbus TCP M-Duino

Modbus TCP can be programmed in M-Duino PLCs.

Once the Arduino IDE is configured according to Industrial Shields requirements

http://blog.industrialshields.com/es/ethernet-shield-libraries/, the follwoing library can be used to program the M-Duino as Modbus TCP slave.

Basically, this example links holding registers 40000, 40001 and 40002 to outputs Q0.1, Q0.2 and Q0.3 of the M-Duino. In this way these 3 outputs can be operated via a Modbus TCP master. You will have to modify the IP address and network parameters according to your LAN.

An illustrative and simple example to test the application is with the following android free app. https://play.google.com/store/apps/details?id=com.bencatlin.modbusdroid&hl=es
Which will allow you to operate the M-Duino outputs via your smartphone. You only need to set the IP address of the slave and  you can begin controlling the M-Duino remotely.

ModbusDroid

Now you can simply remotely control your M-Duino.

Enjoy it!

Interrupt Inputs Ardbox / MDuino

Interrupt Inputs Ardbox / MDuino

This post shows how to use the interrup inputs that  Industrial Shields PLCs have available. For information and description on what are interrupt inputs and how these work see this link. The interrupt inputs for Industrial Shields PLCs are listed in the pinout section of the datasheet. 

 

In this example the interrupt input I0.0  is used to caught  the pulse of an encoder (for proper connection and wiring  check this post). Every time that interrupt I00 a RISING edge, the ‘encoder’ function will be triggered and count value increased by one unit. The  count value is printed on the serial monitor.

int I00 = 2; // Ardbox Analog I0.0 interrupt input. This pin will vary depending on the interrupt input or the Industrial Shields PLC.
int count=0;

void setup() {
    pinMode(pin, OUTPUT);
    attachInterrupt(digitalPinToInterrupt(I00),encoder, RISING);

Serial.begin(9600);
}

void loop() {
    Serial.println (count);
}

void encoder() {
    count=count+1;
}

The triggering event of the interrupt function can be configured as RISING, FALLING, LOW or CHANGE (see link).

 

Isolated Inputs Ardbox/M-Duino

Isolated Inputs Ardbox/M-Duino

In this post it is described how to use the galvanically isolated inputs in Idustrial Shields PLCs (Ardbox and M-Duino).

As shown in the Figure below, isolated inputs always have two available connections and both of these connections need to be wired for a proper performance of the inputs. The configuration if the inputs is PNP. All isolated inputs are DIGITAL,  not ANALOG.

Isolated inputs

Ix.x    –> Signal. Voltage up to 24V

(-) Ix.x –> reference or COM of the input signal.  

IMPORTANT: BOTH connections are required for the Inputs to work properly.

Ioslated_inputs_v1

The next peice of code shows how to read one isolated input. The example is based on M-Duino Relay, for other PLCs  the pin 2 should be replaced according to the PLC pinout.

int I00 = 2 // modify pin 2 accordingly to PLC pinout;

void setup() {

  pinMode(I00, INPUT);
  
  Serial.begin(9600); 	// Set up serial communication. It will allow to monitor the analog input value.
}

void loop() {

  Serial.println(digitalRead(I00));
  delay(2000); //wait 2 seconds
}
Ardbox – MDuino Arduino pin

Ardbox – MDuino Arduino pin

This post describes how to gain direct access to Arduino board pins  inside the  Ardbox and MDuino PLCs. This allows to work with the PLCs in the same way as using an Arduino, in other words,  pins at 5V and configurable as input or outpts.

Also, this  enables usage of  sensors  working at lower voltages than industrial standards 10V dc/24Vdc.  NOTE:Make sure the voltage DOES NOT EXCEED 5VDC!!!!!!!!

Following are listed the connections with direct access to the Arduino board  pins.

Ardbox: DE-D7  // RE-D4 // SDA-PIN2  // SCL-PIN3

MDuino: SCL // SDA // RX0 // TX0 // RX1 // TX1 // Pin3 // Pin2

In order to enable the direct connection to Arduino pins, the configuration switches for these connections must be set to OFF position.

DS18B20 Temperature sensor- One Wire – Ardbox – MDuino

DS18B20 Temperature sensor- One Wire – Ardbox – MDuino

This post describes how to use the DS18B20 digital temperature sensor with  Ardbox and MDuino PLCs.

DS18B20 sensor implements the one wire protocol and it works at 5V.  In the Ardbox and Mduino, this transducer can not be directly connected to the standard inputs Ix.x of the PLCs. 

Working at 5V and through the One wire protocol it must be directly connected to Arduino Pins. To do so, Industrial Shields PLCs hold some pins available.

Ardbox: DE-D7  // RE-D4 // SDA-PIN2  // SCL-PIN3

MDuino: SCL // SDA // RX0 // TX0 // RX1 // TX1 // Pin3 // Pin2

OneWireconnection

For using DS18B20 in the listed pins, its switch configuration  must be set to communication mode, as if we SDA/SCL or DE/RE wanted to be used (see Communications section in User Guides). Once the  switch is configured in this manner, the DS18B20 sensor  is programmed in the same way as for an Arduino. Several sensors can be connected and read at the same pin if wanted. DS18B20 tutorial

 

Download the example:

ds18b20