Machsupport Forum

Mach Discussion => Mach SDK plugin questions and answers. => Topic started by: TomKerekes on September 21, 2011, 07:27:53 PM

Title: How to set Actual/Current Velocities from Plugin
Post by: TomKerekes on September 21, 2011, 07:27:53 PM
Can anyone tell me how to set the current measured velocities from our controller Plugin into Mach3?

These would be the OEMDROs numbered 806 - 811 and 813 (Blended).

I've tried setting almost every variable in the Engine and MainPlanner that could possibly refer to a "Vel" with no effect.  I've also tried setting the DROs directly.

Any help GREATLY appreciated.

Thanks
TK

 
Title: Re: How to set Actual/Current Velocities from Plugin
Post by: BR549 on September 21, 2011, 11:27:43 PM
TOm , not all DROs can be written to from script. The general rule is IF you can type in a number hit enter and it does not stick THEN you cannot write to it from script either.

Hope that helps, (;-) TP
Title: Re: How to set Actual/Current Velocities from Plugin
Post by: TomKerekes on September 22, 2011, 12:11:24 AM
Yes I noticed those were read only from VB so I didn't expect SetOEMDRO would work from a Plugin, but I thought it was worth a try.

I assume some variable needs to be set but for the life of me I can't find it.  I tried all these:

   m_Engine->Axis[0].CurVelocity=10000;
   m_Engine->Axis[0].MasterVelocity=10000;
   m_MainPlanner -> XVel = 1000;
   m_MainPlanner ->BlendVel = 1000;
   MainPlanner->DiffX = 1000;
   MainPlanner->VelStore[0] = 1000;
   MainPlanner->Vels[0] = 1000;
   MainPlanner->m_RealVelocity[0] = 1000;

But no luck.

Any help please?

TK
Title: Re: How to set Actual/Current Velocities from Plugin
Post by: BR549 on September 22, 2011, 01:33:33 AM
Tom I will dive into to it and see what I can find.  This may be something that Brian only knows. Or Art but he is on vacation(;-) luckydog.

(;-) TP
Title: Re: How to set Actual/Current Velocities from Plugin
Post by: Brian Barker on September 28, 2011, 01:57:14 PM
the best way to read the data would be to look at the DRO but if you would like you can read the MainPlanner->XVel var This is an output not something that you can write too. Is that any help :)

thanks
Brian
Title: Re: How to set Actual/Current Velocities from Plugin
Post by: TomKerekes on September 28, 2011, 02:07:55 PM
Hi Brian,

No I'm trying to set the Velocity that Mach3 reports on the screens.  Our controller/plugin knows the current velocities and actual feedrate.  Our customer has current screen sets that just always report zero.  He says other plugins are able to do this correctly.  You are right I think I tried writing to that XVel variable and it just always gets reset back to zero so there must be some other source.

Thanks
TK
Title: Re: How to set Actual/Current Velocities from Plugin
Post by: ART on September 28, 2011, 03:57:19 PM
Hi:

  Off the top of my head, I believe you set m_Engine->StatLast[axis] to an integer number of steps taken in the last 200ms..

Art
Title: Re: How to set Actual/Current Velocities from Plugin
Post by: TomKerekes on September 29, 2011, 10:31:55 AM
Art,

Exactly.

THANKS!
TK