Anybus Gateway AB7007 Configuring Rockwell PLC

I am trying to configure a Rockwell PLC (using Rockwell Studo 5000) to connect to Anybus Gateway AB7007 as a generic Ethernet module. I have set the following parameters

Assembly Instance
Input- 100 Size- 5
Output- 150 Size- 5
Configuration- 3 Size- 0

Comm format- SINT

I am able to connect successfully to the device.

With the above settings I can set values less than 127, however more than 127 I cannot do so. Could anyone suggest how I can set values of upto 255 bits in the Rockwell registers??

Setting Comm format to DINT, causes a connection size error.
The Anybus configuration is set for 5 bytes input and 5 bytes output, this includes the trigger register as well.

Thanks
a

Hello @arbjful,

Are you using a signed SINT? This most likely limiting you to 127. dec127 == 0b0111 1111. dec-1 == 0b1111 1111. I am not sure if all Rockwell PLC’s support unsigned data types. You might need to move the data you read from the gateway into INT tag to give you more space to write the 8th bit and still use a positive number.

Deryck

Thanks for the reply.

Yes. One of my customer is using SINT. The device at the subnetwork level accepts 8 bit values.

So if 400 is sent by the PLC, we get this in two bytes 1 and 144. This is perfectly fine for us. Using INT should solve this problem as you have pointed out. Could you suggest what should be the size of the Input and output, when INT format is used??

Hello @arbjful,

You just need to divide the data byte count by the bytes in the data type.

SINT = 1 byte
INT = 2 bytes
DINT = 4 bytes.

With 5 bytes being an odd number you would need at least need 3 INTs. This does give you an issue where the data size will not match. You will need to disable exact io match or set the size manually and add an extra byte.
image

To be clear this issue is because your PLC treats the variables as signed and not necessarily because of the size of the data type. Using int will grab two bytes so this could still give you issues if you need each byte individually.

Changing the data type used for the data array might not necessarily solve your issue since its going to tread 2 bytes as one word.

To try and further explain your data is coming in as AABBCCDDEE
SINT gives you 5 individual variables. AA|BB|CC|DD|EE
INT uses two bytes for each variable AABB|CCDD|EE??

Thanks for the help.

One of my customer uses SINT. In this case Input & Output sizes are 17 and 5.
He converts the data to be sent to the gateway by doing an AND operation and extracts the MSB and LSB parts

to get MSB
DATA_MSB=Data AND 65280 (0xFF00)
This gets the MSB part

To get LSB
DATA_LSB= Data AND 255 (0xFF)
This gets the LSB part

The MSB and LSB parts are then Moved to the Output buffers of the gateway, using MOV operation

Both DATA_LSB and DATA_MSB are declared as SINT. This seems to work perfectly.

However I am unable to understand how this can handle values larger than 127.

The 127 limit is most likely due to the SINT being a signed short int. The most significant bit is use as the sign bit. This is rockwell issue rather then the Anybus. I believe newer PLC’s with studio around version 32 have the option for unsigned.

If you can set a negative value to the sint this is the issue.

Deryck

Hello deryck,

I used INT type this time and I doubled the input output sizes in the Anybus configuration. Now I can transfer data from the Rockwell PLC to the gateway, but the bytes get reversed.

For example when writing 2000 in the output butter in the Rockwell PLC, I get D0 07 in the output buffer

0200 = 0xD0
0x201= 0x07

However the device in the sub network expects the MSB (0x07) to come first, the LSB (0xD0) to come next. So the sub network device calculates the value as 3335 ( 256x 208 + 7) instead of 2000 (256 x7 + 208).

I tried byte swapping in the gateway, but this doesn’t seem to work, the bytes remain unchanged.

Could you please suggest how I can solve this??

Thanks
A

Hello,

If the byte swap options in ACM does not work for you application you will need to swap the bytes in the PLC.

Deryck