Page 2 of 2

Re: Modbus

Posted: Wed Sep 11, 2013 1:46 pm
by tello
Good afternoon Benj and the others guys.

I would like to know how is the progress of the creation of block Modbus RTU master and slave.
Benj, I also I have a Modbus RTU slave devices if you need to do some test run, I can lend it to you if needed.

A greeting and thanks

Re: Modbus

Posted: Thu Sep 19, 2013 9:50 am
by tello
Hello Benj.
You made some more progress with Modbus, thanks.

Re: Modbus

Posted: Thu Sep 19, 2013 5:52 pm
by zadah
Hello

Here is code for working MODBUS slave. This program works well with industrial touchpanel and MODBUS RTU protocol. Touchpanel is sending commands as Master and PIC answer as a slave. The Command 16(write multiple int) is not so finished yet (because i haveny needed that so far.) The MODBUS part starts on MAIN routine after RS232 receives string (MODBUS commands)

I hope this helps:)

Modbus slave address = 1

Coils are stored on array COIL[] unfortunately Coils must be set to byte datatype to have data array.
and integer are stored on byte array Databyte[] where high byte of integer is Databyte[n] and low byte Databyte[n+1]

Re: Modbus

Posted: Tue Oct 08, 2013 2:54 am
by Jellyfish
May i know how about the write function so that we able to change the slave address? How do i search a reference on how to program a modbus tcp server&client or modbus rtu master&client ?

Re: Modbus

Posted: Sun Dec 01, 2013 3:30 pm
by Steve001
Afternoon guys,

is there any news on a V6 Modbus slave component ?

regards

Steve

Edit

sorry forgot about the post above :oops:

Re: Modbus

Posted: Tue Dec 03, 2013 10:00 pm
by Steve001
Hello Zadah

do you have a copy of the code without the motor control and other bits ? I.E down to basic grass roots level
I am trying to work out what you have done any why with the code

regards

steve

Re: Modbus

Posted: Thu Dec 19, 2013 6:07 pm
by zadah
Hello Steve

I tried to keed to MODBUS code quite simple... First the RSR232 component resceives the MASTER command starting with slave adress (1), which after comes the command 1,3,5,6 or 16. After that the program checks if the crc is ok and if it is OK program executes command + calculates reply CRC.

Re: Modbus

Posted: Tue Nov 11, 2014 5:07 pm
by RTJNair
Hello Zadah,

Thanks for the work you have done to develop the modbus slave. I am quite interested since I am doing a project that will need one like this. I need to capture few input registers starting from 30100 to 30120 on an RS485 interface. I will have to build this from scratch. The flowcode program when opened was in Finnish and couldn't follow the flowchart much since I can understand only english.

I was not able to find a similar topic elsewhere in the forum and there is no modbus slave component available yet.

How can I contact you to further discuss ?

Thanks in advance

RTJNair

Re: Modbus

Posted: Wed Mar 04, 2015 3:14 pm
by tello
Hi guys.
I resumed my project modbus slave and I want to know if a Modbus Slave component is possible.
I tried the Modbus master and I am making progress but my team should be a slave.

Someone has made new test with these components ??

Thank you very much.

Re: Modbus

Posted: Wed Apr 01, 2015 12:39 pm
by tello
Good afternoon guys.
I still do modbus slave component and need to do the CRC calculation, I'm looking information and I can not find anyone explain it to me simply for my little brain :lol: :lol: :lol: .
Can anyone help me and tell me how to do it ??

Thank you very much.

Re: Modbus

Posted: Wed Apr 01, 2015 1:57 pm
by Benj
This shows how to do the RTU CRC in code.

http://www.ccontrolsys.com/w/How_to_Com ... essage_CRC

I have also sent you a PM with the source of our Modbus master component so you can see how it's been done there.

Re: Modbus

Posted: Sun Apr 05, 2015 7:20 am
by Steve001
this may be of help too

Steve

Re: Modbus

Posted: Thu Apr 09, 2015 1:47 pm
by tello
thank you very much Steve001, your help has been very important.
I made a managed to work a block for calculating CRC16.
The next step is the programming of a block modbus slave to respond with some simple functions.
I will report on progress.
Thanks again

Re: Modbus

Posted: Tue Nov 10, 2015 7:12 pm
by Mantas
Hello, guys,

I would suggest you to stop inventing a wheel. Download the source for freeMODBUS which supports RTU/ASCII modes from here: http://sourceforge.net/projects/freemod ... ios/files/, porting the app is easy the documentation is here http://www.freemodbus.org/api/index.html. Port your files for serial like UART and Timers for your chip and get over it (If your not afraid of getting your hands dirty with a bit of C code). Worked like a charm form me, and I only spent one evening getting familiar with the library and porting instructions and vuolia! If you want to use it inside flowcode with flowcode macros just write abstraction layer for calling C code functions. Goodluck!

Best regards,
Mantas