modbus

Tkinter: multiprocessing on events that happen per second

≯℡__Kan透↙ 提交于 2019-12-12 04:46:00
问题 I have made a Tkinter program that reads from a modbus slave device. Every second it reads the device and displays the output onto labels. However, I have multiple tabs that run the same code for each device connected. While a device is being read, the whole GUI freezes so you can't move the program or press buttons until it is done reading. Would multiprocessing help with freezing? If so, how could I implement it? Here is my code: import tkinter as tk from tkinter import * from tkinter

How the “OK” message looks like?

孤人 提交于 2019-12-12 04:09:58
问题 I have a device that sends data to a server. Data [ Client ] == > [ Server ] After the validation on the server I want to return a message: OK [ Client ] < == [ Server ] Is there a standard "OK" message to return? And an "ERROR" message? How does it looks like? (e.g. ":0011", ":110F") 回答1: You've got to design an application-level protocol. TCP is a byte stream, so even the definition of "Data" in your client->server piece needs some protocol so that the receiver can know what bytes make up

SerialPort communication in C# splitting frames

谁都会走 提交于 2019-12-11 20:01:18
问题 I need to write a program, that will listen to communication in ModBus network through RS485. I am connected to the network with RS485 <> USB dongle. I can read some data using SerialPort.DataReceived event, but it gives strange results. Data is often split, when it should come in one piece. (Modbus Master transmits every 100ms). class Serial { private SerialPort port; Queue<byte[]> buffer; public Serial() { buffer = new Queue<byte[]>(); port = new SerialPort("COM3", 19200, Parity.Even, 8,

Serial communication using commConneciton API in j2me

你离开我真会死。 提交于 2019-12-11 12:40:22
问题 I have develop one j2me application for Centrino chip. That chip connected to one EZ power meter. I want to read data from EZ meter over serial communication RS-232 using Modbus protocol. I have some code for send Modbus request for read Holding Register. //declare variable here CommConnection commConn; InputStream inStream; OutputStream outStream; // here open com port using commconnection String strCOM = "comm:COM1;baudrate=9600;bitsperchar=8;stopbits=1;parity=even;blocking=on;autocts=off

Pymodbus read holding registers

老子叫甜甜 提交于 2019-12-11 10:37:08
问题 I was assigned to perform the task without any documentation. I have a problem with reading data from MODBUS. This is the script that I was able to create: from pymodbus.constants import Endian from pymodbus.payload import BinaryPayloadDecoder from pymodbus.payload import BinaryPayloadBuilder from pymodbus.client.sync import ModbusTcpClient client = ModbusTcpClient('X.X.X.X') connection = client.connect() request = client.read_holding_registers(12606,2) result = request.registers decoder =

dsPic33E : RS485 Communication issue

断了今生、忘了曾经 提交于 2019-12-11 08:02:00
问题 I am facing issue while communicating serially over RS485 port. I am using dsPic33E microcontroller with Max485. using breakpoint i analyzed that Whenever I send "0x00" to controller, "0xFF" is received. Then I sent "0x01" , "0xFD" is received on controller.and so on. Also i tried to use loop-back logic, means sending back the received character, but every time I receive "0x00" for any value sent. I am unable to get the issue. below is the snapshot of the code I am using : // RS485 TRISBbits

TComPort and Modbus-RTU?

让人想犯罪 __ 提交于 2019-12-11 05:49:51
问题 It is possible to read and send data with TComPort for modbus RTU protocol? I have read wiki http://en.wikipedia.org/wiki/Modbus for modbus, but what mean start and end with 3.5c idle? I use C++Builder2009 回答1: Of course it's possible. In MODBUS ASCII it is easy to determine end of message since 2 bytes are used for single byte transmitted over communication line (byte is transmitted as it's ASCII hexadecimal representation), but in MODBUS RTU you have 1 byte used for single byte transmitted

Modbus implementation in C for embedded system lpcxpresso

五迷三道 提交于 2019-12-08 03:43:24
问题 I am new to modbus and I have to program a lpcxpresso baseboard as a master to collect readings from a powermeter using RS485 Modbus protocol. I am familiar with the protocol (about the PDU ADU frame, function codes, master-slave) through reading of specifications from modbus.org. However I have difficulties in the implementation when writing the code in C. So my questions are: Do I have to open connection, set the baud rate, etc when I am starting the connection? I am thinking to send the

C# BackgroundWorker and Com Port Problems

谁说胖子不能爱 提交于 2019-12-07 14:37:30
问题 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 returns a 0 or 1 (over the COM port) to determine whether the sensor is blocked. If it is blocked, a signal is sent over the port to the board. My problem is I can't quit monitoring the sensor, but I have to be sure the com port is not in use before

Modbus Serial Port Data Reading in C#

。_饼干妹妹 提交于 2019-12-06 15:39:57
Hi I am trying to read the Serial Port Data. I used NModbus library for the modbus communication. Code works fine for read and write purpose. But sometimes i am having some unknown errors and i wanted to see the serial port activity. I tried using the SerialDataReceivedEventHandler but i am not getting anything from the port but still i am able to read the value of the holding registers. Here is my code. All i want to see the data packet being sent / received over the serial port. namespace ModbusMaster { public partial class Form1 : Form { public Form1() { InitializeComponent(); this.Load +=