matteo.galli Posted November 18, 2013 Report Posted November 18, 2013 I am encountering several problems with my project. I am trying to connect a V 350 to a Yaskawa mp 2600 by using modbus protocol through ethernet. I was wondering what sockets must be initialized to establish a connection between these devices? Must I use socket 2? or socket 2 and socket 0? The master plc (v 350) could send a string to the yaskawa which responds sending a bit back to the V350. From the unitronics side I cant understand what address i should use to read a coil in yaskawa mp 2600. According to the modbus memory model ( found on yaskawa help) if I want to read a coil ( 10001 modbus model ) which is %XB 24560.0 in yaskawa memory map, what slave address should I use to read this coil from Unitronics?
Alexander Posted November 18, 2013 Report Posted November 18, 2013 The sockets do have default values set up, but they can be changed and initialized to suit your application. You will have to run the MODBUS IP configuration block on start up, and as long as you have one socket set up as a TCP master you will be able to send out MODBUS commands. You will also have to set up a TCP slave socket and have the MODBUS ScanEX function block constantly scanning for that MODBUS configuration. Once you have performed the connect function using the slaves IP and port number you can then send MODBUS commands. Yaskawa should provide the slave address table that shows which registers to read from, and what MODBUS commands should be used with each. In this case the slave address appears to be 10001 as provided by the documentation that you have. The device can then connect and send information back to the V350 using the Ethernet cards IP and the TCP/IP slave socket port number that was initialized.
matteo.galli Posted November 19, 2013 Author Report Posted November 19, 2013 this is what I have done so far. In the first TCP socket Init, I set the socket 2 and port 502( as default), and the second block I set the socket 0 and the port 20000 ( as default). Int the second modbus config, i set the Ip address of my yaskawa and the port 502 in the slave devices list. In the first Modbus config I havent set anything since it should be the socket 2 for the slave. In the connect socket 2 block , I set the remote port 502 and my yaskawa ip address. in the connect socket 0 block, I set the remote port 20000 and the yaskawa ip address. I still dont understand how these blocks work, there are too many degrees of freedom in this modbus configuration. I read the help file, but it didnt help me at all.
Alexander Posted November 19, 2013 Report Posted November 19, 2013 The network ID will be 255 for all MODBUS IP configuration blocks. Have you been able to connect to the Yaskawa? It will have it's own individual port number, and it will not be the same as the port you set in the socket configuration. The socket configuration port will only be referenced when you are connecting to the V350 only if it is set up as a slave. Only once you are connected can you use the regular MODBUS commands to read/write information. When receiving information from the Yaskawa you will not perform the connection, the Yaskawa will have to perform the connection to a slave socket on the V350. You will also need to run the MODBUS scan function for the slave socket so it can receive MODBUS commands. We have webinars on both Ethernet and MODBUS communication that should help explain how to configure the logic in greater detail. http://www.unitronics.com/support/webinars
matteo.galli Posted November 19, 2013 Author Report Posted November 19, 2013 Dear alexander, Thank you for your help. For ethernet communication yaskawa has the port number 44818. The funny thing is I can not see that number in my slave devices list in the modbus configuration block. Anyway tomorrow I will do as you just told me, hoping that it's going to work. thank you again. Matteo
Alexander Posted November 19, 2013 Report Posted November 19, 2013 It is not required to have these devices set up within the MODBUS configuration block. You only need to know the IP and port number for the Yaskawa when using the TCP/IP connect function block.
matteo.galli Posted November 20, 2013 Author Report Posted November 20, 2013 When I try to read a coil at address '00001' ( according to the modbus memory) %IX24560.0 in the yaskawa modbus memory, I always get a wrong value. I use the 502 and it should be the right port since I can read the value of some coils in yaskawa by using KEPserver. I set yaskawa as modbus slave device, so I cant understand what I am getting wrong, I initialized the socket 3 in the V350 following the webinars found on your website. At this point I dont know what to do, connecting two devices of the same type is really easy.. but connecting two devices from different competitors looks like a really complicated operation.
Alexander Posted November 20, 2013 Report Posted November 20, 2013 Each Modbus command function will have an attached status operand if an error occurs. These status message values can be found in the VisiLogic help files. Though the value is not what you are expecting, it appears as if the PLC and Yaskawa are communicating but just not being addressed correctly. I would double check the slave address table for the Yaskawa which should describe the function and addresses for each register/coil.
Gabriel Franco Posted November 21, 2013 Report Posted November 21, 2013 See attached file. It´s the way I communicate with MODBUS IP slaves to get data from them MODBUS_IP_YASKAWA.vlp
matteo.galli Posted November 22, 2013 Author Report Posted November 22, 2013 thank you Grabiel for your answer. but my project still doesn't work. I was wondering why you didn't use the Connect Socket (2) block on your project? The communication can not be established without that block... I guess so... kind regards, Matteo
matteo.galli Posted November 26, 2013 Author Report Posted November 26, 2013 when I try to read a coil from my yaskawa.. this error occurs: No CommunicationThe MODBUS session cannot be established. What can this error depend on? I set my yaskawa as Modbus slave..
Gabriel Franco Posted November 27, 2013 Report Posted November 27, 2013 Matteo, as it is UDP instead of TCP, does not need connect block to stablish comms. If Yaskawa specifically needs TCP, so you need connect to remote IP and port (Checking Ethernet card and socket are initialized) prior trying to get info from slave using any of modbus ip functions. Did you tried modbus ip master example included in Visilogic?
matteo.galli Posted November 27, 2013 Author Report Posted November 27, 2013 Dear Gabriel, I understood what you meant, and yes I tried that example file but it does not work.. i dont know what to think.
External Moderators tmoulder Posted December 3, 2013 External Moderators Report Posted December 3, 2013 http://forum.unitronics.com/index.php?/blog/16/entry-46-simple-1-node-modbus-tcp-master/?mode=show This may be of some help to you. It was written for a Vision 570, but should port pretty easily. It's a fully functional program I've used myself several times. Change the IPs, ports and addresses to match yours, and it may get you a bit closer. Best of luck, TM
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now