Modbus Master read/write over Ethernet UDP/TCP libraries
CODESYS Forge
talk
(Thread)
Modbus Master read/write over Ethernet UDP/TCP libraries
Last updated: 2024-07-10
v3.5 SP19 - Modbus TCP Devices - Channel Limit?
CODESYS Forge
talk
(Thread)
v3.5 SP19 - Modbus TCP Devices - Channel Limit?
Last updated: 2024-09-30
Reading request counter value from modbus server in application
CODESYS Forge
talk
(Thread)
Reading request counter value from modbus server in application
Last updated: 2024-10-16
Modbus TCP & RTU with Control for Linux SL
CODESYS Forge
talk
(Thread)
Modbus TCP & RTU with Control for Linux SL
Last updated: 2024-10-24
How to write multiple coils (Modbus FC15)
CODESYS Forge
talk
(Thread)
How to write multiple coils (Modbus FC15)
Last updated: 2 days ago
Post by dim54 on MBChannel
CODESYS Forge
talk
(Post)
Hello! I am interested in the Modbus Slave channel parameter uiReadLength to use in the ST-program (see picture). How to read the value of uiReadLength in a ST-program? Only Edwin the Great and Terrible can answer this question.
Last updated: 2024-01-22
Post by nano on Dynamic setting of the modbus tcp/ip slave ip address
CODESYS Forge
talk
(Post)
habe a look to this faq, this should work for u https://faq.codesys.com/plugins/servlet/mobile?contentId=24510471#content/view/24510471
Last updated: 2024-02-17
Post by wildcard on Modbus Client Request Not Processed
CODESYS Forge
talk
(Post)
Hi, does anyone has a solution for this issue. I've the same problem. I've implemented a very simple client based on the Modbus Examples and connected the soft PLC to a Modbus Simulator. PROGRAM ModbusClient VAR initDone : BOOL := FALSE; errorID : ModbusFB.Error; client : ModbusFB.ClientTCP; timeout : UDINT := 500000; replyTimeout : UDINT := 200000; aUINT : ARRAY [0..8] OF UINT; clientRequestReadHoldingRegisters : ModbusFB.ClientRequestReadHoldingRegisters; clientRequestsCnt : UINT := 0; clientRequestsProcessCnt : UINT := 0; ipAddress : ARRAY[0..3] OF BYTE := [10,54,0,72]; END_VAR IF NOT initDone THEN initDone := TRUE; client(aIPaddr:=ipAddress, udiLogOptions:=ModbusFB.LoggingOptions.All); client(xConnect:=TRUE, ); clientRequestReadHoldingRegisters(rClient:=client, udiTimeOut:=timeout, uiUnitId:=1, uiStartItem:=0, uiQuantity:=4, pData:=ADR(aUINT[0]), udiReplyTimeout:=replyTimeout); clientRequestReadHoldingRegisters.xExecute := TRUE; clientRequestsCnt := 0; END_IF clientRequestReadHoldingRegisters(rClient:=client, udiTimeOut:=timeout, uiUnitId:=1, uiStartItem:=0, uiQuantity:=4, pData:=ADR(aUINT[0]), udiReplyTimeout:=replyTimeout, xExecute := TRUE); IF clientRequestReadHoldingRegisters.xError THEN clientRequestsCnt := clientRequestsCnt +1 ; errorID := clientRequestReadHoldingRegisters.eErrorID; END_IF clientRequestReadHoldingRegisters(rClient:=client, udiTimeOut:=timeout, uiUnitId:=1, uiStartItem:=0, uiQuantity:=4, pData:=ADR(aUINT[0]), udiReplyTimeout:=replyTimeout, xExecute := NOT clientRequestReadHoldingRegisters.xExecute); When the system is running I do get the following on the logs: 2024-05-13T10:18:07.443Z: Cmp=MODBUS lib, Class=1, Error=0, Info=0, pszInfo= Client.RequestProcessed ClientRequest,16#0164ADC561A0 unitId=1 fc=ReadHoldingRegisters id=2070 state=Error 2024-05-13T10:18:07.443Z: Cmp=MODBUS lib, Class=1, Error=0, Info=0, pszInfo= ClientRequest,16#0164ADC561A0 unitId=1 fc=ReadHoldingRegisters id=2070 change state Error -> None timestamp=63843421226 2024-05-13T10:18:08.444Z: Cmp=MODBUS lib, Class=1, Error=0, Info=0, pszInfo= ClientRequest,16#0164ADC561A0 unitId=1 fc=ReadHoldingRegisters id=2071 change state None -> Init timestamp=63844421420 2024-05-13T10:18:09.444Z: Cmp=MODBUS lib, Class=1, Error=0, Info=0, pszInfo= ClientRequest,16#0164ADC561A0 unitId=1 fc=ReadHoldingRegisters id=2071 change state Init -> Error timestamp=63845421675 But the errorID is jumping between OK and RequestNotProcessed. Any help is very appreciated which gives me a hint what I'm doing wrong. Thanks
Last updated: 2024-05-13
Post by wbj0t on What the right way to update TCP/COM slave device holding registers
CODESYS Forge
talk
(Post)
Hi all :) I have an plc. This plc has option to be as slave device. There are TCP -> Serial Slave Device and COM -> Serial Slave Device. There are 4096 ModBus holding registers with mark "internal modify" for the both devices above. So, COM Slave has 4096 registers and TCP Slave has 4096 registers. And, finally, I have an ARRAY[0..4095] OF WORD. This array glued with COM Slave and TCP slave. Yes, I need plc's opportunity to be communication both TCP and COM ways for the same registers. For example, the next task structure: * TASK_0: 1. pou_READ_Registers 2. pou_0 3. pou_1 4. ... 5. pou_N 6. pou_WRITE_Registers At the first pou I read registers for the other pous, after job we have sort of state of the plc. At the last pou (6) we write modified registers. It is a good scenario: some one wrote registers for the job, after job we save these (modified) registers. But, what if registers wrote between 1 and 6 pou by operator, for example, at the 3 pou -> the last pou 'pou_WRITE' will rewrite this request from operator. What the right way to work with this logic? Thanks you.
Last updated: 2024-07-01
Post by kislov on CODESYS Modbus 4.4.0.0 - Modbus network redundancy
CODESYS Forge
talk
(Post)
Hi. There is next information in CODESYS Modbus 4.4.0.0 Release Notes: "Modbus network redundancy" How to use this feature? As I understand, new fields in STUCT ModbusTCPComSettings are associated with it, but more detailed information is needed.
Last updated: 2024-10-07
Post by wbj0t on Global variable access by Programms and Modbus Devices (attach device to bus)
CODESYS Forge
talk
(Post)
Hi everyone. I use Raspberry Pi 4, one core codesys SL. I have a question about global variable access via programm when I glued the same variable to MODBUS SERIAL/TCP DEVICE holding register. So, the question: what behavior of this modifying? When I set "Always update variables (in bus cycle)" and set some task as bus for the Device, then in another task I cant change this varible (can, but immediatly the old value setted again). But the same things works with MODBUS SLAVE: again "Always update..." and master attached to some task, then I change variable in another task and all works. I cant set up my variables from retains file at PrepareStart event because of this behavior with MODBUS SERIAL/TCP DEVICE. Thanks, wbj0t.
Last updated: 2024-07-18
Post by shrikantp007 on new to codesys help on modbus with ardunio modbus rtu
CODESYS Forge
talk
(Post)
Hello , I am new to codesys ,working with it for just 15-17 days so ,i think i am able to installed it and configure it ,not i want to use ardunio program (smart dustbin ,college project using motor and Ultrasonic Module HC-SR04 and servo motor). i use ardunio program to write code with chatgpt to work ardunio as a modbus rtu as i dont have ethernet or wifi shild ,i wrote program in ariduno but now don have idea what change i have to make in codesys to comunicate as modbus slave it give error with bus error ,where i can get all errors ? Thanks in advance :)
Last updated: 2024-07-21
I want to control a industrial machine with "CODESYS Control Win V3" and a Profibus_DP slave
CODESYS Forge
talk
(Thread)
I want to control a industrial machine with "CODESYS Control Win V3" and a Profibus_DP slave
Last updated: 2018-09-24
Connect a I/O module (EAP Module 2020) as a slave to Revolution PI
CODESYS Forge
talk
(Thread)
Connect a I/O module (EAP Module 2020) as a slave to Revolution PI
Last updated: 2018-03-09
Yellow triangle and bus not running error in Modbsu TCP master and Slave.
CODESYS Forge
talk
(Thread)
Yellow triangle and bus not running error in Modbsu TCP master and Slave.
Last updated: 2021-12-07
ModbusTCP, can i know when i get requests from slave side?
CODESYS Forge
talk
(Thread)
ModbusTCP, can i know when i get requests from slave side?
Last updated: 2018-11-19
Warning: the number of slave has changed or is different from the configuration
CODESYS Forge
talk
(Thread)
Warning: the number of slave has changed or is different from the configuration
Last updated: 2017-09-11
Yellow triangle and bus not running error in Modbsu TCP master and Slave.
CODESYS Forge
talk
(Thread)
Yellow triangle and bus not running error in Modbsu TCP master and Slave.
Last updated: 2021-12-07
How to know the admissible devices in the master/slave hierarchy
CODESYS Forge
talk
(Thread)
How to know the admissible devices in the master/slave hierarchy
Last updated: 2017-02-16
K-Bus Klemme an Ethercat Slave einbinden. Gerät konnte nicht hinzugefügt werden.
CODESYS Forge
talk
(Thread)
K-Bus Klemme an Ethercat Slave einbinden. Gerät konnte nicht hinzugefügt werden.
Last updated: 2021-11-28
How to test Slave-Hardware without having the Master-Hardware in Codesys?
CODESYS Forge
talk
(Thread)
How to test Slave-Hardware without having the Master-Hardware in Codesys?
Last updated: 2021-03-05
Configure PLC as CanOpen Slave want the TPDO to be triggered on event..
CODESYS Forge
talk
(Thread)
Configure PLC as CanOpen Slave want the TPDO to be triggered on event..
Last updated: 2020-04-14
Generic CiA402 dirve AL Status read from slave address 1001 status 16#1A: Synchronization error
CODESYS Forge
talk
(Thread)
Generic CiA402 dirve AL Status read from slave address 1001 status 16#1A: Synchronization error
Last updated: 2022-01-13
exporting or copying the COE online data from an ethercat slave device
CODESYS Forge
talk
(Thread)
exporting or copying the COE online data from an ethercat slave device
Last updated: 2019-10-30
CANOpen issue. Beckhoff 6751 CANOpen Master with Codesys TTC590 as slave
CODESYS Forge
talk
(Thread)
CANOpen issue. Beckhoff 6751 CANOpen Master with Codesys TTC590 as slave
Last updated: 2020-12-18
To search for an exact phrase, put it in quotes. Example: "getting started docs"
To exclude a word or phrase, put a dash in front of it. Example: docs -help
To search on specific fields, use these field names instead of a general text search. You can group with AND
or OR
.