Questions tagged [modbus]

Modbus is a serial communications protocol published by Modicon in 1979 for use with its programmable logic controllers (PLCs). Simple and robust, it has since become a de facto standard communication protocol, and it is now amongst the most commonly available means of connecting industrial electronic devices.

Modbus is a serial communications protocol published by Modicon in 1979 for use with its programmable logic controllers (PLCs). Simple and robust, it has since become a de facto standard communication protocol, and it is now amongst the most commonly available means of connecting industrial electronic devices.

Useful links

1182 questions
4
votes
0 answers

Swift 3 convert a string to a hex for Modbus CRC calculation

I have to calculate the CRC16 of a string, and have that example code: import Foundation enum CRCType { case MODBUS case ARC } func crc16(_ data: [UInt8], type: CRCType) -> UInt16? { if data.isEmpty { return nil } let polynomial:…
Hajado
  • 41
  • 3
4
votes
4 answers

Modbus Slave don`t respond

I am trying to use a Raspberry Pi 3B (run Ubuntu Mate 16.04 operating system)as a Master to read values from an electric energy meter which supports Modbus-RTU protocol. I used a RS232/USB adapter and a RS485/RS232 adapter to link the meter and the…
Peter Solomon
  • 73
  • 1
  • 5
4
votes
3 answers

Difference between MQTT and MODBUS protocol?

I've been reading about these two protocols lately and wasn't quite able to understand why to use MQTT when we have MODBUS (or vice versa). Since, MODBUS is used to transmit data over serial communication between PLC's under low bandwidths, but as…
Suyash Bakshi
  • 59
  • 1
  • 6
4
votes
1 answer

ModbusTCP Server/Slave Implementation in Python (pymodbus)

I try to write a ModbusTCP server software connected wıth a database. I used pyModbus library for that task. That library has an Updating Server Example. By using that code, I wrote my code as : ''' Pymodbus Server With Updating…
Şansal Birbaş
  • 443
  • 1
  • 6
  • 14
4
votes
1 answer

Combine and convert two 16 bit numbers into one 32 bit number (float) in JavaScript

I need to build a NodeJS server-based prototype that reads industrial modbus data. I am reading two consecutive 16bit decimal registers that provide me an array with two entries: // eg transaction = [ 17007, -2621 ] or // eg transaction = [ 17007,…
Tremendus Apps
  • 1,497
  • 12
  • 20
4
votes
3 answers

How to store signed 16bit value in pymodbus register

I am trying to implement a pymodbus server. I am using ModbusSparseDataBlocks in the ModbusSlaveContext. This works so far. The client can write and read vales from every register instantiated. But I have problems with negative values. The client…
wewa
  • 1,628
  • 1
  • 16
  • 35
4
votes
1 answer

python pymodbus read holding registers

Im new to Modbus python and now i have some questions about my first steps The Script: from pymodbus.client.sync import ModbusTcpClient host = '10.8.3.10' port = 502 client = ModbusTcpClient(host, port) client.connect() #Register address…
4
votes
2 answers

pymodbus TcpClient timeout

I have problem with pymodbus TcpClient timeout: import logging from pymodbus.client.sync import ModbusTcpClient logging.basicConfig() log = logging.getLogger() log.setLevel(logging.DEBUG) client = ModbusTcpClient('x.y.z.w',…
srgi0
  • 3,319
  • 1
  • 23
  • 20
4
votes
5 answers

CRC-CCITT to CRC16 Modbus implementation

I am having a lot of trouble on generating a modbus CRC16 code using PHP. I have found a lot of different codes over the internet but i have tried them and for some reason i didnt get right results. I have found a PHP code for generating…
JotaTRod
  • 91
  • 2
  • 7
4
votes
0 answers

Android modbus tcp connection error: java.lang.NoClassDefFoundError: net.wimpi.modbus.net.TCPMasterConnection

i have this simple code for android modbus tcp read:(with jamod-1.2-SNAPSHOT) public class MainActivity extends Activity { // The important instances of the classes mentioned before TCPMasterConnection con = null; // the TCP…
bazzs
  • 147
  • 3
  • 10
4
votes
5 answers

Writing to modbus with Jamod

I came across with a curious situation when using jamod to write to modbus. Following read code works perfectly: public static void main(String[] args) throws Exception { InetAddress address = InetAddress.getByName("host.somewhere"); …
Ahe
  • 2,124
  • 3
  • 19
  • 29
4
votes
3 answers

How to get back to function from timed event

Okay so I have a function called readSensor which you guessed it.. reads a sensor. But the sensors usually take about 100ms to respond. So in the readSensor function I am basically just starting a timer. On the timed event I read the serialport and…
Shasam
  • 127
  • 2
  • 7
4
votes
2 answers

Modbus tcp android application

i am developing android application to control plc with help of tcp/ip modbus anyone has good tutorial on that? Modbus protocol escapes the thread (Android,Jamod)
madwhoo
  • 99
  • 1
  • 1
  • 10
3
votes
1 answer

C# BackgroundWorker and Com Port Problems

Ok. I have a program that monitors 2 COM ports. One is hooked to a scale and the other is hooked to a modbus board. My problem is in the COM port attached to the modbus board. My program is reading a sensor (on the modbus board) every 100MS. It…
CSharpDev
  • 869
  • 1
  • 13
  • 22
3
votes
3 answers

Copying buffer contents of different data types

I am writing a code for modbus protocol, that runs on a MSP430 controller. The response buffer(global) is an array of 8bit data, through which the response to the processed request is to be sent on serial UART. Now, my problem is that the response…
OnkarK
  • 127
  • 2
  • 9