Sign in to follow this  
Followers 0
donbinno

ModBus with B&R Automation V 3.081

15 posts in this topic

Hi There is a B&R Automation plc which comunicates with a supervision sofware (installed on computer); The communication is monitored via Modbus library. the problem is that the plc and the sofware don't communicate anymore. To solve that problem i first must understand how modbus works. Can somebody explain me the principle of modbus communication? and how can i diagnose that problem? Thanks

Share this post


Link to post
Share on other sites
Hello Donbinno! Modbus is a Master - Slave protocol with capability to send broadcast messages. So I think you should find out who is Master (PLC, PC) ? The Master should send requests (like Read Coil, Read Word(s), Write Coil(s), Write Bytes(s), .....) . Use Google to find details about the protocol function codes and so on.... Depending on the physical layer (serial, Ethernet, ... ? which you did not mention) you have to check with appropriate sniffer program if the Master is sending Requests to the Slave. There exist programs that are written to analyze Modbus protocol - but I never was using one so I dont know more about them. ( If the PLC is Master, you can find on B&R Modbus FUBs status words that indicate error and show error detail information. Maybe the Computer Program has a log file with some information ? ) br bb

Share this post


Link to post
Share on other sites
well thank you bits'bytes. To give you some answers the master is the PC and the slave the PLC. the connection between the plc and the pc is Ethernet since it's a Modbus TCP. So i have made some researches and i have another questions..^^ What do those registers concretely stand for in the communication? Coil? Discrete input? Input Register? Holding Register? Can i check the communication with the sothware wireshark?

Share this post


Link to post
Share on other sites
Hello donbinno! Yes you can - I was doing this already with Modbus UDP. As long as I could see those days, Wireshark is giving better support for Modbus TCP than UDP .... so you should be able to read clear Telegrams with Function codes and so on. Some hint in case it is your first time (?) - take care of the firewall settings (e.g. I had to remove a trend micro setting inside the properties of network interface (the one you use for diagnose), otherwise I would only see some Modbus TG in Wireshark - if you need use a HUB instead of a Switch Concering PLC: It is rather new that Modbus TCP is integrated with the Operating System at B&R, if this is your case, you will not have FUB's to check some status, but maybe you could find something in the Logbook (I think there is an extra logbook for fieldbus, maybe there is someting) If it is not integrated into the OS the program needs Modbus TCP Slave Fubs where you could eventually see some status. br bb

Share this post


Link to post
Share on other sites
Regarding modbus tcp and wireshark this is my fisrt time indeed There is no Modbus tcp integrated with the Operating System since it is an old project written with the 2003 system. The FUB used for the slave are instfMBTSOpen, instfMBTSClose, instfMBTSRW, instfMBTSFill How did you remove the trend micro setting inside the properties of network interface? I'm going to check with wireshark and see how that will work.. i guess there are a lot of questions right here so far thanks!

Share this post


Link to post
Share on other sites
In the network adapter properties - I mean where you can click on the TCP/IP v4 Parameters (to change IP Adress) there was an Entry of Trend-Micro. I only mentioned this because it was really good luck I found this after weeks where I had to use another laptop because mine would not show the TGs. Depending on your Virus protection software you may not even have an entry like that... br bb

Share this post


Link to post
Share on other sites
well i have spent all the day on that and that that was not easy ^^ i was online with the plc then i checked the FUB's status. all status are 0 (which should mean there is no error). i also launched wireshark. here are what i got and my arconfig. what do you think about that? Thanks!
1 person likes this

Share this post


Link to post
Share on other sites
Hello, can you tell me what happend that this configuration does not work anymore? I mean - this was working before and from one moment to the next: nada ? Was there something replaced, updated or anything else happen to this equipment ? The status of the Open seems OK and it also gets an Identifier. ... About the arconfig I can not tell you nothing as I never was working with this equipment before... To me it seems you are sniffing with wireshark the data between Automation Studio and the MP. You need to use a Hub , connect the MP and the oder PC (where the Software is executed) via Hub and connect also your Laptop to the Hub. Dont start the Automation Studio. Than you should be able to see the Telegrams from the other PC direction MP. Did you check for LOG files on the other PC ? Did you check the Error-Log on the MP, maybe there is some records about wrong data or so... ? Good luck br bb

Share this post


Link to post
Share on other sites
The sofware is also on my laptop that is why i was using wireshark to sniff the TG btween the plc and the sofware Anyway it is working now!!!. i noticed that in the arconfig the port number of online communication is 11159 but for modbus communication it should be 502. So i set 502 in the software and 11159 in the plc. ..i can see all the measures with the sofware now and the FUBs exchange ident and i can see the data in the holding registers.. i can't really explain that correctly ^^.. how can you interpret my port setting?? :) br bb

Share this post


Link to post
Share on other sites
Hi donbinno! congratiolations On your post with the Screenshots I was already thinking strange about the fact that you have activated Modbus in the arconfig. Because I thought the FUBs handle all Modbus matters. It seems not and I am confused also. If you have set 11159 in the PLC this is for Automation Studio I would guess. I agree that you need 502 in the external Software and 502 in the PLC . I am confused with this mixture of coniguration (FUBs, arconfig). More important is that it works !! EDIT: My guess after looking again at the screenshot that you have changed in the external software the Portnumber to 11159 ? Correct ? If yes, this is definitively wrong as this parameter is set for the INA communication which is used by PVI (Automation Studio, ...) After changing back to 502 it is working ? All good br bb Edited by bits'bytes

Share this post


Link to post
Share on other sites
Hello! No i didn't. what i did and that worked is --> Sofware port number: 502 and AS port number: 11159 In addition i have noticed something (which is normal according to me): For those settings: sofware port number: 502 and AS port number: 502--> communication btween AS and the plc didn't work but the communication btween sofware and the plc did work. sofware port number: 502 and AS port number: 11159--> communication btween AS and the plc did work and the communication btween sofware and the plc did work too.

Share this post


Link to post
Share on other sites
Hello ! OK - I agree with you and also think this is normal - as mentioned : Port 11159 is for INA Protocoll... (and thus the AS) And Port 502 is defined by the FUB... for the external software. My confiusion at the moment is What was finally wrong in your settings ? What did you change since the first post ? Just to add another information: on a project I am using Modbus RTU FUBs and I did not activate Modbus in the arconfig settings as I handle all modbus matters with the FUBs. br bb

Share this post


Link to post
Share on other sites
hello Can you please have a look at my two last topics? may be you will help me Thanks!

Share this post


Link to post
Share on other sites
hi there, i have also undergone difficulties in using modbus rtu of controlling VFD using Panasonic PLC. I have already downloaded memory mapping or modbus rtu of the inverter specifically the danfoss inverter but when i tested it in my program there was no response from the drive. if your familiar with the FPWinpro plc software i have used the modbus block instruction, there the parameters needed in order to run the program are: Communication port = 1 or 2 communication between PLC and inverter which is actually in RS-485 connection Modbus Fxn code = modbus 15 which writes multiple coils Start Register = 0006H coil no. 6 of the inverter which is allocated to run the inverter No. of register = 1 Master data = 0040H this is the control data in order to run fwd the inverter we can help each other and all of you guys who knows to solve our problem. thanks you so much..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0