According to the documentation there is now the possibility to change port settings.
And so I found the method UpdateComPortSettings which works fine but i cannot change the number of stopbits.. Is this a miss from the Codesys gang or am I missing something?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm coming to you today because I'm trying to make the baudrate and the slave number dynamic.
I've tried the "updateComPortSettings" method on the slave device but it doesn't work and gives the "Modbus_COM_Port" an error.
Thanks for your time trying to help really appreciated.
I used to do it like that but the opening of the comport isnt needed that is handled by the modbus server but with the new Codesys you should be able to use the configured Device according to the changelog. But apparently someone missed the possibility to change the number of stop bits. So guessing I will have to revert back to my old implementation..
According to the documentation there is now the possibility to change port settings.
And so I found the method UpdateComPortSettings which works fine but i cannot change the number of stopbits.. Is this a miss from the Codesys gang or am I missing something?
Hello,
I'm coming to you today because I'm trying to make the baudrate and the slave number dynamic.
I've tried the "updateComPortSettings" method on the slave device but it doesn't work and gives the "Modbus_COM_Port" an error.
Can you tell me how you got this method to work?
Thanks in advance for your help
jΓ©rΓ©my
Hi,
it lokk like that the docu is wrong
Regards
Interesting but I am configured as an Device then I cant change that setting..
Hi,
I am not able to test my code today.! I hope the ModbusServer will answer a request (see attachment)
Basic is the FAQ (https://faq.codesys.com/display/CDSFAQ/Modbus+RTU%3A+Dynamic+Configuration)
Regards
Thanks for your time trying to help really appreciated.
I used to do it like that but the opening of the comport isnt needed that is handled by the modbus server but with the new Codesys you should be able to use the configured Device according to the changelog. But apparently someone missed the possibility to change the number of stop bits. So guessing I will have to revert back to my old implementation..
Example: