Cannot read modbus properly

Discussion about Gate Builder and variables database creation.
Post Reply
capitanui
Posts: 8
Joined: Wed Jan 12, 2011 1:33 pm

Cannot read modbus properly

Post by capitanui »

Hello

I’m trying to read some values over RS-485 and Modbus from 2 equipments…but it seems that I cannot read all what I want…
On one of the equipment I read successfully addresses 4:001 and 4:002 but I cannot read for example 4:221 while with other OPC server I can.

And also I have an equipment that doesn’t accept one single register reading and when I make a modbus request I need to read for example 4 or more registers.. an TAG ARRAY.. example : 400001[4].
In other scada softwares and another OPC server I can successfully do that.

Maybe it’s just because the software is unlicensed.

Can you tell me what could be the problem, Winlog supports these functions? Maybe I don’t know how to configure it!

I’m looking forward to hear from you.
User avatar
admin
Site Admin
Posts: 373
Joined: Tue Nov 17, 2009 1:18 pm

Re: Cannot read modbus properly

Post by admin »

Hi,
I’m trying to read some values over RS-485 and Modbus from 2 equipments…but it seems that I cannot read all what I want…
On one of the equipment I read successfully addresses 4:001 and 4:002 but I cannot read for example 4:221 while with other OPC server I can.
The first thing I suggest you read the help of the Modbus protocol that is in GateBuilder here:

Image
And also I have an equipment that doesn’t accept one single register reading and when I make a modbus request I need to read for example 4 or more registers.. an TAG ARRAY.. example : 400001[4].
In other scada softwares and another OPC server I can successfully do that.
Winlog support the reading of a series of consecutive gates but will not call the Array but Reading Blocks. To create a Reading Blocks is necessary to define the gates in a row and click here:

Image

In any case, this feature is explained in the help.
Maybe it’s just because the software is unlicensed.
The only limitation of the unlicensed version of Winlog Lite is the limit of 24 gates sampled for 15 minutes. All other features are enabled.

Thanks.
capitanui
Posts: 8
Joined: Wed Jan 12, 2011 1:33 pm

Re: Cannot read modbus properly

Post by capitanui »

I succedeed to read my data but know i encountered another problem...

I read blocks of 4 register from an energy meter...si if i read the voltage on 3phased power supply for example i get values stored in this 4 registers as it follows:

gate 1 - 0000h
gate 2 - 0000h
gate 3 - 0006h
gate 4 - A01Fh

My real measurement and the value i need to show on the template is gate3 combined with gate4 ...6A01Fh...

Are there some register shifting function or something so i can combine those values? i mean to declare a bigger variable...like 32 bits...an combine gate3 and 4..MSB and LSB.

Thanks for your previous reply..
User avatar
admin
Site Admin
Posts: 373
Joined: Tue Nov 17, 2009 1:18 pm

Re: Cannot read modbus properly

Post by admin »

Hi,
32bit read ports using Modbus functions 21h 24h 2Ch 2EH and so on.

Find the proper functioning of your case in the help protocol.

Per esempio:
21h:0006h

Image
capitanui
Posts: 8
Joined: Wed Jan 12, 2011 1:33 pm

Re: Cannot read modbus properly

Post by capitanui »

admin wrote:Hi,
32bit read ports using Modbus functions 21h 24h 2Ch 2EH and so on.

Find the proper functioning of your case in the help protocol.

Per esempio:
21h:0006h
I tried to do this but it doesn't let me to group in blocks the gates...and as i said..my equipment needs to be read in blocks of multiple registers...otherwise i cannot get any values..
Image
User avatar
admin
Site Admin
Posts: 373
Joined: Tue Nov 17, 2009 1:18 pm

Re: Cannot read modbus properly

Post by admin »

For Example:
gate 1 - 0006h 16bit
gate 2 - 0007h 16bit
gate 3 - 0008h 16bit
gate 4 - 0009h 16bit

gate 1 + gate 2 = value 1 32bit
gate 3 + gate 4 = value 2 32bit

To read these 2 values will need to enter the gates 21h:0006h (value 1) and 21h:0008h (value 2).
capitanui
Posts: 8
Joined: Wed Jan 12, 2011 1:33 pm

Re: Cannot read modbus properly

Post by capitanui »

Yes..you are absolutely right...
I succeded with 25h:0 .. 25h:2 and now i can read the correct values and also have them in correct variable types...

Thanks a lot...you've been a great help...

Sorry if i bodered you too much!
Post Reply