PIC as MODBUS slave
Moderator: Benj
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: PIC AS MODBUS SLAVE
Hello,
I'm afraid the Modbus slave component will only work with Flowcode v7. If you already have a v6 license then you get a significant discount on the price of the v7 license.
I'm afraid the Modbus slave component will only work with Flowcode v7. If you already have a v6 license then you get a significant discount on the price of the v7 license.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 115
- Joined: Wed Aug 03, 2016 10:45 pm
- Has thanked: 24 times
- Been thanked: 11 times
- Contact:
Re: PIC AS MODBUS SLAVE
Hello to all!
I made some tests of code that I post below, and works fine as modbus slave. With a modbus master emulator I send characters one by one to an LCD 4X20 , using modbus command 6 (Write Single Register). The problem is , when I try to send a string of characters , 20 or more , there is a delay (about 1 sec. per character) to display. That is not practical especially if I want to use whole capacity of LCD (80 characters). The modbus command to send a long string of characters is 16 (Write Multiple Registers).When I use modbus command 16 to send a string with the modbus master emulator I receive an error. I noticed that at FLOWCODE7 modbus slave component there is no a parameter for multiple registers . Would you like to inform me how many characters can I send as string , and how can I do that, to use whole area of LCD . Thanks.
I made some tests of code that I post below, and works fine as modbus slave. With a modbus master emulator I send characters one by one to an LCD 4X20 , using modbus command 6 (Write Single Register). The problem is , when I try to send a string of characters , 20 or more , there is a delay (about 1 sec. per character) to display. That is not practical especially if I want to use whole capacity of LCD (80 characters). The modbus command to send a long string of characters is 16 (Write Multiple Registers).When I use modbus command 16 to send a string with the modbus master emulator I receive an error. I noticed that at FLOWCODE7 modbus slave component there is no a parameter for multiple registers . Would you like to inform me how many characters can I send as string , and how can I do that, to use whole area of LCD . Thanks.
- Attachments
-
- ModBus_Slave_LCD_4-DEMO.fcfx
- (11.44 KiB) Downloaded 454 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: PIC AS MODBUS SLAVE
Hello,
Right I have now added support for the WriteMultipleRegisters command. Previously it was not supported in the slave code.
The command should now support up to 20 registers to be set in a single transaction.
Let me know how you get on.
Right I have now added support for the WriteMultipleRegisters command. Previously it was not supported in the slave code.
The command should now support up to 20 registers to be set in a single transaction.
Let me know how you get on.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 115
- Joined: Wed Aug 03, 2016 10:45 pm
- Has thanked: 24 times
- Been thanked: 11 times
- Contact:
Re: PIC AS MODBUS SLAVE
Many thanks Benj,
I made a copy of ModbusSlave.fcpx to components directory of FLOWCODE7, but there is no WriteMultipleRegisters command in the ModbusSlave component. Is there something wrong with the update ? How can I check that, and what modifications must be done in ModBus_Slave_LCD_4-DEMO.fcfx to work with WriteMultipleRegisters command from the modbus master?
I made a copy of ModbusSlave.fcpx to components directory of FLOWCODE7, but there is no WriteMultipleRegisters command in the ModbusSlave component. Is there something wrong with the update ? How can I check that, and what modifications must be done in ModBus_Slave_LCD_4-DEMO.fcfx to work with WriteMultipleRegisters command from the modbus master?
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: PIC AS MODBUS SLAVE
Hello,
The WriteMultipleRegisters command is now supported as part of the CheckForIncoming macro. So hopefully no modifications are required for your program other then to re-compile and program.
The WriteMultipleRegisters command is now supported as part of the CheckForIncoming macro. So hopefully no modifications are required for your program other then to re-compile and program.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 115
- Joined: Wed Aug 03, 2016 10:45 pm
- Has thanked: 24 times
- Been thanked: 11 times
- Contact:
-
- Posts: 115
- Joined: Wed Aug 03, 2016 10:45 pm
- Has thanked: 24 times
- Been thanked: 11 times
- Contact:
Re: PIC AS MODBUS SLAVE
Hello to all!
After last modification of the code to support Modbus command 16 (WriteMultipleRegisters), I made some tests with an LCD 4x20 as slave. I send 2 requests to the slave for 2 and 20 characters. As master I use a PLC TM221C24R (SCHNEIDER) and a master emulator ComTestPro .The results are below:
1. Test with PLC
Send 2 characters( 2,3 ) at Slave 01 with start address 07
DATA OUT [hex]
[01] [10] [00 07] [00 02] [04] [00 32] [00 33] [53 93]
DATA IN [hex]
[01] [10] [00 09] [00 02] [91 CA]
No data on lcd . PLC shows communication error. Maybe there is a response error . As it seems at DATA IN, start address is wrong [00 09], so the CRC is no valid.
Send a string of 20 characters at Slave 01 with start address 07
DATA OUT [hex]
[01] [10] [00 07] [00 14] [ 20 ch. data......... ] [3C 86]
DATA IN [hex]
[01] [10] [00 1B] [00 14] [80 01].
No data on LCD. PLC shows communication error . The same problem with start address at DATA IN ( [00 14] instead of [00 07] ) .
2. Test with master emulator ComTestPro
At that case, with the same requests as with PLC above , the LCD shows some characters , but the emulator panel shows no valid response error , and the DATA IN, DATA OUT are the same as at test with PLC .
I think that there is a problem with response data, maybe at code for modbus command 16. Is there a way to solve this?
Below I post the latest code.
Thanks!
After last modification of the code to support Modbus command 16 (WriteMultipleRegisters), I made some tests with an LCD 4x20 as slave. I send 2 requests to the slave for 2 and 20 characters. As master I use a PLC TM221C24R (SCHNEIDER) and a master emulator ComTestPro .The results are below:
1. Test with PLC
Send 2 characters( 2,3 ) at Slave 01 with start address 07
DATA OUT [hex]
[01] [10] [00 07] [00 02] [04] [00 32] [00 33] [53 93]
DATA IN [hex]
[01] [10] [00 09] [00 02] [91 CA]
No data on lcd . PLC shows communication error. Maybe there is a response error . As it seems at DATA IN, start address is wrong [00 09], so the CRC is no valid.
Send a string of 20 characters at Slave 01 with start address 07
DATA OUT [hex]
[01] [10] [00 07] [00 14] [ 20 ch. data......... ] [3C 86]
DATA IN [hex]
[01] [10] [00 1B] [00 14] [80 01].
No data on LCD. PLC shows communication error . The same problem with start address at DATA IN ( [00 14] instead of [00 07] ) .
2. Test with master emulator ComTestPro
At that case, with the same requests as with PLC above , the LCD shows some characters , but the emulator panel shows no valid response error , and the DATA IN, DATA OUT are the same as at test with PLC .
I think that there is a problem with response data, maybe at code for modbus command 16. Is there a way to solve this?
Below I post the latest code.
Thanks!
- Attachments
-
- ModBus_Slave_LCD_4-DEMO.fcfx
- (11.45 KiB) Downloaded 387 times
-
- Posts: 444
- Joined: Tue Apr 15, 2014 4:19 pm
- Location: Kajaani, Finland
- Has thanked: 345 times
- Been thanked: 227 times
- Contact:
Re: PIC AS MODBUS SLAVE
Is the slave answering right ?
- Attachments
-
- Screenshot_20170228-072529.png
- (414.15 KiB) Downloaded 824 times
Ill just keep the good work up!
- Steve001
- Valued Contributor
- Posts: 1189
- Joined: Wed Dec 31, 2008 3:37 pm
- Has thanked: 460 times
- Been thanked: 523 times
- Contact:
Re: PIC AS MODBUS SLAVE
Hi
as ets driver stated is the slave answering correctly ?
I would test first with your emulator and get it working with that as PLC's are notorious for having problems with MODBUS interfaces and not being able to communicate with the required number of devices on the loop or the distance or both !
steve
as ets driver stated is the slave answering correctly ?
I would test first with your emulator and get it working with that as PLC's are notorious for having problems with MODBUS interfaces and not being able to communicate with the required number of devices on the loop or the distance or both !
steve
Success always occurs in private and failure in full view.
-
- Posts: 444
- Joined: Tue Apr 15, 2014 4:19 pm
- Location: Kajaani, Finland
- Has thanked: 345 times
- Been thanked: 227 times
- Contact:
Re: PIC AS MODBUS SLAVE
Hi!
Sorry, did not notice you had allready shown that the response is wrong!
It seems that the modbus slave is answering in wrong format to the master...
I built your system in eblocs friendly way to my desk and tested out with RS485 using modbus poll program:
I write 0x0032 to register 40007 and 0x0033 to register 40008 and my display shows number 23 on the first line.
The sent data is:
01 | 10 | 00 06 | 00 02 | 04 | 0032 | 0033 | 925F
SlaveID | Function | Start address | registers to write | databytes to follow| data1 | data2 | CRC |
(address given in plc base1 7 = 6)
Response is the 01 10 00 08 00 02 C0 0A, and the data changes on the display of mine, but modbus poll shows that it gets response error.
Response to this should be 01 10 00 06 00 02 A1 C9
Sorry, did not notice you had allready shown that the response is wrong!
It seems that the modbus slave is answering in wrong format to the master...
I built your system in eblocs friendly way to my desk and tested out with RS485 using modbus poll program:
I write 0x0032 to register 40007 and 0x0033 to register 40008 and my display shows number 23 on the first line.
The sent data is:
01 | 10 | 00 06 | 00 02 | 04 | 0032 | 0033 | 925F
SlaveID | Function | Start address | registers to write | databytes to follow| data1 | data2 | CRC |
(address given in plc base1 7 = 6)
Response is the 01 10 00 08 00 02 C0 0A, and the data changes on the display of mine, but modbus poll shows that it gets response error.
Response to this should be 01 10 00 06 00 02 A1 C9
- Attachments
-
- ModBus_Slave_LCD_4-DEMO_modified_for_eblocks_19MHZ_clock.fcfx
- (11.48 KiB) Downloaded 349 times
Ill just keep the good work up!
-
- Posts: 115
- Joined: Wed Aug 03, 2016 10:45 pm
- Has thanked: 24 times
- Been thanked: 11 times
- Contact:
Re: PIC AS MODBUS SLAVE
Thanks to all for your help!
As I stated in my previous post, my target is to use the code to send some messages from a PLC to a number of LCD's . When I use an emulator there is no problem for displaying the characters, although there is a response error. That is only for communication test and checking data , but in reality, a PLC use more accurate diagnostics for communication protocols. So far I can't send any data from the PLC to LCD with modbus protocol. I think that the problem is at code , because when I use the same PLC to send characters to a MODBUS LCD 4X20 ( SC2004MBS-SILICON CRAFT ) , that LCD works well. I noticed that the PLC after sending the message to LCD, wait some seconds, make some diagnostics to serial line data and after that, enable the communication. This waiting time there is no at master emulator. Also , checking all the response data, I noticed that the wrong START ADDRESS is the sum of correct START ADDRESS and QUANTITY OF REGISTERS . I will continue the tests with different pairs PLC-LCD.
As I stated in my previous post, my target is to use the code to send some messages from a PLC to a number of LCD's . When I use an emulator there is no problem for displaying the characters, although there is a response error. That is only for communication test and checking data , but in reality, a PLC use more accurate diagnostics for communication protocols. So far I can't send any data from the PLC to LCD with modbus protocol. I think that the problem is at code , because when I use the same PLC to send characters to a MODBUS LCD 4X20 ( SC2004MBS-SILICON CRAFT ) , that LCD works well. I noticed that the PLC after sending the message to LCD, wait some seconds, make some diagnostics to serial line data and after that, enable the communication. This waiting time there is no at master emulator. Also , checking all the response data, I noticed that the wrong START ADDRESS is the sum of correct START ADDRESS and QUANTITY OF REGISTERS . I will continue the tests with different pairs PLC-LCD.
-
- Posts: 444
- Joined: Tue Apr 15, 2014 4:19 pm
- Location: Kajaani, Finland
- Has thanked: 345 times
- Been thanked: 227 times
- Contact:
Re: PIC AS MODBUS SLAVE
What kind of diagnostics the plc runs on serial line? Does it do modbus diagnostic command to your DIY modbus display or does it use some kind of REPORT-SLAVE-ID (command 17) as diagnostics??
Ill just keep the good work up!
-
- Posts: 115
- Joined: Wed Aug 03, 2016 10:45 pm
- Has thanked: 24 times
- Been thanked: 11 times
- Contact:
Re: PIC AS MODBUS SLAVE
I have a hardware guide only for that PLC . Maybe the PLC use some kind of diagnostic command, maybe not. I suppose that, observing the relatively long time to enable communication at serial line. However, I think that the problem is not at PLC that works well with any modbus display.
- Attachments
-
- MODICON-M221 PLC.pdf
- (4.45 MiB) Downloaded 347 times
-
- Posts: 444
- Joined: Tue Apr 15, 2014 4:19 pm
- Location: Kajaani, Finland
- Has thanked: 345 times
- Been thanked: 227 times
- Contact:
Re: PIC AS MODBUS SLAVE
Oh it could be the timeout when no correct answer is received, on some systems those are very long... Hope Matrix gets the response fixed asap so you can get it working correctly!
Ill just keep the good work up!
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: PIC AS MODBUS SLAVE
Hello,
Many thanks for letting us know of the problem. I have found and hopefully fixed the problem in the attached component.
Let me know how you get on.
Many thanks for letting us know of the problem. I have found and hopefully fixed the problem in the attached component.
Let me know how you get on.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 115
- Joined: Wed Aug 03, 2016 10:45 pm
- Has thanked: 24 times
- Been thanked: 11 times
- Contact:
Re: PIC AS MODBUS SLAVE
Thanks Benj for your help.
Now the response code is correct, but I have no data on LCD when send a modbus command from the PLC. I continue the tests to find the reason.
Now the response code is correct, but I have no data on LCD when send a modbus command from the PLC. I continue the tests to find the reason.
-
- Posts: 115
- Joined: Wed Aug 03, 2016 10:45 pm
- Has thanked: 24 times
- Been thanked: 11 times
- Contact:
Re: PIC AS MODBUS SLAVE
Hello to all and thanks in advance for any help!
I made some tests about to send characters from a PLC to an LCD 4X20. When I set Quantity (is the the total number of characters that I want to sent) up to 20 , I have the correct characters at LCD ,when the FirstObj is the start address for the string. But when I set Quantity more than 20 , I have no data at LCD . The communication is ok, because there is no error, but the busy output is on at execute window. Generally, I can display only 20 characters, while I try to send more than 20. What do you think about that , the problem is about timing , or parameter modification of pic code /plc code ?
I made some tests about to send characters from a PLC to an LCD 4X20. When I set Quantity (is the the total number of characters that I want to sent) up to 20 , I have the correct characters at LCD ,when the FirstObj is the start address for the string. But when I set Quantity more than 20 , I have no data at LCD . The communication is ok, because there is no error, but the busy output is on at execute window. Generally, I can display only 20 characters, while I try to send more than 20. What do you think about that , the problem is about timing , or parameter modification of pic code /plc code ?
- Attachments
-
- The data that transferred to LCD when run the test program.The above data is for Quantity=20 , FirstObj=10
- 20170314_001621.jpg (59.29 KiB) Viewed 20955 times
-
- Ashampoo_Snap_2017.03.14_01h06m42s_004_.png
- This is the PLC configuration panel for communication (RS-485,9600,N,1)
- (153.58 KiB) Downloaded 117 times
-
- Ashampoo_Snap_2017.03.14_01h08m43s_005_.png
- A small test program (LD) to send some characters to LCD.
- (156.04 KiB) Downloaded 117 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: PIC AS MODBUS SLAVE
Hello,
In your Flowcode Modbus Slave program what is the Receive Buffer Size property set to? This sets how much data can be received in a single message and therefore how much memory to reserve. The default is 20 bytes.
In your Flowcode Modbus Slave program what is the Receive Buffer Size property set to? This sets how much data can be received in a single message and therefore how much memory to reserve. The default is 20 bytes.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 115
- Joined: Wed Aug 03, 2016 10:45 pm
- Has thanked: 24 times
- Been thanked: 11 times
- Contact:
Re: PIC AS MODBUS SLAVE
Thanks Benj ,
The Receive Buffer Size it was 20 , I set to 80 . I try to send 10 charachters per row with FirstObj = 0 and Quantity=80 from PLC. No data at display . no comm. errors , the busy is on . When I try to send data with master emulator there is no problem. The strange is that there is no communication error to help me to found the reason ,at the help-error diagnostics of PLC. Is it wrong timing parameter and for what code ? When I connect the PLC with a modbus LCD that I have ( SC200MBS 4X20 ) that LCD works fine.
The Receive Buffer Size it was 20 , I set to 80 . I try to send 10 charachters per row with FirstObj = 0 and Quantity=80 from PLC. No data at display . no comm. errors , the busy is on . When I try to send data with master emulator there is no problem. The strange is that there is no communication error to help me to found the reason ,at the help-error diagnostics of PLC. Is it wrong timing parameter and for what code ? When I connect the PLC with a modbus LCD that I have ( SC200MBS 4X20 ) that LCD works fine.
- Attachments
-
- Ashampoo_Snap_2017.03.14_16h53m16s_001_.png
- This is the last set up of modbus slave component properties
- (127.24 KiB) Downloaded 78 times
-
- Posts: 115
- Joined: Wed Aug 03, 2016 10:45 pm
- Has thanked: 24 times
- Been thanked: 11 times
- Contact:
Re: PIC AS MODBUS SLAVE
Hello Benj,
in your previous post you write :
" Right I have now added support for the WriteMultipleRegisters command. Previously it was not supported in the slave code.
The command should now support up to 20 registers to be set in a single transaction. "
So far , I can display up to 20 characters on LCD , while I send more than 20 and up to 80. I have response error when I send more than 20. Is that about the limit of 20 registers that support the WriteMultipleRegisters command ? If yes , is it possible to extend that limit? If that is not possible what modification can I make to FC7 code to display up to 80 characters in one transaction? Is it possible to receive and display in 4 packets of 20 , because I can't sent more than 1 request from PLC?
Thanks in advance for your help and support.
in your previous post you write :
" Right I have now added support for the WriteMultipleRegisters command. Previously it was not supported in the slave code.
The command should now support up to 20 registers to be set in a single transaction. "
So far , I can display up to 20 characters on LCD , while I send more than 20 and up to 80. I have response error when I send more than 20. Is that about the limit of 20 registers that support the WriteMultipleRegisters command ? If yes , is it possible to extend that limit? If that is not possible what modification can I make to FC7 code to display up to 80 characters in one transaction? Is it possible to receive and display in 4 packets of 20 , because I can't sent more than 1 request from PLC?
Thanks in advance for your help and support.
- Attachments
-
- ModBus_Slave_LCD_4-DEMO-F.fcfx
- (11.45 KiB) Downloaded 251 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: PIC AS MODBUS SLAVE
Hello,
I believe I have found and fixed the issue. The data was being read out the comms circular buffer into a local buffer which was fixed at 40 bytes or 20 registers. This variable is now dynamically sized based on your max receive buffer property setting. Ideally I would like to keep the data inside the existing circular buffer but then I can't ensure that no further communications bytes will be received while processing the command so for now I am using a new unique RAM buffer.
I have also fixed a problem where the simulation version of the CheckForIncoming had fallen behind the embedded version in terms of what was supported.
Let me know how you get on.
I believe I have found and fixed the issue. The data was being read out the comms circular buffer into a local buffer which was fixed at 40 bytes or 20 registers. This variable is now dynamically sized based on your max receive buffer property setting. Ideally I would like to keep the data inside the existing circular buffer but then I can't ensure that no further communications bytes will be received while processing the command so for now I am using a new unique RAM buffer.
I have also fixed a problem where the simulation version of the CheckForIncoming had fallen behind the embedded version in terms of what was supported.
Let me know how you get on.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 115
- Joined: Wed Aug 03, 2016 10:45 pm
- Has thanked: 24 times
- Been thanked: 11 times
- Contact:
Re: PIC AS MODBUS SLAVE
Thanks Benj for your help.
Below I post the code that so far works fine. I continue the tests adding some I/O at the PIC that can be controlled from the master, and make some modifications to hardware .
Below I post the code that so far works fine. I continue the tests adding some I/O at the PIC that can be controlled from the master, and make some modifications to hardware .
- Attachments
-
- ModBus_Slave_LCD_4-DEMO-F.fcfx
- (11.45 KiB) Downloaded 222 times
-
- Posts: 115
- Joined: Wed Aug 03, 2016 10:45 pm
- Has thanked: 24 times
- Been thanked: 11 times
- Contact:
Re: PIC AS MODBUS SLAVE
Hello Benj,
Before add some I/O to PIC , I was checked with help of a master emulator (Simply Modbus Master) some modbus command that I will use . I noticed that some commands as 01 (Read Coil States ) , 02 (Read Input States) , 04(Read Analog Input) and 05(Set Coil State) shows response code error as it seems at the snap that I post. The error at response code is the same at all commands. Would you like to check if that is error at my code as slave , or at FLOWCODE7 ?
Before add some I/O to PIC , I was checked with help of a master emulator (Simply Modbus Master) some modbus command that I will use . I noticed that some commands as 01 (Read Coil States ) , 02 (Read Input States) , 04(Read Analog Input) and 05(Set Coil State) shows response code error as it seems at the snap that I post. The error at response code is the same at all commands. Would you like to check if that is error at my code as slave , or at FLOWCODE7 ?
- Attachments
-
- Ashampoo_Snap_2017.03.27_01h50m20s_005_.png
- The response error as it seems at send/receive data at the bottom, is the same at commands 01,02,04,05 .
- (139.41 KiB) Downloaded 11868 times
-
- Posts: 444
- Joined: Tue Apr 15, 2014 4:19 pm
- Location: Kajaani, Finland
- Has thanked: 345 times
- Been thanked: 227 times
- Contact:
Re: PIC AS MODBUS SLAVE
Have you set up the register counts for coils and analog?
FC 7 is smart and the code will answer "Illegal data adress" if it has no corresponding registers set up on components properties for that function code.
4x registers are Holding registers.
FC 7 is smart and the code will answer "Illegal data adress" if it has no corresponding registers set up on components properties for that function code.
4x registers are Holding registers.
Ill just keep the good work up!
-
- Posts: 115
- Joined: Wed Aug 03, 2016 10:45 pm
- Has thanked: 24 times
- Been thanked: 11 times
- Contact:
Re: PIC AS MODBUS SLAVE
Thanks EtsDriver, I forgot to setup component properties. After that, I have no errors in command's responses. Now I'll continue to make some tests with I/O .