Jump to content

Communication of 85XX+ Temp. Scanner with VISION 120 PLC over Modbus RS485


Recommended Posts

I think you are confusing the terms:

 

slave ID is usually used to specify the device on the Modbus Network. in the code that you sent is hardcoded to be 1:

image.png.74f2199b76600f8ba2172edd3639432d.png

 register 400001 and 300001 to me sounds like different function code registers. are you sure that the Masibus Old and New scanner uses different addresses?

some background on Modbus:

Modbus works using specified registry addresses, and the called function codes:

MODBUS Protocol Data Types and Corresponding Description.

so, 30001 is the first address on the Input registers, and 40001 is the first one on the Holding registers.

the difference is that holding registers are Read/Write  and Input registers are only Read.

so, if you want to access register 30001 you need to point to addres 0 of Input registers using function code 4 (Read Input registers).

the program that you sent is accessing address 0 using function code 3 (Read Holding registers) which happens to be register 40001:

image.png.d135beabab3529a79b4844620f1055d4.png

 

If you are sure that you need to read register 30001 then use the appropriate function code:

image.png.6407eb2ce4896d06764ed7412c6c304a.png

 

Also, some Modbus devices starts counting on 0, others on 1 just to take into consideration.

  • Like 1
  • Upvote 1
Link to comment
Share on other sites

On 3/31/2023 at 6:05 PM, Fernando Castro said:

I think you are confusing the terms:

 

slave ID is usually used to specify the device on the Modbus Network. in the code that you sent is hardcoded to be 1:

image.png.74f2199b76600f8ba2172edd3639432d.png

 register 400001 and 300001 to me sounds like different function code registers. are you sure that the Masibus Old and New scanner uses different addresses?

some background on Modbus:

Modbus works using specified registry addresses, and the called function codes:

MODBUS Protocol Data Types and Corresponding Description.

so, 30001 is the first address on the Input registers, and 40001 is the first one on the Holding registers.

the difference is that holding registers are Read/Write  and Input registers are only Read.

so, if you want to access register 30001 you need to point to addres 0 of Input registers using function code 4 (Read Input registers).

the program that you sent is accessing address 0 using function code 3 (Read Holding registers) which happens to be register 40001:

image.png.d135beabab3529a79b4844620f1055d4.png

 

If you are sure that you need to read register 30001 then use the appropriate function code:

image.png.6407eb2ce4896d06764ed7412c6c304a.png

 

Also, some Modbus devices starts counting on 0, others on 1 just to take into consideration.

Dear sir, we put the read input register (4) but also not communicated with scanner. Please find the attached photo and program. 

new scanner register.jpeg

old scanner register.jpeg

bn.vlp

Link to comment
Share on other sites

how can I change slave ID address in visilogic program.

masibus old scanner register value is 400001 and masibus new scanner register value is 300001.

we put new scanner register value in vision 120 PLC program but PLC not communicated with scanner.

Please find the attached program, and please suggest me.

new scanner register.jpeg

old scanner register.jpeg

bn.vlp

Link to comment
Share on other sites

1. Do not place more than one rung in each net. Split them.  

image.png.71b15f6f1772807588ef27b8b5472262.png

2. You´re using the same ID (#1) to master and to slave. Fernando already mentioned where to change slave ID address.

image.png.09158fd918d2407c40eebcbedc11893f.png

 

It´s highly suggested to use Modbus PC software (such as ModScan, Modbus Poll or any other) to debug communications.

 

Link to comment
Share on other sites

On 4/1/2023 at 3:07 AM, RAKESH GIRI said:

thank you so much sir for resolved my problem.

So, I did not solved the problem? 😂.

 

2 hours ago, Gabriel Franco said:

1. Do not place more than one rung in each net. Split them.  

image.png.71b15f6f1772807588ef27b8b5472262.png

2. You´re using the same ID (#1) to master and to slave. Fernando already mentioned where to change slave ID address.

image.png.09158fd918d2407c40eebcbedc11893f.png

 

It´s highly suggested to use Modbus PC software (such as ModScan, Modbus Poll or any other) to debug communications.

 

Good catch! from @Gabriel Franco. I assumed that the program was working as it was with another older scanner before.

If that is the case, the process that I'll do to troubleshoot is first. check the hardware configuration.

I have the feeling that the issue may not be the Modbus address that you are trying to read (30001 vs 40001).

If it is RS485, then it is a serial communication is the scanner properly configured? (Baud rate, parity, data bits, timeout) does it require a terminator resistor? sometimes there is a configuration option or dip switch to set those.

And following Gabriel, you can test on a computer using this Modbus Master simulator: Modbus Master Simulator - free software utility for testing Modbus slave devices (dxp.pl) 

Link to comment
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
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.