### Browsed byCategory: Software

Software available to use Arduino Based PLC

How to use RS232 on Industrial Arduino Based PLC

## How to use RS232 on Industrial Arduino Based PLC

On this post it’s showed how to use RS232 on an Arduino based PLC of Industrial Shields. To use RS232 is required the next points: Industrial Shields equipment (not any Ardbox HF version) Industrial Shields boards installed, follow this older post to install it. Hardware Configuration The first step is configure the hardware. The right connections between the desired devices are showed below: Industrial Shields PCL RS232 Device RX TX TX RX GND GND   Also it’s important to have…

FUNCTION TO calculate a square root of a number

## FUNCTION TO calculate a square root of a number

The function to calculate a square root of a number is sqrt(). Function sqrt(x); Parameter x: could be any data type  Example Next it is showed a simple example of how to print a square root of an analog value every second. long number = 0; void setup() { Serial.begin(9600L); } void loop() { number = sqrt(analogRead(I0_7)); Serial.println(number); delay(1000); }

HOW TO CALCULATE THE VALUE RAISED TO A POWER WITH ARDUINO IDE

## HOW TO CALCULATE THE VALUE RAISED TO A POWER WITH ARDUINO IDE

In this post it will be seen how to calculate the value raised to a power. Basically this function takes a number(base) and it raises to another number(exponent).  The function for calcultaing the value raised to a power using Arduino IDE is pow().  This function is used to raise a number to a certain exponent. *With latest version of Industrial Shields boards it isn’t necessary to configure the pins, just selecting the properly board, I/O’s will be automatically configured.  Function pow(base, exponent) Parameters…

HOW TO UPLOAD A SKETCH USING ETHERNET.

## HOW TO UPLOAD A SKETCH USING ETHERNET.

In this post it will be shown how to proceed in order to upload a sketch using the Ethernet instead of using the tipical Serial (USB). This is really useful in order to upload a sketch being far from the Arduino board. This post is been prepared for upload a code using Linux and using Windows. This process is a bit long and for this reasons it has been divided in the 3 big parts. 1.How to install the Ariadne…

HOW TO PAUSE THE EXECUTION OF THE CODE WITH ARDUINO IDE with microseconds

## HOW TO PAUSE THE EXECUTION OF THE CODE WITH ARDUINO IDE with microseconds

In this post it will be seen how to pause the execution code for a certain time in microseconds.  Basically this function pauses the program for a certain time and after this time it continues as normal.  The function for pause the execution code for a certain time in microseconds using Arduino IDE is delayMicroseconds()  This function is used to set a time of pause. *With next version of Industrial Shields boards won’t be necessary to configure the pins, just selecting the properly board,…

UPLOADING A SKETCH TO A PLC USING ETHERNET. STEP 3. TFTP CLIENT

## UPLOADING A SKETCH TO A PLC USING ETHERNET. STEP 3. TFTP CLIENT

In this post it will be seen how to send the binary file of an sketch into Arduino using Ethernet with tftp Client. Furthermore it is needed to use Telnet in order to do a remote reset. As in the step 2 of this process this post will be divided in two different parts. One for sending the binary file using Windows and the other using Linux.   Windows For sending an sketch using the tftp Client it is need…

How to read time on Arduino IDE

## How to read time on Arduino IDE

In this post it will be seen how to read the time since the Arduino based PLC board began running with the function millis().  Basically this function return the number of milliseconds since the controller began running the current program. This function is really useful when you want to control process comparing time *This value will overflow after 50 days approximately Function time = millis(); Parameters Nothing Return Unsigned long of millisecond since the controller program started Example Code Example,…

Modbus TCP/IP library for Arduino based PLC’s

## Modbus TCP/IP library for Arduino based PLC’s

On this post it’s showed one of the best Modbus TCP/IP libraries. This library has been tasted on Industrial Shields labs and it fits communicating with other Modbus TCP/IP industrial devices.   How to install? Download the zip file on Modbus TCP/IP libraries. Extract the .ZIP file. Copy and paste the mudbus.h and mudbus.cpp in the directory of the sketch that calls the mudbus library. If using the “Ethernet2” library the mudbus.h needs to be modified. Inside the mudbus.h file there…

HOW TO PAUSE THE EXECUTION OF THE CODE WITH ARDUINO IDE

## HOW TO PAUSE THE EXECUTION OF THE CODE WITH ARDUINO IDE

In this post it will be seen how to pause the execution code for a certain time.  Basically this function pauses the program for a certain time and after this time it continues as normal.  The function for pause the execution code for a certain time using Arduino IDE is delay().  This function is used to set a time of pause. *With next version of Industrial Shields boards won’t be necessary to configure the pins, just selecting the properly board, I/O’s will…