Unity Pro XL DTM Browser Issues

00sas00

Member
Join Date
Jan 2011
Location
brisbane
Posts
7
Greetings fellow control nuts,

My head is quite sore from banging it against the wall with an issue I've got with the DTM Browser in Unity Pro, where you set up the Modbus Communications Requests for the remote devices.

My issue is, if you change the number of requested addresses (e.g. read 10 registers from address 4001 -> read 15 registers from address 4001) then the DTM browser automatically changes the memory allocations for the ???_IN Structures where it stores the data that’s retrieved.

This is causing headaches because the mapping to the Modbus_Read structures that the actual custom DFBs use, is done by mapping the Modbus_Read structure to the same address as the ??_IN structure.

e.g.
DTM Browser reads 10 addresses
A01_IN: %MW1000 (the structure where DTM browser stores the retrieved data)
A01_MBREAD01: %MW1000 (input structure to user DFB)
A01_MBREAD02: %MW1005 (input structure to user DFB)
A01_MBREAD03: %MW1007 (input structure to user DFB)

A02_IN: %MW1010 (the structure where DTM browser stores the retrieved data)
A02_MBREAD01: %MW1010 (input structure to user DFB)
A02_MBREAD02: %MW1015 (input structure to user DFB)
A02_MBREAD03: %MW1017 (input structure to user DFB)

And then if you change the DTM browser to read 15 addresses, the mapping goes all out of order because the DTM browser changes the mapped addresses automatically.

Eg:
A01_IN: %MW1000 (the structure where DTM browser stores the retrieved data)
A01_MBREAD01: %MW1000 (input structure to user DFB)
A01_MBREAD02: %MW1005 (input structure to user DFB)
A01_MBREAD03: %MW1007 (input structure to user DFB)

A02_IN: %MW1015 (the structure where DTM browser stores the retrieved data)
A02_MBREAD01: %MW1010 (input structure to user DFB)
A02_MBREAD02: %MW1015 (input structure to user DFB)
A02_MBREAD03: %MW1017 (input structure to user DFB)

So, I'm just wondering if you know of a way to get around this instead, of manually changing the addresses of the input structures for the user DFBs.

Any suggestions would be much appreciated.

Cheers!
 
Last edited:
you may be able to use aliasing (set your variable to be an alias of the _IN structure)
or why not just use the _IN structure directly
 
Thanks for the reply mate.

I'll give Aliasing a go.

The _IN structures aren't used directly because the _IN structures are arrays of Bytes, whereas the MBREAD structures are set up as words.

A byte to word "conversion" (for lack of a better word), is done by pointing the words arrays to the same %MW address as the byte arrays.

Not entirely sure why it was done this way, but that's what I've got to deal with.

Cheers.
 
Darn...

Aliasing doesn't work either, because the _IN Structures are arrays of bytes and the MBREAD structures are arrays or words.
 
Last edited:
Are all your MBread structures the same size. I am thinking you could create a function block that takes your aliased _IN structure (byte array) as an input and converts it to a word array. You would only need to use the standard Byte_to_Word function a number of times within your function block.
PS not sure of the name Byte_to_Word but there is a function that takes the high byte and low byte and combines them into a word
 
they're different sizes depending on the device.

i made an excel sheet that calculates the offsets for the MBREAD structures based on the first _IN address...

it's lame, but at least it makes the process faster.

:confused:
 
And this is what it might look like when done:

Unity3.jpg

This is for a Modbus read of 2 registers, so 4 bytes.

Also note the word alignment - M340 is 32bit, so would be aligned on every 4th byte while Premium and Quantum would be 16bit word aligned, so every second byte. This matters if, say, you request 3 Modbus registers - 6 bytes of data. Your resultant array will show in Unity with 2 extra bytes because it will align on 32 bits, so requires 8 bytes total. Ignore those other bytes. This is what it looks like:

Unity4.png
 
thanks for the reply robertkjonesjr.

This looks like it will work a treat. I'll give this a go.

Also, is it possible to read input status (1x registers) via DTM Browser Read Requests using the Generic Modbus DTM profile?

Cheers.
 
Also, is it possible to read input status (1x registers) via DTM Browser Read Requests using the Generic Modbus DTM profile?

No. This is the IOScanner service: function codes 3, 16, and 23 (decimal) only, which can only address holding registers. Some options:

1. Map the bits into holding registers on the mbtcp server
2. Use explicit messaging. I don't know what platform your on, so can't recommend a particular type of message block. Why Schneider can't make them all the same I'll never know. But then they can't get this off-by-one thing in modbus right either...
3. Gateway. Redlion would do... read bits from mbtcp server and push to your Schneider PLC bypassing the IOScanner service.
 
thanks for the info robertkjonesjr.

I'm using Unity Pro XL to program a Quantum PLC.

I'm going to try explicit messaging because it seems to be the cheapest solution. Clients love cheap solutions. :rolleyes:

Cheers.
 

Similar Topics

Hi All, Unity Pro XL V7.0 with a DP/DP Coupler, Release 2 - Siemens AG, I'm making some modifications to a brownfields site. I have added the...
Replies
0
Views
2,946
Hello, I am using Unity pro V15. I have Quantum CPU 671 and Ethernet NOE 77101 configured. I have configured IO scanning on NOE. I have attached...
Replies
5
Views
168
HELLO MY FRİENDS ı have problem. ı tought you can solved thıs problem for me. First of all When I checked all the cable connections of the...
Replies
0
Views
399
Hi All, I haven't installed Unity Pro in years and needed to install it recently. I initially tried installing Version 11.1 and the whole...
Replies
3
Views
694
Hello i want to implement a Read_var / Write_var functions to communicate with a modbus tcp device at the moment i use the unity simulator at the...
Replies
4
Views
1,900
Back
Top Bottom