RSLogix5000 Get_Scattered/Set_Scattered

Michal_dk

Member
Join Date
Oct 2007
Location
Vejen
Posts
153
Hi Guys!

I'm trying to implement the Explicit message function Get (or Set) Scattered.

It works like a charm as long as my values are below 32767, but if I get above that value I get negative values as a result.

My Msg function is set up like this:

Message Type: CIP Generic
Service Type: Custom
Service Code: 4Bh
Class: 64h
Instance: 100d
Attribute: 0h
Source Length: 10 bytes

I'm trying to read the Stator resistance on a motor connected to a Danfoss FC302 drive using EthernetIP. The Stator Resistance is located in Parameter 1-30 and it is a 32 bit value.
I have a Request Tag, that is an array of 30 Integer. In Req[0] I have 130.

Am I doing something wrong? To me it seems as if the response should contain:
Res[0]: 130
Res[1]: LSW
Res[2]: MSW

But I only get a value in Res[0] and Res[1] (130 and -30226) the resistance is 3.3510

Best regards,

Michal
 
Are you sure the resistance isn't 3.5310 Ohms?

I think you are dealing with a formatted DINT. The value is a 32-bit quantity in Ohms x 10000. To get something you can read use a CPS instruction such as:

CPS( Res[1], Resistance, 1)
where Resistance is a DINT. This will result in 35310 given the register values you listed.

The INT data type in a Logix processor is assumed to be a signed integer. Once you get above 32767 the sign bit (bit 15) is set and the number becomes negative. That is what you are seeing. If you copy the bit pattern into a DINT the value will display correctly.

Keith
 
Hi Keith!

Thanks for the reply, You were right! If I read the value using a Get_Attribute_Single MSG and I use a 32 bit tag I can read it fine.
And yes I'm sure, I can read the value directly in the drive and also through MCT10 (the Danfoss Configure tool).

Due to my having quite a few parameters I needed to read and write, I ended up writing a loop that changes the Class and Instance of a Get_Attribut_Single and Set_Attribute_Single MSG and via a counter inserts the correct parameter numbers and values in my result.
I have yet to encounter problems and even though I'm solely using a 32 bit array I can read/write 8 bit UINT as well as 16 bit UINT without problems.

Thabks!

Michal
 

Similar Topics

Hello everyone, I have an RSLogix5000 project which is running live in the factory but I need to make some changes to the logic. I want to test...
Replies
0
Views
1,097
Good Morning Everyone, I'm looking to use the GSV instruction to get I/O fault codes for my project so I know if there's a comms issue in my E/IP...
Replies
5
Views
813
The machine is running production. When trying to go online with the laptop the whole machine looses communication and faults out. Drives, HMI...
Replies
13
Views
1,873
Hello, is it possible to create a data block, something like shared datablock in Siemens STEP 7, in the RS Logix5000 PLC project? I would like...
Replies
3
Views
1,049
Hi all. This is a machine programmed by the manufacturer. There is an event task and the event tag is a MOTION_GROUP tag. Screenshot . Since the...
Replies
2
Views
979
Back
Top Bottom