LURBY

Powerflex to Micrologix 1100 CIP Messaging error

13 posts in this topic

I am trying to read and write specific parameters from a Powerflex 525 to a Micrologix 1100.  I followed the instructions from a Knowledgebase and was able to do it.  By using a CIP Generic - Generic Get Attribute Single MSG I can read parameter 7 for instance without any trouble.  I tried to change the instance in the MSG to read another parameter (388 to be exact).  It did not work.  The MSG sent back an error:

error code (in upper byte of MGx:y.22) was returned by Comms module or CIP device

I switched it back to 7 and it was fine.  I was told by the Knowledgebase that the "instance" was the same as the parameter.  I thought that changing the instance from 7 to 388 would read the value of 388 instead.  Am I doing something wrong?  Are there certain parameters that you can't read?  Is there something else that I need to change?

Share this post


Link to post
Share on other sites

Parameter 388 and 389 are meant to be used together, as the High and Low Word for the "Units Traveled" parameter in the PowerFlex 525.

Did you increase the data size so you could read two 16-bit words ?   It would not surprise me if the drive won't respond to a 1-Word request for Parameters 388 or 389 separately.

Parameters 388 and 389 use an unusual encoding scheme;  instead of literally being the high and low 16 bit Words of a 32-bit integer, they are the value to the left of a decimal point (388) and the right of the decimal point (389).

The manual also suggests that you can't Write 388 or 389 unless the drive is stopped.

Share this post


Link to post
Share on other sites
21 minutes ago, Ken Roach said:

The manual also suggests that you can't Write 388 or 389 unless the drive is stopped.

Looking at the manual, aren't 388 and 389 display only parameters? I didn't think you could write them at all.

Share this post


Link to post
Share on other sites
2 hours ago, Ken Roach said:

Parameter 388 and 389 are meant to be used together, as the High and Low Word for the "Units Traveled" parameter in the PowerFlex 525.

Did you increase the data size so you could read two 16-bit words ?   It would not surprise me if the drive won't respond to a 1-Word request for Parameters 388 or 389 separately.

Parameters 388 and 389 use an unusual encoding scheme;  instead of literally being the high and low 16 bit Words of a 32-bit integer, they are the value to the left of a decimal point (388) and the right of the decimal point (389).

The manual also suggests that you can't Write 388 or 389 unless the drive is stopped.

You are correct.  They are Read-Only which is all that I am trying to do.  I want to display them on a screen and possibly set the values up in a compare to trigger something else at a certain location.  Like you say I believe my problem is that I was trying to write it to a 16 bit integer slot when it is a 32 bit parameter.  Should I use a Long Integer instead?  Or would would just increasing the size sent work?  How many bytes would this parameter be?  The 16 bit (parameter 7) was 2.  This would be 4? 

I'm sorry about the naive question.  I don't know enough about the bits and bytes end of PLC programming to speak intelligently.

Share this post


Link to post
Share on other sites

I tried a bunch of different variations LINT and  INT with various sized bytes received.  I keep getting the error code.

error code (in upper byte of MGx:y.22) was returned by Comms module or CIP device

There must be a way to do this?

Share this post


Link to post
Share on other sites

The correct data type is DINT. 
One Byte is INT

Two Bytes is DINT

Four Bytes is LINT

Edited by NevergoldMel
To Create verbosity.

Share this post


Link to post
Share on other sites

So they are all "N" integers but the number of bytes determine the INT,DINT, or LINT?

The first pic (IMG8682) is a screen shot of the MSG instruction for parameter 7.  Writes to N14:6 and the size in bytes (receive) is 2.  It works.  When I look at N14:6 I can see the value of the last fault code.

The second pic (IMG8683) shows what I hope to be the MSG instruction for parameter 388.  I have it writing to N14:8?  Should the size be 4?  Will it only write to N14:8 or will it expand?  Where would I look to see the value?

IMG_8682.jpg

IMG_8682.jpg

IMG_8683.jpg

Share this post


Link to post
Share on other sites

"N" registers are all 16-bit, so 2 bytes each. If you need to receive 2 registers' worth of data, try changing your "size in bytes" to 4.

Share this post


Link to post
Share on other sites
5 hours ago, Joe E. said:

"N" registers are all 16-bit, so 2 bytes each. If you need to receive 2 registers' worth of data, try changing your "size in bytes" to 4.

I tried that and it didn't work.

So if the "N" register is 16-bit (2 bytes) and I write the 32-bit parameter to say N14:8 the first 16 bits will fill into N14:8.  Even if I increase the size to 4 bytes where does the rest of it go?  N14:9?

Share this post


Link to post
Share on other sites

The "L" data file [known as Long] is 32 bits. Try creating one of those to send your 4 bytes to.

Share this post


Link to post
Share on other sites
14 hours ago, LURBY said:

I tried that and it didn't work.

So if the "N" register is 16-bit (2 bytes) and I write the 32-bit parameter to say N14:8 the first 16 bits will fill into N14:8.  Even if I increase the size to 4 bytes where does the rest of it go?  N14:9?

I *think* so. I know a COP instruction has "Length" as a parameter and it's set to the number of destination elements to copy to. So you would set it to "2" to copy 4 bytes. The MSG instruction uses "Bytes" rather than "length", though, so that wouldn't apply.

I'd try the "L" data type as the destination if it will let you, like NevergoldMel suggested.

Share this post


Link to post
Share on other sites

I used a "L" data type yesterday and it did not work.  I tried it again today but instead of putting the instance of 388 in the (hex) box like the other parameters I put it in the (dec) box.  That did the trick.  Thank you all for your help.

Share this post


Link to post
Share on other sites

Hmmm...I thought about that yesterday but didn't think to mention it. Glad you got it working.

Share this post


Link to post
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