Hi all,
Recently I used the Modbus master library (CoDeSys V3.5.3.0).
And I noticed that dis-connecting and re-connecting the serial cable does NOT restart the Modbus protocol.
Do you have any experience with (re-) starting the Modbus protocol?
Is there a way to:
- detect that the Modbus protocol is not running.
- (re-) start the Modbus protocol manually (by the application).
Any help is appreciated.
Regards,
Edwin.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In the device tree you can set the name of your slaves (right click => properties).
This name is the instance of your Modbus Slave.
To detect the error and reset the communication you can use e.g. (mbSlave1 is the name of my Modbus slave device):
IF mbSlave1.xError THEN
mbSlave1.xReset := TRUE;
ELSE
mbSlave1.xReset := FALSE;
END_IF
To get the error message you can use
VAR
bySlave1Error: IODRVMODBUS.MB_ErrorCodes;
END_VAR
bySlave1Error := mbSlave1.byModbusError;
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Tim,
Thank you for your quick answer.
I'll apply it immediately.
Do you know where I can find a list of known issues?
(I do not have access to the CoDeSys jira database.)
Regards,
Edwin.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
Recently I used the Modbus master library (CoDeSys V3.5.3.0).
And I noticed that dis-connecting and re-connecting the serial cable does NOT restart the Modbus protocol.
Do you have any experience with (re-) starting the Modbus protocol?
Is there a way to:
- detect that the Modbus protocol is not running.
- (re-) start the Modbus protocol manually (by the application).
Any help is appreciated.
Regards,
Edwin.
Yes, this is known.
In the device tree you can set the name of your slaves (right click => properties).
This name is the instance of your Modbus Slave.
To detect the error and reset the communication you can use e.g. (mbSlave1 is the name of my Modbus slave device):
IF mbSlave1.xError THEN
mbSlave1.xReset := TRUE;
ELSE
mbSlave1.xReset := FALSE;
END_IF
To get the error message you can use
VAR
bySlave1Error: IODRVMODBUS.MB_ErrorCodes;
END_VAR
bySlave1Error := mbSlave1.byModbusError;
Tim,
Thank you for your quick answer.
I'll apply it immediately.
Do you know where I can find a list of known issues?
(I do not have access to the CoDeSys jira database.)
Regards,
Edwin.
Please contact your supplier for this.
Jira is only accessable for direct customers (OEMs) of 3S-Smart Software Solutions and Distributors.