Jump to content

Help needed with simple modbus RS485 communication to PC


Recommended Posts

Hi all,

Im trying to understand how to communicate through modbus RS485 with a V700 PLC.

In the end I need to connect to a blower type device but let's forget that for now (I dont have it available anyway). 

Im trying to successfully send and receive from a PC using a USB to RS485 adapter (USB to DB9 to RJ11) - DB9 pin 2 is connected to pin 1 in the RJ11 and DB9 pin 1 connected to pin 6 on the RJ11, is that correct?

Now for the program (attached):

I configure the TCP port for online view and download, then configure port 1 as RS485 with the default settings.

BTW the dipswitches are configured as a RS485 termination is that right?

Then did 1 net to read register (function 3) and 1 net to preset register (function 6), only trying to read and write 1 bit(byte?), same as would be with the blower device.

Im using a program called ComTestPro for modbus devices to try and act as the blower to read and write the first bit.

I get the following error "Incorrect function code in response", for both read and write

image.png.f181c8015a3ebb1a1d3d863e68f570f2.png

Does anyone know what's the problem?

any help/clues are greatly appreciated

 

TestModbus485.vlp

Link to comment
Share on other sites

  • MVP 2023

Hi, it looks like you setup two MASTER in modbus network.

Your software, as i see offer only master function - read&write.

If you configure V700 as SLAVE via Visilogic ladder - you can read/write registers in V700 (You can find Modbus register address in Help).

Try to find software Modbus Slave emulator for use V700 as master.

  • Like 1
Link to comment
Share on other sites

As @kratmel modbus network should be Master(Client)-slave(Server).

Master initiates comunication and server just responds to whathever the master is asking for. 

I couldn't open your file since was developed on a newer version. Take this with with a grain of salt but I have had bad experiences with newest software versions and communications before.

So before doing anything else if I were you, I'll test communication with one of the examples on visilogic projects folder,  I suggest use morbus tcp/ipt because you already have ethernet available(as seen in that screenshot).

Just as an example, I had a perfectly working program that was released to production but when maintanance needed to install it on a machine using a brand new installation of visilogic then serial communication was not working, I rolled back the OS with my laptop using same original source project with an older version of visilogic and serial communication worked again.

Same happened a few months ago with another guy in the forum over modbus TCP/IP and a v700. 

 
 

  • Like 1
Link to comment
Share on other sites

On 6/7/2022 at 3:32 PM, kratmel said:

Hi, it looks like you setup two MASTER in modbus network.

Your software, as i see offer only master function - read&write.

If you configure V700 as SLAVE via Visilogic ladder - you can read/write registers in V700 (You can find Modbus register address in Help).

Try to find software Modbus Slave emulator for use V700 as master.

thanks you, I found a software to simulate slave and everything is working great!

 

On 6/7/2022 at 8:31 PM, Fernando Castro said:

As @kratmel modbus network should be Master(Client)-slave(Server).

Master initiates comunication and server just responds to whathever the master is asking for. 

I couldn't open your file since was developed on a newer version. Take this with with a grain of salt but I have had bad experiences with newest software versions and communications before.

So before doing anything else if I were you, I'll test communication with one of the examples on visilogic projects folder,  I suggest use morbus tcp/ipt because you already have ethernet available(as seen in that screenshot).

Just as an example, I had a perfectly working program that was released to production but when maintanance needed to install it on a machine using a brand new installation of visilogic then serial communication was not working, I rolled back the OS with my laptop using same original source project with an older version of visilogic and serial communication worked again.

Same happened a few months ago with another guy in the forum over modbus TCP/IP and a v700. 

 
 

Thanks for the help, didn't used it this time but defiantly keeping that in mind

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...