Browsed by
Categoría: Productos

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 Install and use Rapid SCADA on Touchberry Pi and BananaTouch

How to Install and use Rapid SCADA on Touchberry Pi and BananaTouch

On this post is showed how to install Rapid SCADA on a Touchberry B3 PI 10.1″, BananaTouch Octacore M3 10.1″, BananaTouch M64 10.1″ and TouchBerry Pi B3 7″ IN/OUT.

These products use an official Raspberry Pi 3 or an official Banana Pi products. These products have installed a Linux Debian Jessie. So,on this post we will see how to install Rapid SCADA on this OS. Rapid SCADA is free, open source, full featured SCADA software. 

This post is divided for three section: how to install Rapid SCADA,  how to configure Rapid SCADA and how to displayed on the Touch.

Read More Read More

RS-485 TEST ON M-DUINO PLUS

RS-485 TEST ON M-DUINO PLUS

In this post it is showed how to test the RS-485 on M-Duino PLUS version.

The first thing that you need to know is that the  RS-485 PLUS 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:

Read More Read More

Ethernet test on M-Duinos PLUS version

Ethernet test on M-Duinos PLUS version

In this post it is showed how to test Ethernet communication on M-Duino PLUS version

It’s necessary to install Arduino Ethernet2 library. See more infromation about Ethernet library functions on Arduino Reference.

Connecting an M-Duino to a router through Ethernet and uploading the test sketch, the M-Duino is able to complete the test.  

Next is showed the code:

Read More Read More

RS-232 Test on M-Duino PLUS

RS-232 Test on M-Duino PLUS

In this post it is showed how to test the RS-232 M-Duino PLUS version.

Connecting an M-Duino with other equipment through RS-232. On the code is showed that you must send a 0xA5 thought RS-232 to complete this test.

Next is showed the code:

/////////////////////////////////////////////////////////////////////////////
void setup() {
  Serial.begin(9600L);
  Serial.println("mduino-plus test RS-232 started");
  Serial2.begin(9600L);
}
/////////////////////////////////////////////////////////////////////////////
void loop() {
  while (Serial2.available()) {
    Serial2.read();
  }
  Serial2.write(0xa5);
  
  delay(50);
  
  if (Serial2.read() == 0xa5) {
    Serial.println("RS232 (Serial2) OK");
  } else {
    Serial.println("RS232 (Serial2) FAIL");
  }
  
  delay(1000);
}
TCP Server on Touchberry Pi 3 with Node.js

TCP Server on Touchberry Pi 3 with Node.js

On this post it showed how to implement a TCP server on Touchberry Pi 3

The requirements of this post is just a Touchberry Pi with internet connection.

To get the Node.js JavaScript interpreter we need to install the command cURL on our Linux.

cURL command is  very useful for HTTP/S requests. To get the cURL we just need to type on the Linux Terminal:

sudo apt-get install curl

Read More Read More