SEW MotionStudio(MDX61) Resolver counts looks good but ControlLogix +32767 to-32767?

Rob S.

Member
Join Date
Sep 2008
Location
Maryland
Posts
739
I have my earlier problem solved but this one is really getting to me. I have my direction issue solved , but I have another issue with my Actual Position High and Low.

SEW Movitools-MotionStudio
09. Bus Diagnostics
098 PI 2 1025 Actual Position High (Looks good)
099 PI 3 48229 Actual Position Low ( Looks good)
( Everything looks good here )

On the ControlLogix side..... This is my problem
Controller Tags
Movidrive.PI(2) 1025 Actual Position High ( Looks good)
Movidrive.PI(3) Actual Value wants to go +32767 to -32767. It seems like it should be the same as PI 3 in MotionStudio.

I thought I was onto something in MotionStudio looking at
27. Process Controller Input Values
28. Process Controller Limits

I got to have something messed up on the ControlLogix side.

Any thoughts on this ? I think I have one thing solved and then something else comes up.

Thanks,
 
you are looking at a 16 bit number
in Controllogix all 16 bit numbers (INT) are signed -32768 to 32767
48229 as a 16 bit signed number is -17,307

one method to convert unsigned 16 bit to 32 bit is to OR (bitwise) the INT with a DINT
 
Isn't it possible to combine PI 2 and PI 3 into a DINT?

This is what we do (in Siemens), we view the 2 PI's as one DINT-variable, not 2 separate INT-variables.
 
Thanks both of you ,

Jeebs , what type of instruction would you use to combine
PI 2 and PI 3 ? I am sure AB has similar instructions that Siemens has. What Siemens instruction do you use ?
 
Michael is right; the SEW drive is using unsigned 16-bit integers, and the A-B controller is using signed 16-bit integers.

You will probably use the Copy Synchronous (CPS) instruction. It's a special version of the Copy (COP) instruction that locks the source data fields from being changed during the instruction execution, and it's very commonly used when working with Input Connection data.

What you want to do, I think, is move the Low and High 16-bit words of the Actual Position into a single 32-bit double word that represents the Actual Position value.

This can get tricky with word order and byte order, but try it the simple way first.

Create a ControlLogix tag called Actual_Position, with a DINT datatype, and use this syntax:

COP
Source Movidrive.PI[2]
Destination Actual_Position
Length 1
 
The Length is 1 in this case because the Length of a COP or CPS instruction is always the number of destination elements.

In this case the destination is a DINT, which is 4 bytes long. So a Length of 1 moves 4 bytes from the source address to the destination address.
 
Thanks Ken ,

But how would I merge PI3 into it ?

"Create a ControlLogix tag called Actual_Position, with a DINT datatype, and use this syntax:

COP
Source Movidrive.PI[2]
Destination Actual_Position
Length 1 "

Jeebs ,

What Siemens instruction would you use to combine the 2 , and what would be the AB equivalent ?

"Isn't it possible to combine PI 2 and PI 3 into a DINT?

This is what we do (in Siemens), we view the 2 PI's as one DINT-variable, not 2 separate INT-variables. "

Thanks
 
I assumed you had created a UDT with an array element and that the parentheses () were actually square brackets []. Parentheses are not a valid character in a ControlLogix tagname.

Is this not the case ?

The COP and CPS instructions move as many bytes as necessary from the source to fill the destination. If the destination is a 32-bit datatype (a DINT) and the source is an array of 16-bit datatypes, it will take two of the source elements and move them into the destination element.
 
I looked more closely and the low and high words are in the reverse order from what you need to use the COP instruction.

You'll need to move each INT subelement into an intermediate INT[2] array tag, so that they are in the opposite order. You want the Low Word first.

Then the COP instruction will work the way you want it to.

RobS_SEW.jpg
 
Yes , the brackets are square. That was put in automatically when I created UDT , when I selected 10 in Dim 0.

But I did take notice that in SEW Motion Studio that the High Position is PI2 and the Low Position is PI 3 .

In the controller tags in ControlLogix , the High Position is
PI 1 and the Low Position is PI 2.

What could cause them to get switched ?

The CPS has a length of 1 , and the destination is Movidrive, pointed to a 10 word User-Defined Data Type , and the source is coming directly from the drive.
 
I can't say what's going on without seeing the actual program. If you can post it, we can have a look.
 
I am debugging it on a controller that I have in a training room. The program is so cluttered just trying different methods, subtracting , masking ,etc.

I still cannot get my head around taking PI1 and PI2 and getting them in one tag , as one number. If I could do that , I would be in great shape.
 
If you can post your *.ACD file, we can discuss it. Until then, my guesses about your datatypes are just going to be guesses.
 
Ken ,

I tried the example in your earlier post , I now have a value I can work with. Still not sure if I understand what is going on with the COP and the associated MOV's. When I look into more , I may have more questions about what I did , and why.

One more question... The number I can work with is.....

-206625357 , How can I reverse that to 206625357 , so I can work
with the positive side of the number for my positions.

Thanks and I greatly appreciate your help.
 

Similar Topics

Good Morning , I am close to integrating this SEW MDX61(DFE33B)into a ControlLogix PLC. The issue I have now is with the actual position of...
Replies
1
Views
3,240
I have a machine which is undergoing upgradation. As part of the process two SEW drives are being replaced., existing Gen B with new Gen C. The...
Replies
3
Views
197
Hi , I am trying to replace an old inverter with a new one and its giving me issues . Once the new one was installed , the S7-300 PLC started...
Replies
3
Views
126
Hello Everyone. Looking to see if any of you have encountered an issue with these drives. We have a major installation with around 30 of these...
Replies
0
Views
92
Hi Friends, I am facing a problem with encoder adjustment in Sew Electric Cylinder CMS71L. encoder using is Sick Hiperface Drive is MOVIDRIVE...
Replies
17
Views
786
Back
Top Bottom