Jump to content

Unable to communicate with Visilogic on Modbus Communication


Recommended Posts

I am trying to communicate with PH Sensor via Modbus, I was able to communicate with the PH Sensor on my laptop using ModScan64 Software using Register Address 8193 as provided by the manufacturer, but I was unable to communicate with it on Vislogic. I connected the Sensor via MJ10-22-CS66. I also set DIP Switch at the back for RS485 yet no communication.

Using ModScan64, I was able to get the parameters for:

8193 for ORP Value

8194 for PH Value

8196 for Temperature

Please how do I write these Register Addresses on Visilogic to poll the data for these parameters from the PH Sensor?

Please find attached the program and the document for the sensor

sup-ph8001-ph-sensor-user-manual.pdf ph 8002 communication.pdf PH Sensor.vlp

Link to comment
Share on other sites

  • MVP 2023

Also, you're asking for 6 consecutive registers to be read.  The sensor may not like doing such a read.   Given your addresses are 8193, 4 & 6, you could drop your read attempts back to 4 initially and see if that works.  If it doesn't then drop your read length to 2, which should cover 8193 & 4.  If THIS doesn't work, try reading only ONE register. 

Various sensors have different ways of handling sequential and non-sequential numbers.  Quite a few I work with I have to read individual registers to get everything i want out of the unit.  For multiple registers needed, this can be very annoying.  I have one modbus device where everything useful is not sequential, it has internal usage in between,  and it also doesn't like a long sequential read so I can pick registers I want from the total read.   Has to be one by one......

I had a quick look at your vlp, and it all seemed ok apart from my suggestions, but I might have missed something else.

If none of that works, then it is likely that the sensor is not using holding registers, try another type.  Sometimes "standards" are not used.

cheers, Aus

Link to comment
Share on other sites

  • MVP 2023

Denis, when I looked at the vlp, it's in the main routine.  I assumed that what is shown is via a fresh init.  But it does give rise to Ebenezer trying an online trigger of the function, in case something is astray with the calling method, that I haven't seen.

Further to my post above, Ebenezer, when you did your testing with the PC, did you try consecutive reads and did it work ok? 

Also,  have you tried inverting the connections to the sensor?  And termination resistors in and out of the circuit?  485 has quirks, and sometimes what is meant to be.....isn't!

cheers, Aus

Link to comment
Share on other sites

  • MVP 2023

After looking in detail at your screenshot again, I've just realised what Kratmel was saying earlier.  You are actually asking for too much in the RHR, as the function block already knows  the type of register.

Kratmel rightly suggested changing the D# to 8192.  I initially thought he was referring again to the offset I had spoken of.  I think this is the hiccouph.  Change it to just 8192 and you should be able to do consective reads, and then pick out what you want.

cheers, Aus

Link to comment
Share on other sites

  • MVP 2023

Just noticed something in your Modscan screenshot.  You are communicating to ID 1.  Yet in your PLC ask you are trying to reach ID2.  You need to change your sensor's ID, using Modscan to set the sensor's ID to 2 (or higher). 

Many Modbus devices default to ID1, and building your plc program to allow the plc to change the parameter, and also not have conflicts in addressing, is a good idea.  For instance, I often make the PLC ID 10.  This is purely abitrary, but it is NOT 1.  So any new modbus device can be put on the line, and the plc can set it appropriately using built in coding.

cheers, Aus

Link to comment
Share on other sites

 

Unilogic.thumb.JPG.7d6c9192274c92370df4e17b59467628.JPG 

Dear Aus,

Thanks for your support. I have done all your suggestions, yet it does not give value on Visilogic. I used the same PH sensor on Unilogic, I was able to get values from the address below:

8193 for ORP Value

8194 for PH Value

8196 for Temperature

Though I have a problem that only the ORP on 8193 was changing values as there was change in the process water, others remain static even when the temperature is increased

UniStream_10_Modbus_RS485_Master PH 1 Sensor.ulpr

Link to comment
Share on other sites

  • MVP 2023

I have been following the topic for a long time.

Unfortunately, I am still not sure whether the author did the following actions consistently and correctly:

1-did the author really connect the sensor to port 2, which he specified in the program.

That is, port 2 is an additionally delivered RS232/RS485 card in the V700 PLC, which must be additionally installed by the author. I have doubts about this. Apparently, if the author connected to the USB port and using it, he thinks that this is port 1, and the connector on the PLC is port 2. But in fact, these are the same two connections to port 1. Therefore, the RJ port 1 connector does not work as a communication port when USB connecting Visilogic.

If there is an additional RS485 card, the author can use USB connection and Ethernet for Visilogic connection monitoring on port 2 (COM2 in ladder config) . If no add on card present, the author must connect to VisiLogic via Ethernet and then he can use configured Port 1 (COM1 in ladder config) as a connection to the sensor.

2- made sure it connected to the sensor correctly. I mean, are the wires of the PLC port and the sensor not accidentally mixed up in places A and B?

Link to comment
Share on other sites

As Aus pointed out

In MODSCAN64 and UNISTREAM you are communicating with the slave device that has an ID=1

In VISILOGIC your PLC is ID=1 and your slave device ID=2

If you want to keep your Slave device as ID1 than change the PLC to ID2 in the modbus configuration block and see if this works.

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.