You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old November 4th, 2017, 05:10 AM   #1
Combo
Lifetime Supporting Member
Belgium

Combo is offline
 
Join Date: Jul 2002
Location: Belgium
Posts: 2,550
Little problem with the minus sign to send position to a servo controller:

Hi,

I have a Little problem with the minus sign.

The actual postion works fine but the send position doesn't arrive well in the drive.

So, my code for the actual position is:

Code:
        #TEMP_VARS.REC_POS_DWORD := ROL(
                                   IN := #PN_POS_ACT_D,
                                   N := 16);
                                   #TEMP_VARS.REC_POS_DINT := DWORD_TO_DINT(#TEMP_VARS.REC_POS_DWORD);
                                   #STD.RESULT."GRAPH RET"."ACT POS" := DINT_TO_REAL(#TEMP_VARS.REC_POS_DINT) / 10.0;
This works perfectly, when I control the axis manually below zero, this is correct.

But when I send with the following code to the drive, the position is the drive below zero is completely rubbish:

Code:
        #PN_POS_SET_D := ROL(
                             IN := DINT_TO_DWORD(ROUND(#STD.CMD."GRAPH CMD"."POS SET" * 10.0)),
                             N := 16);
I allready tried conversion from REAL_TO_DWORD, but that wasn't a succes either.

Owyeah, the ROL is because there is a word swap, the drive is a Lenze.

Any ideas ?

Thanks,
Gerry
  Reply With Quote
Old November 4th, 2017, 06:32 AM   #2
L D[AR2,P#0.0]
Lifetime Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
Join Date: Nov 2006
Location: UK
Posts: 5,456
Nothing wrong with your code with the test data I used.

Set a known position of -0.2 which converts to FFFEFFFF for the data you send to the drive and should be FFFFFFFE in the drive. Compare this bit pattern with the "rubbish" you see in the drive - there must be a correlation that you can see.
Attached Images
File Type: jpg lenze.jpg (101.7 KB, 58 views)
  Reply With Quote
Old November 5th, 2017, 04:34 AM   #3
Combo
Lifetime Supporting Member
Belgium

Combo is offline
 
Join Date: Jul 2002
Location: Belgium
Posts: 2,550
Hello

Hello,

An amazing thank you for doing the test. Yes I will do the test with minus 0,2 tomorow. Thanks for the advice. I'll give feedback here afterwards, thank you.

Kind regards,
Gerry


Quote:
Originally Posted by L D[AR2,P#0.0] View Post
Nothing wrong with your code with the test data I used.

Set a known position of -0.2 which converts to FFFEFFFF for the data you send to the drive and should be FFFFFFFE in the drive. Compare this bit pattern with the "rubbish" you see in the drive - there must be a correlation that you can see.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
QJ71E71-100 Send Data Problem ball261 LIVE PLC Questions And Answers 0 December 29th, 2009 07:59 PM
compactlogix send ascii messages to alpha sign? jeremyhass LIVE PLC Questions And Answers 4 October 22nd, 2009 05:07 AM
Ultra3000i Dnet moving to preset position problems johnfarrugia LIVE PLC Questions And Answers 8 November 21st, 2007 10:53 AM
Position Feedback with Mitsubishi Servos kpizzolatto LIVE PLC Questions And Answers 1 June 13th, 2007 12:48 PM
Problem with servo controller OMRON HUGO28 LIVE PLC Questions And Answers 1 June 8th, 2005 07:42 AM


All times are GMT -5. The time now is 12:10 PM.


.