Giter Club home page Giter Club logo

modbusmaster's People

Contributors

2-718 avatar 4-20ma avatar agprimatic avatar kintel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

modbusmaster's Issues

ReadHoldindRegister

So I hope that somebody has gone though the same issue as me;
I'm trying to obtain the content of a holding register through the serial port. I can see the content but it's not understandable. What I'm getting It's not ASCII or any other variable type.
resut = node.readHoldingRegisters(25, 6);

Add continuous integration testing with travis

ModbusMaster version

0.11.0

Arduino IDE version

1.6

Arduino Hardware

all

Platform Details

any


Feature Request

Narrative:

As a project owner
I want all changes to compile without error
So that end users have a working library

Acceptance Criteria:

Scenario 1: Build is successful
Given a user submits a pull request
When it compiles without error on the automated ci tool
Then it is flagged as passing the build test

Scenario 1: Build fails
Given a user submits a pull request
When the build fails on the automated ci tool
Then it is flagged as failing the build test

Reorder Installation section of README

Feature Request

Reorder Installation section of README so it comes after Features and before Hardware. Rename Uploading Sketches section to Caveats.

Narrative:

As a project maintainer
I want documentation to be readily understood
So that users may quickly apply my library

Arduino Leonardo and ModbusMaster

Hello, I have a problem.
When I wanted to compile the example program the compiler returns an error:

ModbusMaster.cpp:36: error: conversion from ‘Serial_’ to non-scalar type ‘HardwareSerial’ requested
arduino-1.0.5/libraries/ModbusMaster/ModbusMaster.cpp: In member function ‘void ModbusMaster::begin(uint16_t)’:
arduino-1.0.5/libraries/ModbusMaster/ModbusMaster.cpp:139: error: no match for ‘operator=’ in ‘MBSerial = Serial’
arduino-1.0.5/hardware/arduino/cores/arduino/HardwareSerial.h:33: note: candidates are: HardwareSerial& HardwareSerial::operator=(const HardwareSerial&)

How to solve it?

RTU Request sometimes sent with leading eight 0x00 words

ModbusMaster version

2.0.1

Arduino IDE version

1.8.1

Arduino Hardware

DUE

Platform Details

Windows 10 x64


Scenario:

Communiction with a CAR ecu that talks modbus. It's working, the problem is that I get malformed requests sometimes

Steps to Reproduce:

This is my code:

void readModbusRegister()
{

  ecu.readHoldingRegisters(4097, 6); //read 6 registers beginning from offest 4097

  if (result == ecu.ku8MBSuccess)  //if transmission is good, decode Data
  {
    decodeModbusRegister();

  }

}


void decodeModbusRegister()  //read  word registers and write into data array
{

  for (j = 0; j < 6; j++)
  {
    data[j] = ecu.getResponseBuffer(j);
  }

  printValues(); //after decoding, print data
}

Expected Result:

Request is sent for 6 registers.

Actual Result:

Its working but sometimes the request packets are malformed:

 01 03 10 01 00 06 90 C8  <--- Good request
 01 03 10 01 00 06 90 C8  <--- Good request
 01 03 10 01 00 06 90 C8  <--- Good request
00 00 00 00 00 00 00 00 01 03 10 01 00 06 90 C8   <--- malformed request

arduino 1.0.6 Help

hello I have a program that only runs on IDE 1.0.6 and wish to add the Modbus instruction but the latter does not work with IDE 1.0.6, which I do? ..

Update README

  • Update README badges w/maxAge query
  • Add Github release badge (replace Github tag)
  • downcase license badge
  • make CODE_OF_CONDUCT.md link relative
  • clean up Features description
  • replace bullets * with -
  • add note about half-duplex operation in features
  • update Installation section to reflect Arduino Library Manager

Fix documentation build error

rm -f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out *.brf *.blg *.bbl refman.pdf
pdflatex refman
This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./refman.tex
LaTeX2e <2014/05/01>
Babel <3.9k> and hyphenation patterns for 78 languages loaded.

make: *** [refman.pdf] Error 1

EM-6433 register, Modbus, uno

  1. I ma using this modbus library to read (EM)6433, meter from scheider.
    Lib: https://github.com/4-20ma/ModbusMaster
    doc: http://4-20ma.io/ModbusMaster/
  2. (EM)6433 documentation is here: http://tinyurl.com/z7696ys
  3. Page 3 of above doc says that protocol is Modbus RTU, data:8 bits, baud: 9600(default) , parity:even, device address:1, stop bit:1
    In uno code, default seting is 9600 & parity zero. Is below setting ok in code?
    ModbusMaster node;
    Serial.begin(9600, SERIAL_8E1);
    node.begin(1, Serial);
  4. (EM)6433 doc on page 7 shows, read register "Average current", with address "3913" & return type is float 4 bytes in little endian.
    However this library has function "readHoldingRegisters" to read holding register. But this function reads only 16 bit registers.
    So should I use the function as:

result = node.readHoldingRegisters(3913, 2);
if (result == node.ku8MBSuccess)
{
for (j = 0; j < 2; j++)
{
data[j] = node.getResponseBuffer(j);
}
}
parameter 2, shows that 2 16 bit values are read.
How to convert it back to float?

I try to use the Library on Arduino Yun

On arduino yun i use the IDE 1.5.6-r2 ... but i get a problem with the library Error conversion from 'Serial_' to non scalar type ....

When the library will be ready for the new IDE ?

Multiple Reads

I have a unit where I need to read multiple registers from it. The registers I need are not next to each other and I need to make multiple read requests from the unit. If I try to do more than 1 read, when I get the values using the getResponseBuffer() function, the results are wrong. They seem to be the results from the last read and not the current one. Any help with this would be appreciated.

0.11.0 very slow writeMultipleRegisters

This might also be true for the other Modbus Functions, however I am currently only using writeMultipleRegisters.
With version 0.10.3 (and also 0.10.2 & 0.9.1), using the milli() function, the time it takes to perform a node.setTransmitBuffer, followed by a node.writeMultipleRegisters is around 209 milliseconds. If I use exactly the same sketch with version 0.11.0 the difference is almost exactly 10 times slower at 2006 milliseconds.

Here is my code to check this:

void loop() {
static uint32_t i = 0;
static long previousMillis = 0;
unsigned long currentMillis = 0;
uint8_t result;

// put your main code here, to run repeatedly:
previousMillis = millis();
node.setTransmitBuffer(0, lowWord(i++));
result = node.writeMultipleRegisters(3960, 1);
currentMillis = millis();

Serial.println(currentMillis - previousMillis);

//delay(1000);
}

Minor fix for the ESP8266 compiler

Hi, this is a really mice library!

After some work I got it working within the ESP8266 wifi module together with a max3232 chip. This is less than USD 5 to get a RTU Modbus hardware by wifi!

The only problem is that the esp compiler gets confused with your ModbusMaster::send function. The fix is very simple, just adjust the cast:
void ModbusMaster::send(uint8_t data)
{
send((word)data);
}

We also discussed this issue here:
esp8266/Arduino#360

All the best.

Serial1,2,3 not working on Arduino Mega

If I try to use Serial1, Serial2 or Serial3 on an Arduino Mega 2560 for the modbus master interface (e.g with:

ModbusMaster node(Serial1, 4);

the code does not work. Although 'MBSerial' is correctly set to 'Serial1', no output appears on TX1 and the code hangs on MBSerial.flush().

Changing all occurrences of MBSerial to Serial1 in the library works as a workaround for me.
(tested with Arduino IDE 1.5.5-r2)

Fix documentation references in ModbusMaster.h, .cpp

ModbusMaster version

0.11.0

Arduino IDE version

1.6

Arduino Hardware

any

Platform Details

any


Scenario:

Add cross-references to ModbusMaster.cpp:

  • preTransmission() should reference
    • ModbusMasterTransaction()
    • postTransmission()
  • postTransmission should reference
    • ModbusMasterTransaction()
    • preTransmission()

Add example to ModbusMaster.h:
@example examples/RS485_HalfDuplex/RS485_HalfDuplex.ino

Create PULL_REQUEST_TEMPLATE

As a project user
I want to know what information is required to submit a pull request
So that my request may be accepted quickly

Arduino DUE and Serial1,2,3

Hi, thanks for super library.

I have problem with using different serial other then serial 0. On UNO si code fast and without problems. On DUE works slowly (but works). Serial1(2,3) on DUE didn't work at all. It sends nothing. I tried:
ModbusMaster node(Serial1,1);
ModbusMaster node(1,1);
Comunication not working.

I using library version 0.11.0, arduino IDE 1.6.8

Only corrections I made, is adding lines for TX enable and
MBSerial->begin(u16BaudRate, SERIAL_8E1)

Code works on UNO without any problems.

Pass Stream object instead of integer reference

Per Arduino style guide:

When using serial communication, allow the user to specify any Stream object, rather than hard-coding "Serial". This will make your library compatible all serial ports on Mega and the Due, and can also use alternate interfaces like SoftwareSerial. The Stream object can be passed to your library's constructor or to a begin() function (as a reference, not a pointer). See Firmata 2.3 or XBee 0.4 for examples of each approach.

Refer to http://www.arduino.cc/en/Reference/APIStyleGuide.

Changes:

  • update ModbusMaster.h, ModbusMaster.cpp interface, documentation
  • update examples

Test with real hardware and signal tracer

Rename HISTORY to CHANGELOG

CHANGELOG is more consistent with contemporary projects.

  • Rename HISTORY.md to CHANGELOG.md
  • Modify Rakefile rake task accordingly
  • Modify .github/PULL_REQUEST_TEMPLATE.md checklist

Arduino - MODBUS - Lib. problem.

// code below.

Basic.pde - example using ModbusMaster library

This file is part of ModbusMaster.

ModbusMaster is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

ModbusMaster is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with ModbusMaster. If not, see http://www.gnu.org/licenses/.

Written by Doc Walker (Rx)
Copyright © 2009-2013 Doc Walker <4-20ma at wvfans dot net>

*/

include <ModbusMaster.h>

// instantiate ModbusMaster object as slave ID 2
// defaults to serial port 0 since no port was specified
ModbusMaster node(2);

void setup()
{
// initialize Modbus communication baud rate
node.begin(19200);
}

void loop()
{
static uint32_t i;
uint8_t j, result;
uint16_t data[6];

i++;

// set word 0 of TX buffer to least-significant word of counter (bits 15..0)
node.setTransmitBuffer(0, lowWord(i));

// set word 1 of TX buffer to most-significant word of counter (bits 31..16)
node.setTransmitBuffer(1, highWord(i));

// slave: write TX buffer to (2) 16-bit registers starting at register 0
result = node.writeMultipleRegisters(0, 2);

// slave: read (6) 16-bit registers starting at register 2 to RX buffer
result = node.readHoldingRegisters(2, 6);

// do something with data if read is successful
if (result == node.ku8MBSuccess)
{
for (j = 0; j < 6; j++)
{
data[j] = node.getResponseBuffer(j);
}
}
}
// code end.

facing problem, message as under.

Arduino: 1.5.6-r2 (Windows 8), Board: "Arduino Due (Programming Port)"

Basic.pde:25: fatal error: ModbusMaster.h: No such file or directory
compilation terminated.

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.

Update README contact information

ModbusMaster version

0.11.0

Arduino IDE version

any

Arduino Hardware

any

Platform Details

any


Feature Request

Narrative:

As a project owner
I want project users to know how to get help
So that they may get their issues resolved efficiently

Update Particle library to latest version

ModbusMaster version

[Version of the project where you are encountering the issue]

Arduino IDE version

[Version of Arduino IDE in your environment]

Arduino Hardware

[Hardware information, including board and processor]

Platform Details

[Operating system distribution and release version]


Scenario:

[What you are trying to achieve and you can't?]

Steps to Reproduce:

[If you are filing an issue what are the things we need to do in order to repro your problem? How are you using this project or any resources it includes?]

Expected Result:

[What are you expecting to happen as the consequence of above reproduction steps?]

Actual Result:

[What actually happens after the reproduction steps? Include the error output or a link to a gist if possible.]


Feature Request

Narrative:

As a [role]
I want [feature]
So that [benefit]

Acceptance Criteria:

Scenario 1: Title
Given [context]
  And [some more context]...
When  [event]
Then  [outcome]
  And [another outcome]...

How is RS485 Tx Enable controlled

I am fairly new to Arduinos and am looking for an easy to use Modbus RTU master. With your ModbusMaster how is the Tx enable for the RS485 driver controlled? I can't see anywhere in your library where this can be set up. I expected the ModbusMaster.begin to allow the TxEn signal to be allocated to any Arduino digital out pin. All I can see for .begin are parameters for choosing the Arduino serial port and the Modbus Id for the slave.

Add Label section to CONTRIBUTING

ModbusMaster version

0.11.0

Arduino IDE version

any

Arduino Hardware

any

Platform Details

any


Feature Request

Narrative:

As a maintainer
I want to apply a structured approach to assigning issue labels
So that they are consistent over time

As a contributor or project user
I want to know how/why labels are assigned
So that I understand...
  issue status and how it's assigned,
  issue priority and how it's assigned, and
  issue type and how it's assigned

Implementation notes

Priority

  • Priority will generally start as Low and will be upgraded to Medium, High, or Critical, depending on the severity of the issue

Status

  • Abandoned: issue closed due to inactivity or item that will not be fixed
  • Blocked: issue or PR that will not be fixed (include explanation in issue/PR)
  • In Progress: issue has been assigned and is actively being addressed; label issue On Hold with comments if there will be a significant delay
  • Maintainer Review Needed: last step prior to merge; PR passes continuous integration tests and are able to be cleanly merged - awaiting review for style, code cleanliness, etc.
  • On Hold: provide various reasons an issue or PR might be on hold
  • Pending Contributor Response: closed after 14 days of inactivity (label Abandoned at closure)

Type

  • Bug: requires clear test case and be reproducible
  • Differentiate between enhancement, feature request, maintenance (with examples)
  • Feature requests require well-written, clear user story
  • Question - self explanatory

Use platformio to build against multiple boards

ModbusMaster version

1.0.0

Arduino IDE version

any

Arduino Hardware

any

Platform Details

any


Feature Request

Narrative:

As a project owner
I want my library to compile cleanly for multiple boards
So that it may be used on a wide variety of hardware

Acceptance Criteria:

Scenario 1: all boards
Given board is one of uno | due | huzzah | genuino101 | teensy31
When  `make` or `make all` is executed
Then  target compiles cleanly
Scenario 2: specific board
Given board is one of uno | due | huzzah | genuino101 | teensy31
When  `make <board>` is executed
Then  target compiles cleanly
Scenario 3: travis-ci
Given board is one of uno | due | huzzah | genuino101 | teensy31
When  `make build` is executed with PLATFORMIO_BOARD=<board>
Then  targets compile cleanly

Request timeout is impatient

I found that having a uint8_t is not enough of delay when trying to connect to an air compressor using your library. It seems that due to the nature of the design requests for certain registers requires long delays and a uint8_t is not enough. I bumped up ku8MBResponseTimeout to a uint16_t at 2000 millisecond delay time and everything began to work perfectly.

I have a potential fix that uses a uint16_t instead and it includes an overload constructor
ModbusMaster(uint8_t u8SerialPort, uint8_t u8MBSlave, uint16_t u16ResponseTimeout)

This should give the library greater flexibility of having a longer timeout that is easier to configure. I will test it out in the next few days and let you know. In the meantime, are there any reasons why uint8 was chosen, I'm not a Modbus expert so I'm not sure if there is a standard.

Update architecture switch to match Arduino convention

Refer to https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#working-with-multiple-architectures.

Use either:

#if defined(ARDUINO_ARCH_AVR)
  // AVR-specific code
#elif defined(ARDUINO_ARCH_SAM)
  // SAM-specific code
#else
  // generic, non-platform specific code
#endif

or:

#if defined(ARDUINO_ARCH_AVR)
  // AVR-specific code
#elif defined(ARDUINO_ARCH_SAM)
  // SAM-specific code
#else
  #error “This library only supports boards with an AVR or SAM processor.”
#endif

Code not work with arduino mega 2560 115200 baud rate

I used this code to read holding register with baud rate setup is 115200. it didn't work. If i set 57600 baud rate it work very good. I don't know this error from my Mega 2560 or modbus master code???
I wrote a test code to print "Hello world" with 115200 baud rate, It worked good????? please help me to check this problem??thanks.

Serial Port Mode

Hy,

is it possible to set the serial mode to SERIAL_8E1 with a baud rate of 9600 ?

I use it with arduino 1.6.9 with an ESP8266 v12 Module.

thank's a lot

Arduino 1.5.5 Beta

Hi,
I have used the library for my Arduino Mega2560 with Arduino IDE 1.0.5 r2.
It is working fine.

Couple of days before, I installed Arduino IDE 1.5.5 Beta. I compiled my project & upload to my Mega2560.
The library is not working. It can not get communicated to slave !! I tried simple serial program & it working fine. But this library is not working.
I was confused.
Then later on I decide to use Arduino IDE 1.0.5 r2. Now the library works fine.

So, I think, the library is not supported in Arduino 1.5.5 Beta.

This is For Your Information Only.
Thanks.
Dixit

Set __MODBUSMASTER_DEBUG__ to 0 by default

First off, great library and thanks for making it, overall I've been very happy with it and it has worked perfectly for my project.

However, these few lines were causing some odd behavior in my system that it took me a while to track down.

ModbusMaster.cpp lines 150-153:

#if __MODBUSMASTER_DEBUG__
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
#endif

The way I constructed my application is part of the reason it took a while, but generally I don't expect a library to change the state of pins in a hidden way. I recommend setting MODBUSMASTER_DEBUG to 0 by default, since if you intend to use the debugging features you will have no issue in enabling them, but most users will probably not be aware of this functionality and are more likely to be using digital pins 4 and 5.

If nothing else, it would be good to make the fact that this is enabled by default very obvious and mention it in the main README.

Thanks again for the library.

Work around HardwareSerial for SAM3 microprocessor

The ModbusMaster library currently uses an object of type HardwareSerial to abstract the serial port object. Figure out how to work around the following compiler error:

sketch_mar16a:3: error: cannot allocate an object of abstract type 'HardwareSerial'
/Applications/Arduino 1.5.2.app/Contents/Resources/Java/hardware/arduino/sam/cores/arduino/HardwareSerial.h:27: note:   because the following virtual functions are pure within 'HardwareSerial':
/Applications/Arduino 1.5.2.app/Contents/Resources/Java/hardware/arduino/sam/cores/arduino/HardwareSerial.h:35: note:   virtual size_t HardwareSerial::write(uint8_t)
/Applications/Arduino 1.5.2.app/Contents/Resources/Java/hardware/arduino/sam/cores/arduino/HardwareSerial.h:31: note:   virtual int HardwareSerial::available()
/Applications/Arduino 1.5.2.app/Contents/Resources/Java/hardware/arduino/sam/cores/arduino/HardwareSerial.h:33: note:   virtual int HardwareSerial::read()
/Applications/Arduino 1.5.2.app/Contents/Resources/Java/hardware/arduino/sam/cores/arduino/HardwareSerial.h:32: note:   virtual int HardwareSerial::peek()
/Applications/Arduino 1.5.2.app/Contents/Resources/Java/hardware/arduino/sam/cores/arduino/HardwareSerial.h:34: note:   virtual void HardwareSerial::flush()
/Applications/Arduino 1.5.2.app/Contents/Resources/Java/hardware/arduino/sam/cores/arduino/HardwareSerial.h:37: note:   virtual HardwareSerial::operator bool()
sketch_mar16a:3: error: cannot declare variable 'abc' to be of abstract type 'HardwareSerial'
/Applications/Arduino 1.5.2.app/Contents/Resources/Java/hardware/arduino/sam/cores/arduino/HardwareSerial.h:27: note:   since type 'HardwareSerial' has pure virtual functions

Bootloader crashing

I'm using your library for connection my Arduino Lenoardo ETH with another device via Modbus RTU.
Everything was going well before I come to my last function. This function have to write Float to 2 registers on the device.
I'm doing it with that function:
void WriteMultRegFloat(int adress,float Temp,int StartReg) { node.setTransmitBuffer(0x0,highWord(Temp)); node.setTransmitBuffer(0x1,lowWord(Temp)); node.writeMultipleRegisters(StartReg,2); node.clearTransmitBuffer(); }

And it crashes bootloader of my Arduino and I have to rewrite it with help of another Arduino via ICSP.

Change license to Apache 2.0

Make the following changes after source code changes have been merged.

  • Remove COPYING (GPLv3)
  • Add LICENSE (Apache-2.0)
  • Update README badge
  • Update README license text
  • Update license text in each source file

Clean up template wording

ModbusMaster version

0.11.0

Arduino IDE version

any

Arduino Hardware

any

Platform Details

any

  • add backticks to ISSUE_TEMPLATE.md
  • cleanup wording in PULL_REQUEST_TEMPLATE.md
  • fix backtick in CONTRIBUTING.md

Add Code of Conduct

ModbusMaster version

0.11.0

Arduino IDE version

1.6

Arduino Hardware

any

Platform Details

any


Feature Request

Narrative:

As a project owner
I want to contributors to have clear expectations related to interaction with other contributors
So that we foster an open and welcoming environment

Implement CRC for SAM3 microprocessor

The Modbus protocol uses a cyclic redundancy check (CRC) to verify data packets. The current ModbusMaster library uses the AVR-specific implementation found in <util/crc16.h>. Figure out a way to include this code for ARM SAM3 microprocessors (e.g. Arduino Due).

In file included from sketch_mar16a.ino:1:
/Users/doc/Documents/Automation/Arduino/libraries/ModbusMaster/ModbusMaster.h:83: fatal error: util/crc16.h: No such file or directory
compilation terminated.

Create ISSUE_TEMPLATE

As a project user
I want to know what information is required to submit an issue
So that my issue may be resolved quickly

Use the library with Arduino Uno

Hi buddy (4-20mA),

I just found that your github ModbusMaster library perfectly match my needs. Namely, I have an ElNet LT Energy&Powermeter (http://www.getelnet.com/wordpress/2009/10/15/elnet-lt/) that supports Modbus RTU communication an has built-in Functions 03, 04, 06, and 16.
I'm also planning to use max485 ESA transceiver and Arduino Uno board.

Now, I would like to know is it possible to use your library with Arduino Uno board? I saw that you made testings by using Duemilanove board that is similar to Uno bot not the same.
Also, I'm confused how to connect max485 pins:

  • For RO and DI pins, I know that they are connected to Arduino serial pins (0 and 1, respectively)
  • For A and B pins, I know that they are connected with the ElNet LT Powermeter device
  • For Vcc pin I know it is connected to 5V DC
  • What I don't know is where to connect on Arduino board RE and DE pins of max485. Can you help me with this?

Thank you very much for your time and effort to help me.

Sincerely,
Bojan.

basic example.. error compiling

Arduino: 1.6.1 (Windows 8.1), Board: "Arduino Uno"

In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:223:0,

             from C:\Users\Ilyas\Documents\Arduino\libraries\ModbusMaster-master\ModbusMaster.h:53,

             from C:\Users\Ilyas\Documents\Arduino\libraries\ModbusMaster-master\ModbusMaster.cpp:32:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h: In member function 'HardwareSerial& HardwareSerial::operator=(const HardwareSerial&)':

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:83:7: error: non-static const member 'volatile uint8_t* const HardwareSerial::_ubrrh', can't use default assignment operator

class HardwareSerial : public Stream

   ^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:83:7: error: non-static const member 'volatile uint8_t* const HardwareSerial::_ubrrl', can't use default assignment operator

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:83:7: error: non-static const member 'volatile uint8_t* const HardwareSerial::_ucsra', can't use default assignment operator

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:83:7: error: non-static const member 'volatile uint8_t* const HardwareSerial::_ucsrb', can't use default assignment operator

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:83:7: error: non-static const member 'volatile uint8_t* const HardwareSerial::_ucsrc', can't use default assignment operator

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:83:7: error: non-static const member 'volatile uint8_t* const HardwareSerial::_udr', can't use default assignment operator

C:\Users\Ilyas\Documents\Arduino\libraries\ModbusMaster-master\ModbusMaster.cpp: In member function 'void ModbusMaster::begin(uint16_t)':

C:\Users\Ilyas\Documents\Arduino\libraries\ModbusMaster-master\ModbusMaster.cpp:139:16: note: synthesized method 'HardwareSerial& HardwareSerial::operator=(const HardwareSerial&)' first required here

   MBSerial = Serial;

            ^

Error compiling.

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.