Has anyone had success with the MB_SERVER in the oscat library?
I have created a small program using the MB_SERVER from the 'Demo' directory of the oscat_network library.
I am able to connect using 'Ananas64' which is a modbus client for windows, but I am unable to read any registers.
I have also tried setting up a VMAP but I'm not sure I have done this correctly, I get an error 2 which is 'Incorrect data address'
I want to write 10 holding registers with offset 3000, and then read them with my windows PC running the client software.
If anyone has a small project with a working mb_server and a few registers that you are able to read from it would be greatly appreciated.
I have successfully used the modbus-tcp master device of Codesys on PLCs supporting this, but now I need to do it without using the built-in modbus-tcp master.
The solution is probably simple, but I'm having a hard time wrapping my head around the concept of mb_server
I don't know about your oscat block, but I can tell your address may be the key.
on some modbus servers, function code is used to point your request on different data tables. But on some others, you have to also tell it by adressing with an offset.
For instance, the first holding register (first item in relative holding register table) maybe accessed with request address 01 or 40001.
Also, I would start reading a register already holding a value different from 0, just to verify it to work, and the possible offset (some system relative addressing starts to 0 instead of 1, because the modbus frame asks the first address sending a 0). Then a range of register. Then write a single register, the multiple write.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello
Has anyone had success with the MB_SERVER in the oscat library?
I have created a small program using the MB_SERVER from the 'Demo' directory of the oscat_network library.
I am able to connect using 'Ananas64' which is a modbus client for windows, but I am unable to read any registers.
I have also tried setting up a VMAP but I'm not sure I have done this correctly, I get an error 2 which is 'Incorrect data address'
I want to write 10 holding registers with offset 3000, and then read them with my windows PC running the client software.
If anyone has a small project with a working mb_server and a few registers that you are able to read from it would be greatly appreciated.
I have successfully used the modbus-tcp master device of Codesys on PLCs supporting this, but now I need to do it without using the built-in modbus-tcp master.
The solution is probably simple, but I'm having a hard time wrapping my head around the concept of mb_server
I have uploaded my own project:
http://k-rad.dk/modbus.projectarchive m
I don't know about your oscat block, but I can tell your address may be the key.
on some modbus servers, function code is used to point your request on different data tables. But on some others, you have to also tell it by adressing with an offset.
For instance, the first holding register (first item in relative holding register table) maybe accessed with request address 01 or 40001.
Also, I would start reading a register already holding a value different from 0, just to verify it to work, and the possible offset (some system relative addressing starts to 0 instead of 1, because the modbus frame asks the first address sending a 0). Then a range of register. Then write a single register, the multiple write.