Luis Venturino Posted December 13, 2023 Report Share Posted December 13, 2023 Hello Unitronics support. Iam currently working with an PLC Samba in a program for communication modbus with an IO-Link card with Ehternet communication. But I not can set the plc as master in the network. In the program I used the block MODBUS IP read holding register for read the address target in the IO-Link device. But the block shows in the status messages when is started the number 5, which means that it has no response from the IO-Link device. I attached the program in this email so you can see if I have any errors in the programming. The PLC Unitronics samba have the device feactures detailed below: Unitronics samba OPLC Information: Model: SM70-J-TA22 Hardware Rev: B OS Version: O/S: 4.11 (28) I check the devices by Modbus poll and obtain the data detailed below: Data etherNET/IP IO-Link master Baumer // PN: 11215460. Seting comunication: Comunication: Modbus TCP/IP Ip: 0192.168.0.250 (IPv4) Repose Timeout: 1000 ms Delay Between polls: 1000 ms Server port: 502 Connect timeout: 3000 ms Data: Slave ID: 1 Data sensor 1: 41000 (Status sensor), 41001(Empty), 41002(Mesurment), 41003(data switch). Slave ID: 2 Data sensor 1: 42000 (Status sensor), 42001(Empty), 42002(Mesurment), 42003(data switch). Slave ID: 3 Data sensor 1: 43000 (Status sensor), 43001(Empty), 43002(Mesurment), 43003(data switch). Slave ID: 4 Data sensor 1: 44000 (Status sensor), 43001(Empty), 44002(Mesurment), 44003(data switch). if you have any suggestion please tell me for can solution this problem. I wait attentively for your reply. Kindest regards. 2023-12-13 Modbus master.vlp Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted December 13, 2023 MVP 2023 Report Share Posted December 13, 2023 It looks like you set up Socket 3 for comms, but you set up your MODBUS configuration for Socket 2. Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted December 13, 2023 MVP 2023 Report Share Posted December 13, 2023 1 hour ago, Luis Venturino said: Hello Unitronics support And by the way, this is a volunteer user forum, not official Unitronics Support. Unitronics does provide support elsewhere. Link to comment Share on other sites More sharing options...
Santiago PB Posted December 14, 2023 Report Share Posted December 14, 2023 Hi Flex, thanks for answer. I also work with Luis and Facundo who have made some questions. This is the situation> The program Luis posted if we use the socket 3 for Modbus configuration, when we open the configuration socket option into that block, Socket 3 indicates "socket 3 Deafaulkt TCP(20257) Slave as you can see if we put that option, socket 3 / it should work as salve, and we need to be master. Same situation for socket 2, it appears to be set as slave at the end of the sentence. Sockets 0 and 1 we understand it is not useful for our application. Note that we at the TCP/IP Socket init block, we already at option "cliente/Server" we already set it as Client/Master. Is it ok for you? Is this configuration enough or correct? Which socket should we use, if we see that this options do not set it as Master? About Modbus IP read holding register Can you see why it has not answer if the slave is ok and available at the network? (we tested the IO Link master device (as slave confirmed) communication with modbus poll and works fine). We really appreciate your answer and time. Regards Santiago. Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted December 14, 2023 MVP 2023 Report Share Posted December 14, 2023 40 minutes ago, Santiago PB said: 1. as you can see if we put that option, socket 3 / it should work as salve, and we need to be master. The Socket Initialization FB determines master or slave. Ignore the "Default:" statement in the MODBUS configuration FB. It is true that is the default, but the Socket Initialization overrides. 43 minutes ago, Santiago PB said: 3. Is this configuration enough or correct? Which socket should we use, if we see that this options do not set it as Master? You can use any of the 4 sockets for any purpose. Just initialize them the way you want them. It's best not to have two or more sockets set to the same port number. 47 minutes ago, Santiago PB said: 4. About Modbus IP read holding register Can you see why it has not answer if the slave is ok and available at the network? (we tested the IO Link master device (as slave confirmed) communication with modbus poll and works fine). As I said, you appear to be using Socket 3 for your comms, but you are configuring your MODBUS to use socket 2. Change the MODBUS configuration to socket 3. And again, ignore the "Default:" statement that appears there, just choose the correct socket number. Link to comment Share on other sites More sharing options...
Santiago PB Posted December 14, 2023 Report Share Posted December 14, 2023 Hi flex, thanks for your answer. I attach again the file with socket 3 configured on both options. We test it with modbus slave and with the IO LINK master and nothing happens. It does not receive any information. If you can review to see where could be the problem, I really appreciate it- socket 3 puerto 20257.vlp Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted December 14, 2023 MVP 2023 Report Share Posted December 14, 2023 Multiple problems: 1) Get rid of ladder rung 2. The SCAN_EX FB is for when the PLC is the slave. 2) With MODBUS you need to CONNECT to the slave device. Check the example projects that came with your VisiLogic installation to see the proper procedure for performing the connect function. 3) It looks like your vector that receives the data, starting at MI 12, is of length 4 yet you do not have 3 additional unassigned MIs for the data to go without overwriting MI 15. Link to comment Share on other sites More sharing options...
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