Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: bcoop on February 25, 2022, 08:26:40 PM

Title: Axis 3 commanded while disabled - VistaCNC P2-S4 CNC Control Pendant
Post by: bcoop on February 25, 2022, 08:26:40 PM
I am running Mach4 4.2.0.4768 an ESS Smooth Stepper Board and a VistaCNC P2-S4 CNC Control Pendant for Mach4
my axis config is Motor0 = X,  Motor1 = Y primary , Motor2 = Z, Motor3 = Y Slave
the Pendant provides the ability to command to zero all axis' and also to send all axis' to position zero.
If I use the onscreen button to go to working zero, all axis' move to zero position. (works fine)

If I use the Pendant to go to zero, i get a message "Axis 3 commanded while disabled"
All other functions and commands on the pendant are working for me, just not goto zero. 

anyone have any ideas ?
I cant seem to even find where in the screens set the message is coming from.

Any assistance would be greatly appreciated.

Bob
Title: Re: Axis 3 commanded while disabled - VistaCNC P2-S4 CNC Control Pendant
Post by: SwiftyJ on February 26, 2022, 05:27:38 AM
Looks like it is trying to command the A axis to zero, which you don't have, hence the message. When the button is pressed does it execute code in the screen load script or is does the plugin do it internally?
Title: Re: Axis 3 commanded while disabled - VistaCNC P2-S4 CNC Control Pendant
Post by: bcoop on February 26, 2022, 07:47:30 AM
thanks for the response,
the on-screen button runs the script, (attached)  which works fine and includes A, so I assume that the Pendant has its own method in the plugin, but no way to verify
Title: Re: Axis 3 commanded while disabled - VistaCNC P2-S4 CNC Control Pendant
Post by: bcoop on March 04, 2022, 08:20:26 AM
Additional Information

Turned on logging  (log file data attached) 
found that when using GoToWorkZero Screen Button, the following command is issued
API: mcCntlMdiExecute(inst = 0, commands = 'G00 G53 Z0G00 X0 YO G00 Z0') (unknown caller)

When using the VistaCNC P2-S4 Pendant, this command is issued
API: mcCntlGotoZero(inst = 0) (unknown caller)

-----------------------------------------------------------------------------
From the API reference document,

rc = mc.mcCntlGotoZero(number mInst)

Description:
Move the X,Y,A,B,C and then the Z axis to zero of the current fixture offset.
-----------------------------------------------------------------------------
I have A,B,C all disabled, only using X,Y,Z and getting the error message "Axis 3 commanded while disabled"
If I enable Axis A , then I get and error "Axis 4 commanded while disabled"  which makes no sense to me.

it appears that possible something is not quite right in the API, enabling an Axis, causing the "Axis x commanded while disabled" error to occur.

anyone have any thoughts?


Title: Re: Axis 3 commanded while disabled - VistaCNC P2-S4 CNC Control Pendant
Post by: Bill_O on March 04, 2022, 09:03:31 AM
It looks to me like you need to fix the code.
Go to Operator then Edit Screen.
On the left select the top object in the Screen Tree Manager
Under Properties select the middle icon.
Click on Screen Load Script then click the button with the three"..."
Find function GoToWorkZero()
It should have several options.
Some will be commented out.
Make sure the one you want is not commented out and all the others are commented out.

This might help also.
https://www.machsupport.com/forum/index.php?topic=45397.0


Bill
Title: Re: Axis 3 commanded while disabled - VistaCNC P2-S4 CNC Control Pendant
Post by: bcoop on March 04, 2022, 09:06:28 AM
GotoWorkZero code in the screen load script works fine, its the pendant command that doesnt work correctly mcCntlGotoZero(inst = 0)


This works fine
Function GoToWorkZero()
    mc.mcCntlMdiExecute(inst, "G00 G53 Z0\nG00 X0 Y0 \nG00 Z0")--With Z moves
end
Title: Re: Axis 3 commanded while disabled - VistaCNC P2-S4 CNC Control Pendant
Post by: Bill_O on March 04, 2022, 09:16:25 AM
I do not use that pendant.
Under Configure / Plugins is there a plugin for it?
It might be in there you can tell it not to use "A"
Title: Re: Axis 3 commanded while disabled - VistaCNC P2-S4 CNC Control Pendant
Post by: bcoop on March 04, 2022, 09:20:56 AM
there is a plugin for it but appears that there is no user configuration, 
scratching head here,   :-\
Title: Re: Axis 3 commanded while disabled - VistaCNC P2-S4 CNC Control Pendant
Post by: SwiftyJ on March 04, 2022, 09:33:18 AM
Seems like the API call needs to only command the enabled axes rather than all of them.

Is the error message preventing the machine from moving?
Title: Re: Axis 3 commanded while disabled - VistaCNC P2-S4 CNC Control Pendant
Post by: bcoop on March 04, 2022, 09:56:01 AM
Correct, no axis' will move just display of the message, and  what is confusing is that if I enable my A-Axis, then the message changes from Axis 3 to Axis 4 commanded while disabled,  its like if the axis is enabled it generates the error, just the opposite of what is expected
Title: Re: Axis 3 commanded while disabled - VistaCNC P2-S4 CNC Control Pendant
Post by: SwiftyJ on March 04, 2022, 10:16:26 AM
Axis 3 is A axis, Axis 4 is B axis. Try enabling all axes and see if it works
Title: Re: Axis 3 commanded while disabled - VistaCNC P2-S4 CNC Control Pendant
Post by: bcoop on March 04, 2022, 12:02:30 PM

Enabling all axis' allows the pendant to work, (kind of)  the command waits until all axis arrive at home position, so it never completes. 

Also Mach4 throughs some errors, saying I need to assign a Motor to Axis 5, 
I am using motors 0-5 for X, Y, Z, A  (Y Using M1 and M3)   So I am assigning M6 to Axis 5 and Mach doesn't recognize that as a valid motor for some reason, maybe because ESS only supports 5 ?  as a test, I removed M3 from Y Slave, and assign to Axis 5, the error goes away. but can't run it like that, 

So it appears that mcCntlGotoZero(inst = 0) (unknown caller)  executes zero of all Axis X,Y,A,B,C and then the Z regardless if they are enabled or not. So it appears that this command can only be used if all axis are configured and functional.

So I have learned a lot but it doesnt appear i can use this function in the pendant the way the API functions, would be nice if it only executed the moves for Axis; that are enabled.