Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: daniba73 on November 22, 2017, 07:04:14 AM

Title: Mach4 Button OFFLINE
Post by: daniba73 on November 22, 2017, 07:04:14 AM
Hello to the whole forum!
I'm Italian, use google translate.
I'm using Mach4 Lathe.
Very nice program, although it is to be refined at some point.
Unfortunately I miss the OFFLINE button for some simulations.
This feature was present in the old Mach3, which I found very useful.
Is it possible to add this button with its function?
thank you!
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on November 22, 2017, 05:37:01 PM
Hi,
welcome. Mach4s great strength is its ability to be customised and so would be almost assured that such a feature could
be added if its not there already but named differently.

Would you be kind enough to explain what you mean by 'Offline' and what sort of behaviour that you would require of
Mach when its offline?

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on November 23, 2017, 03:27:11 AM
Hi, thank you for the answer.
using the translator I try to synthesize phrases.

I mean working behavior on Mach3 Mill in OFFLINE mode (to make me understand).
By pressing the OFFLINE key, the controller remains perfectly functional virtually, the machine does not perform any physical movement, and no function is activated (coolant pump, etc.).
VERY IMPORTANT, the DRO axes must remain active, in a virtual way.
I programmed a lot on the machine and then simulated in OFFLINE  (with the addition of SINGLE BLOCK function), it helps me to understand if I made mistakes.
When the OFFLINE button is released, the machine must return to active mode.
VERY IMPORTANT, the DRO must return to the initial state of when OFFLINE was activated.

I hope I have been able to explain clearly, as far as I can.
I find Mach4 a great program! I hope to make a long way!

links to some tests with Mach4 Lathe.

https://www.youtube.com/watch?v=l_d9W4G_lUk

https://www.youtube.com/watch?v=AfgQSPhsIOY
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on November 23, 2017, 04:01:42 AM
Hi,
yes Mach4 could be made to behave that way.

Do your stepper drivers and your spindle drivers have enable inputs? If they do then it is a simple matter to connect all the enable inputs together,
when you wish the motors to be active assert the enable signal. When you want to go 'offline' de-assert the enable signal and all the motors
would ignore any motion commands.

The only other consideration now is to record the location when you go 'offline' and then write some code to return to that location when going
back 'online'. Note that despite there being no physical movement for Mach to behave normally then the machine position as reflected by the
machine co-ordinates will move per normal. At the end of your 'offline' session the machine co-ords will be different to the actuall machine co-ords
of the point where it stopped. That would be easy and work fine UNLESS you change your work offsets during the session. Then you would physically
have to move the machine the difference between the pre and post work co-ords. Maybe in the first instance require that the work co-ords not change.
At a later date add that function if required.

What sort of motion controller are you using? Trying to estimate the resources your controller might have to spare.


Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on November 23, 2017, 04:12:37 AM
thanks for help.
As a controller I have a CsLab CSMIO-IP / S
drive Leadshine EL5 AC servo
currently for spindle use VFD Toshiba VF S15 1.5Kw
My preference would be OFFLINE via software (as it is in Mach3)
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on November 23, 2017, 04:32:45 AM
Hi,
my proposal is a software approach but you still need a way to prevent the motors from turning while having Mach go through all it usual motions.

Are all of the enables joined together or does each servo and/or spindle have its own enable?

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on November 23, 2017, 04:48:16 AM
NO, when you turn on the electronics is all enabled, like a classic electronic stepper.
If I disengage the axle motors, I am forced to reset the axes (Reference All Axes, Home) because the DROs are in the wrong position.
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on November 23, 2017, 05:19:20 AM
Hi,
isn't that exactly what you want? If you hit the 'offline' button the motors stop but the DROs keep moving. That, by definition means that the DROs
no longer reflect the actual position of the machine. So long as the machine co-ords are reset to those that applied when you go back 'online' you have
no need to re-reference.

Those servo drivers have an enable input as does the spindle. You need to use it. Whether you chose to have three seperate enable signals or just
one hooked to all three drivers is up to you.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on November 23, 2017, 05:56:39 AM
if they electrically cut the axes lose their position, although they seem fixed, they actually lose a few millimeters (example 0.02 mm) as in a stepping motor.
because the encoder is incremental.
even if you return to the same point with the DROs before reactivating the engine, the measurements will not be corrected as before.
better to do with software, (as does Mach3)
these axes always remain electrically active, keeping the correct position.
In Mach4 I can not find a button or OFFLINE function
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on November 23, 2017, 12:14:42 PM
Hi.
if you have a look at the Diagnostics tab in Mach3 and jog when 'offline' then you'll find the idea I'm suggesting for Mach4 is the same.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on November 23, 2017, 03:56:15 PM
In Mach3 with OFFLINE button the system enter in SIMULATION mode permitting me to move axis in jog, execute a program, start a spindle, without actually obtain a stepper movement or digital output activation. Just a simulation of my G-CODE program. When I disable the OFFLINE button all axis positions and digital I/O states backs to original states so I can run real job.
During OFFLINE axes must remain active to maintain position.
How to do same thing in Mach4 ?
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on November 23, 2017, 04:41:16 PM
Hi.
that is exactly the behaviour that I'm proposing with Mach4.

Are you interested in the learning involved to code it?

Craig
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on November 23, 2017, 05:50:17 PM
Hi,
if my idea is to work then we should try an experiment. You need to hook a wire to the servo drive Enable input
and be able to connect logic high or logic low so you can experiment what happens when the servo disables.
You may need to disconnect the existing wire from the terminal. Hook it to logic high, if according to the manual
logic high enables the servo.

The run a program without material in place with the servo enabled. It should move as normal. Then part way through the
program disable the servo. I anticipate that the program will continue to run on Machs screen with the DROs moving
per normal but the servo stopped. Note that if you then attempt to re-enable the servo it would expect it to fault because
its position is now well different from that when you disabled it and would exceed the allowable following error and fault.
Don't be alarmed, its the way it should be.

The critical point is 'can a program/MDI/jog operate normally on Machs screen with the servo stopped'. If you can do this
an 'Offline' function is going to be easy.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on November 24, 2017, 04:54:55 AM
Thanks again for your interest in the subject.
But that's not what I'm looking for.
I want to keep the axes enabled.
I want Mach4 to enter simulation mode, using the OFFLINE button!
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on November 24, 2017, 09:16:23 AM
Hi,
while you may not believe it that is exactly what I'm talking about doing, but clearly you know more about Mach4 than I do so I look forward
to your solution. Good luck.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on November 26, 2017, 03:29:22 PM
I'm sorry you're angry, it was not in my intentions.
I try to wait.
The evolution of Mach4 will activate this function.
Thanks again
Hello.
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on November 26, 2017, 04:05:55 PM
Hi,
the functionality you require is already there. You'll need a dozen lines of code to make it work.
If you won't experiment with one of your servo drives to find out what happens when you disable it then
you will not be able to code it either.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on November 26, 2017, 04:36:45 PM
Hi,
I think you may be confused by the difference between disabling a drive and disabling an axis in Mach4.

If you disable the drive but otherwise leave Mach alone Mach will carry on as normal, the DROs will move, you can
jog, MDI and so on but the servo won't move, ie offline. When you go to re-instate the servos you will need to code
so that the actual machine co-ordinates are reflected in Mach and would be included in the <Offline> button.

If you disable an axis in Mach the servo stops but so does the DRO, you can't jog, MDI etc. Not much use.

The behaviour is really determined by the servo drive which is why I recomend a few simple experiments. If your servos
respond the same as mine then this whole thing will be easy.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 21, 2018, 06:10:12 PM
Hello, I'm sorry for the very late reply, I had a lot of commitments, so I had to temporarily suspend hobbies.
I enclose the link of my drive manual.
I think, I'll have to feed the PIN9 to disable drive movement. (I'm not an expert in electronics).
thank you.

http://www.americanmotiontech.com/upload/Manuals/el5-dm_v1.0.pdf
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 21, 2018, 08:27:50 PM
Hi,
do you have your machine setup and running?

I would suspect that one input, at least, to your servo is 'SERVO ON' or 'ENABLE' or a description like it.
I would expect it to be pin 2 (SI1)  per diagram 3.1 The parameter PR4.00 on page 39 suggests that SERVO_ON
is the default setting for SI1 in Pos,Vel and Torque modes.

What I suggest is let a known good Gcode program run but  de-assert that input to see what happens.
I believe Mach will keep on running but the servo will stop. There are a number of different things which
could happen when you enable the servo again, it may fault out following error or it may continue to operate
from its present location.
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 22, 2018, 03:15:30 AM
Hi,
you can de-assert SI1 by disconnecting it or you can have Mach set it to zero.
These two little macros give you the chance to turn the servo enable signal on  and off and will help while your experimenting.

Code: [Select]
function m210()
local inst=mc.mcGetInstance()
local hsig,rc=mc.mcSignalGetHandle(inst,mc.OSIG_ENABLE0)
mc.mcSignalSetState(hsig,0)
end
if (mc.mcInEditor()==1) then
    m210()
end

Craig

Code: [Select]
function m211()
local inst=mc.mcGetInstance()
local hsig,rc=mc.mcSignalGetHandle(inst,mc.OSIG_ENABLE0)
mc.mcSignalSetState(hsig,1)
end
if (mc.mcInEditor()==1) then
    m211()
end
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 22, 2018, 04:07:26 AM
Hi,
yes, it's correct as you say. if I disable input, Mach4 executes, and engines are stopped.

When enabling drives, Mach4 and lathe axes are in two different positions.

I hypothesize solution:
it is possible to create a button in Mach4, which when pressed, memorizes DRO axes, and at the same time activates pin output  (to which I connect relay).

and at the release of this button, it will change the current DROs, with those stored previously, also deactivating output???.

if it were possible to create this button with these two functions, the problem would be solved!
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 22, 2018, 04:41:41 AM
Hi,
yes that was what I was proposing from the very start.

You still need to experiment what happens when you re-enable the servo after jogging/MDIing. How it responds will determine the kind of code you need.

Start your machine, reference it and drive it to some reasonably central location. Disable one of the axes. Now jog away but ending some distance from where
you started. Re-enable the servo. What happens? Do the machine coordinates reflect its actual position or do they reflect the position when you disabled the
axis? Experiment with it so that you are 100% sure that you know how it behaves. Once you have that sorted generating some code to 'send it back' to where it was
should be pretty easy.

I don't think you'll need a relay or any other output.

The broad outline is:
1) When the 'offline' button is pressed the machine coordinates of the axes are remembered
2) The servos are disabled by sending the M0 and M1 enable outputs low
3) MDI/jog to your hearts content
4) When the 'offline' button is activated again
    a) Issue G53 G0 to the machine coords saved in step 1)
    b) Re-enable the servos by setting M0 and M1 enables high

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 22, 2018, 07:52:51 AM
I tried this sequence.

1- I made home aces.

2- moved Z axis halfway.

3- I physically disconnected wire in servo OFF.

4- moved Z axis through Jog (DRO of moving, but Z axis remains physically still).

5- connected wire in servo ON (motor active).

After the sequence 5, nothing happened.

Physical axis and DRO of Mach4 were in two different positions.

Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 22, 2018, 02:39:13 PM
Hi,
cool, that behaves as I expected and this should be pretty straight forward.

May I suggest using a macro like the one I posted yesterday to enable/ disable the servo rather than disconnecting
the wire. I suspect it will work the same but you will need to be able to do it with software. Try it out.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: Penguin on January 22, 2018, 03:49:43 PM
If you disable the drive after homing, the motor will fall back to a full step position. Therefore you have a position error. Would not recommend doing that.
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 22, 2018, 04:32:02 PM
Hi,
then how would you recommend that you manually jog/MDI and Machs DROs keep track and yet have no motor movement?

Clearly there needs to be some code that re-aligns the controlled point in such a manner that the homing again makes
sense before the servos are re-enabled.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 23, 2018, 03:06:13 AM
Hi,
today when I come back from work I try the macros.
can you explain their function to me? because I did not understand well.
do I insert them in the macros folder?
can I do from MDI? I called the macros M210 and M211.
Title: Re: Mach4 Button OFFLINE
Post by: Penguin on January 23, 2018, 10:20:49 AM
Hi,
then how would you recommend that you manually jog/MDI and Machs DROs keep track and yet have no motor movement?

Clearly there needs to be some code that re-aligns the controlled point in such a manner that the homing again makes
sense before the servos are re-enabled.

Craig

I don't have a better suggestions at the moment. Just wanted to point out that if you disable a stepper motor that is operated with microstepping, it will loose its position when disabled.

Martin
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 23, 2018, 02:51:59 PM
Hi,
yes thats true, a stepper could potentially get out of sync by one half of a full step. Do the calculation, how
much is 1/2 step error on your machine?. If the error is large enough to be objectionable then you'll have
to re-reference OR not use OFFLINE, your choice.

Second, the OP is using servos, ie no microstepping.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 23, 2018, 04:12:27 PM
Hi,

Quote
today when I come back from work I try the macros.
can you explain their function to me? because I did not understand well.
do I insert them in the macros folder?
can I do from MDI? I called the macros M210 and M211.

Yes they go in the macros folder of your current profile. Make sure that they go in your current profile....there is
a macro folder for every profile you have...possibly half a dozen or so.

Then you can MDI m210 or m211 as required.

m210 turns off the motor0 enable signal. I'm guessing that your X axis servo enable signal wire is motor0 enable.
m211 turns motor0 enable signal back on.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 23, 2018, 04:37:33 PM
Hi,
Today I loaded macros and called via MDI.
But nothing happened.
Question:
it seems to me that the PIN that needs to be turned on or off is missing in the macro.
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 23, 2018, 05:18:24 PM
Hi,

Quote
mc.OSIG_ENABLE0

That is the output signal in the macro. I can't tell if you have an output pin assigned to that signal. You don't address
a pin in Mach4, you use an API for Machs core to set a signal. You or your motion controller plugin connects that signal
to a pin on your controller.

At the current time from your description you have a wire going to your servo drives to enable the drive. To what pin
is it connected at your controller?  To which of Machs output signals has that pin been connected by the Mach/motion control
plugin? That output signal is the one that should occurr in the macros.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 23, 2018, 05:20:00 PM
Hi,
what motion controller are you using?

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 23, 2018, 05:56:24 PM

My PIN was just a hypothesis, since the macros have no effect.
Use CSMIO / IP-S of CsLab
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 23, 2018, 06:35:47 PM
Hi,
does your CSIMO plugin identify what pin is used to enable the servos?

Unless the OSIG_ENABLE0 is assigned to a pin you wont see if the macros have any effect. You need to find what
Mach output signal is attached to the pin/pins that enable your servos.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 23, 2018, 11:27:01 PM
Hi,
just above you wrote "You don't address a pin in Mach4, you use an API for Machs core to set a signal"
currently I do not have any pins that enable the servos, they are always physically connected to SERVO ON.
just decide on which pin to intervene and I try ..
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 24, 2018, 01:56:28 AM
Hi,
well you are going to have to change that.

Open your CSIMO plugin and assign an available output pin on your controller to Machs output signal Enable#0.

You should now be able to turn that pin on and off using the two macros. Eventually you'll use that pin to enable/disable one of your servo drives.
I dont know what output voltage the CSIMO controller uses, with any sort of lick you may be able to hook it direct to your servo drive. You will have to check
that they are compatible before you do it though.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 24, 2018, 05:36:46 AM
ok, I rehearse and update you. thank you
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 24, 2018, 11:48:37 AM
I did try.
I have configured ENABLE # 0 with PIN1 output
for security I used a relay.
the relay is activated / deactivated simply by pressing ENABLE / DISABLE in Mach4.
the M211 and M210 macros have no effect.
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 24, 2018, 04:05:41 PM
Hi,
thats correct, enabling Mach should cause Enable#0 to go high ie cause the relay to operate.

Try opening the macros and single stepping through them with the debugger. Note m211 should turn Enable#0 off
and m210 should turn it on.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 24, 2018, 05:20:59 PM
what is the debugger??
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 24, 2018, 06:37:38 PM
Hi,
it is a program that runs Lua code, part of the script editor, chapter 2:

http://www.machsupport.com/wp-content/uploads/2014/05/Mach4%20Scripting%20Manual.pdf (http://www.machsupport.com/wp-content/uploads/2014/05/Mach4%20Scripting%20Manual.pdf)

Download it and read it, then read it again, and the read it again for good measure.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 24, 2018, 09:02:07 PM
Hi,
just realised its also in the Mach4 Docs folder, you already have it!

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 25, 2018, 04:03:39 AM
let's try to reason. suppose that macros work. a macro disables Mach4.

when Mach4 is in the DISABLE state, it no longer executes any commands

how can an ENABLE macro run when Mach4 is off ???

Mach4 must always remain active, I just have to disable axes.
is my thought right or wrong?
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 25, 2018, 12:31:25 PM
Hi,
the macros DO NOT disable Mach, they are meant to turn on and off a signal (OSIG_ENABLE0) which is connected to a pin. These macros are just for experimentation
anyway.  If you can't get them to turn a pin on your controller on and off then you'll have no chance to program Mach.

Have you read the chapter about the script editor? Have you opened the scripts and run them? Are the macros in your current profile?

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 26, 2018, 12:54:40 PM
Hi,
I tried, and tried again, but it does not work, the macros have no effect.
I put the M210 and M211 macros here:
C: \ Mach4Hobby \ Profiles \ Mach4Lathe \ Macros
question:
which PIN are the macros for?
do you work?
what controller do you use?
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 26, 2018, 01:03:01 PM
Hi,
yes they work, I'm using my mill profile. Is use an ESS controller but the controller has no bearing on whether the macro runs or not.

The pin is depends on what you assign to Machs output.

Have you run through the macro single step with the debugger?

Craig
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 26, 2018, 01:08:05 PM
Hi,
open the script editor and select m210. Press F5. Now press F11 until the little green arrow is one step past the last statment.
With the cursor hover over hsig. Does the number look reasonable?

Rather than carry on single stepping until you run out of code and crash the debugger at the last 'end' press <shift>F5.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 26, 2018, 01:17:52 PM
Hi,
have just run the macros successfully in Mach4Lathe. I have an LED which indicates ENABLE0 and I can turn it on and off using the macros.

Do you know how to use the screen editor to make an LED? Would be a good idea to make an LED and attach it to ENABLE0.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 26, 2018, 03:06:10 PM
I created a led on the screen of mach4.
It works!
with M211 macro lights up
with macro M210 turns off
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 26, 2018, 03:09:01 PM
Hi,

http://www.machsupport.com/wp-content/uploads/2014/05/Mach4%20Screen%20Editor%20V1.0.pdf (http://www.machsupport.com/wp-content/uploads/2014/05/Mach4%20Screen%20Editor%20V1.0.pdf)

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 26, 2018, 03:13:28 PM
yes yes, I created the LED as you recommended, and it works!
now...
what is the next step?
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 26, 2018, 03:16:14 PM
Hi,
kool. The issue now is to get that output to turn a pin on and off on your controller.

I'm not sure how the CSIMO plugin works but the ESS one goes like this:

1) Nominate an ouput pin, say pin3 port2, and give it an alias (name), say SERVO_ENABLE
2) On the Mach Outputs page scroll down until you find ENABLE#0 and assign pin alias SERVO_ENABLE

Pin3 port2 should now reflect the state of Machs internal signal ENABLE0.

Good luck, your'e getting closer, the first few steps in programming Mach are very tough but get easier and very
satisfying too.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 26, 2018, 03:38:32 PM
ok, in the meantime I thank you so much for your great patience!
time zone, for me it is almost night.
I try tomorrow.
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 26, 2018, 03:43:31 PM
Hi,
mid morning here.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 27, 2018, 10:00:35 AM
Hi,
I have done other tests.
result:
with macros I can only control led created on the screen and nothing else.
CSMIO has no plug-in to input / output, (except for controller-specific settings).
the inputs / outputs are set only by Mach4.
therefore, I can not insert 2 outputs with the same PIN number.
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 27, 2018, 12:04:07 PM
Hi,
the LED on the screen is Machs output signal, ENABLE0

You have to use the CSIMO plugin to connect Machs output to one of the available digital output pins. It can be done. Its absolutely basic to any
CNC controller that you can turn a pin on and off.

You are correct you cannot assign two outputs to one pin, but that is no what you a re trying to do here. We have two macros one to turn ENABLE0 off
and the other to turn ENABLE0 on, just the one output.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 27, 2018, 01:11:42 PM
Hi,
downloaded CSIMO manual for your controller, plenty about setting it up with Mach3 but nothing about Mach4.

CS Labs claim this is Mach4 ready so make them provide the documentation and support necessary. CS labs have been in the Mach4 market
for only a few months, clearly they are not as ready as they think they are.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 27, 2018, 06:43:32 PM
if in Mach4, configure ENABLE # 0 on the Pin1 output, to which the relay is connected.
The relay opens / closes only when in Mach4 it changes from Enable / Disable.
the M210 and M211 macros are ignored and have no effect on the relay.
At CS Lab they are creating their "simCNC" control software (a few words for an essay) is already downloadable trial version.
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 27, 2018, 11:59:12 PM
Hi,
you say that when you enable /disable Mach ENABLE#0 changes state and the relay you've hooked to pin 1 operates.

The macros m210 and m211 turn ENABLE#0 on and off, it should therefore change your relay as well.

If it doesn't then its not ENABLE#0 which the enable/disable button of Mach operates. Can you post a screen shot of the Mach output setup page and a screen shot of the
CSIMO plugin page of pin assignments?

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 28, 2018, 02:31:24 AM
Hi,
in the cslab plugin, there are no settings for ports and pins!
with CSMIO, the settings are done ONLY by Mach4.
In the cslab plugin, you can only create special settings related to the CSMIO hardware and its modules (ENC, MPG, etc. Etc.).
possible solution.
it is necessary to reflect ENABLE # 0 on another parallel pin, so it is necessary to make small changes to the macros, adding another output pin.
I will run the servo enable with the second pin via the relay.
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 28, 2018, 02:49:26 AM
Hi,
that sounds pretty rubbishy....you can't assign an output pin to a Mach signal?

There must be a way of having Mach control the digital output pins. If it can't throw it out as rubbish.

If you cannot have Mach run some code and have that code switch output pins on and off or respond to an input its not a controller.
Try Configure/Mach/Output  find ENABLE0 and try to assign it to one of the available output pins of your controller. I can do this with
my eyes closed with my Ethernet Smooth Stepper, you MUST be able to do something similar. Ask CS Labs....they sold it...they should help
you to get it to work.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 28, 2018, 03:24:42 AM
Hi,
reading in the CS Labs section of the forum a few people have had trouble with getting these things to run with Mach4.

http://www.machsupport.com/forum/index.php/topic,35289.0.html (http://www.machsupport.com/forum/index.php/topic,35289.0.html)

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 28, 2018, 03:34:28 AM
in fact they do not work.
I also have poblemi with basic functions, such as the SINGLE BLOCK.
I have already warned of the various problems related to their plugin,
they replied, they are working to resolve.
Given the current situation, I recommend:
I do not want to take advantage of your great kindness and availability (of which I thank you so much).
so, for the moment, I would suspend the topic.
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 28, 2018, 03:40:32 AM
Hi,
how long have you had the device? If it doesn't work make them take it back and give you your money back. You can buy an ESS for
half what they want and it works.....having electronic devices that work are very handy for CNC!

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 28, 2018, 03:46:49 AM
I have had CSMIO for about 1 year.
with Mach3 everything works fine.
but I bought Mach4 license for evolution, and also because I like it a lot.
but if it does not work, I'll have to find a solution, or change software, I have no alternative.
I try to wait a little longer, then I will make a decision!
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 28, 2018, 03:59:05 AM
Hi,
I would be leaning on CS Labs....they are the ones advertising that their device is Mach4 ready and its not.

Tell them to fix it or give your money back. You might remind them that as a member of the forum that you are in a position to tell a wide
audience that their device does not work and/or that they are not prepared to help you.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 28, 2018, 04:13:35 AM
absolutely no! they are very kind and helpful!
then I absolutely do not want to escapist possibility that I am unable to configure optimally!
in my opinion, there is only to be a bit of patience, and solve the problems, I find a serious company.
Rather..
I open only little off topic.
on the pantograph it has the SSE + C25.
I wanted to try out of curiosity Mach4.
I found myself faced with this problem.
I attach link video dropbox.
https://www.dropbox.com/s/zjhvt4z03yovjsn/20171102_090430.mp4?dl=0
sorry for in, bad english ..! i'm italian :-)
can you indicate me where to look for a pantograph solution?
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 28, 2018, 04:43:30 AM
Hi,
well if I had spent that sort of money and it didn't do what the company claimed I would be hammering them for a solution.....that's a plain rip-off.
That however is your call.

If you want to run Mach4 I suggest CS Labs offering is too immature. I have no reason to doubt that they will get there in the end and they have a good
reputation in the Mach3 market but it sounds like their Mach4 stuff is s*********t.  CNCDrive, another European manufacturer also with a good reputation in the
Mach3 market but has only been in the Mach4 market a few months. I wouldn't go there either....I want something that works from the very start.

https://warp9td.com/ (https://warp9td.com/)
https://www.poscope.com/ (https://www.poscope.com/)
https://www.pmdx.com/ (https://www.pmdx.com/)
http://www.vitalsystem.com/portal/index.php (http://www.vitalsystem.com/portal/index.php)

All of these companies have been making and selling Mach4 stuff for quite a while. That's where I'd be going.

I've watched your video but not quite sure what you are trying to show me. If its the fact that the machine cant jog two axes at once that's because they can't.
To do that requires coordinated motion ie Gcode or Gcode as MDI.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 28, 2018, 05:12:35 AM
you understood and responded to my hopes on the Jog.

"If its the fact that the machine cant jog two axes at once that's because they can't."

for the CSMIO, I'm sure that soon they solve problems.
I thank you very much again! you are very kind person!
when I have news, I update the post!
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 30, 2018, 03:21:43 AM
Hi,
I was thinking... what do you think about using the physical switch to disable the servos?
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 30, 2018, 03:41:34 AM
Hi,
yes that would work. Really that's what we were doing....using Mach and your controller to disable your servos.

Your project was to have a button on screen, rather like the one you're familiar with in Mach3, and when you hit it the servos would stop but Mach would carry on.
When you hit the button again Mach would reinstate the servos ensuring that the machine coordinates were consistent. Actually fairly simple.
We've hit a roadblock where we can't get your controller to produce an output. You could do it with a switch but its hardly called CNC when do have to do it by
hand.

To be honest the folks at CS Labs have been in the CNC business for a long while. The prospect that they released a device onto the market which could not
produce an output on a given pin from a Mach output signal is remote.

I think it more likely you have not yet understood how to set up your controller. I downloaded the plugin but without the device for my computer to talk to
I can't get the plugin to run and cannot therefore provide any help. Do the company have any videos? And not Mach3 videos.....we know they do Mach3 really
well but we need to know how to deal with the Mach4 plugin.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 30, 2018, 04:08:25 AM
it is very probable that I do not know how to do it.
I try to create a button on the screen and assign an output.

Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 30, 2018, 04:09:17 AM
Hi,
I think I know how its done.

Do you have the CSIMO device installed? Is it the current motion device? I assume it is otherwise your machine would not run at all.

Open Mach. Go to Configure/Mach/Output Signals and scan down to ENABLE#0.
Check (green tick) Mapping Enabled. Put the cursor in the Device column and left click. If your CSIMO device is enabled it will occur in the drop down list.
Note in the screenshot attached my Device is ESS, outlined in red.
In the next column Output Name is the name of the pin. Again with the cursor in the column leftclick and a drop down list of the available output pins
should show. The ESS uses ports and pins to designate its individual pins, outlined I blue in the screenshot. You'll have to make a guess as to which pin you've hooked your relay.

Hit <apply>. You'll probably have to shut Mach down and restart it to have the change take effect.

Let us know how you get on.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 30, 2018, 07:02:13 AM
yes, yes, I had done that! only difference is that CSMIO has no port numbers, but only PIN. In my case it was PIN 1.
The relay connected to output1.
The relay is activated / deactivated only by Mach4 with enable / disable.
the m210 and m211 macros had no effect on output1.

on the CNC Italy forum I found this macro, can it be useful?
I attach the file.
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 30, 2018, 07:18:12 AM
maybe I understand how to do it, I create the on / off button on the screen where I activate the pin1 output.
update as soon as possible!
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 30, 2018, 09:23:22 AM
Hi,
post a screenshot of the Mach/Output Signal ENABLE#0 entry please.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 30, 2018, 03:19:50 PM
I only managed this way, but it works !!
Copy / paste the MIST M07 button and rename it.
when I press it I turn on / off the relay, so the servos go into ON / OFF mode.
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 30, 2018, 04:29:34 PM
Hi,
kool, good work.

Need to work on the logic now. Suggest the the button toggle, that is you hit the button and the servos disable,
hit it again and they enable.

Can you post the code behind the button?

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 30, 2018, 04:50:05 PM
Hi,
I simply copied and renamed the button you see in the image (copy button) and then entered in the main screen (the first image of the screen that I attached)
the internal logic of the button does not know it, in any case it is the original one of Mach4.
The current behavior of the "SERVO ON / OFF" button is this:
you press and the relay remains active.
press again the relay is deactivated.

P.S How is the quality of translation from Italian to English?
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 30, 2018, 05:25:18 PM
Hi,
translation is OK.

Internal to Mach there is code attached to that button. You are going to have to find it. Eventually you will
modify it to do what you want.

Go to the screen editor, click the desired object, in this case a button, veiw the events associated with the button,
open the event script and copy it. Please post the copy.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 30, 2018, 05:31:46 PM
Hi,
you say that the button has its original script? But the original button is Mist Coolant.

I think the macros work but you have a relay attached to the Mist output not EANBLE#0 at all!

I need a screenshot of Machs Output Signals page, in particular the ENABLE#0  entry.

I also need to see what events are ascribed to the button and the event script/function.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 30, 2018, 05:45:17 PM
yes, it's connected to the Mist.
Through ENABLE # 0 I could not control the relay ..!
Output1 is only activated / deactivated only with ENABLE / DISABLE in Mach4 and nothing else!
I did a lot of tests, but without result!

now they are no longer in front of the lathe.
when I was testing with ENABLE # 0, the screen was the same as yours, the only difference is that yours also has a port number.
my plugin only the pin number.
only difference is only in that.
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 30, 2018, 05:54:50 PM
Hi,
please post a screenshot.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 30, 2018, 05:58:58 PM
ok tomorrow I will provide.
but current, or with ENABLE # 0  ??
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 30, 2018, 06:33:17 PM
Hi,
all of them.

I'm beginning to think that CISMO can't handle OSIG_ENABLE0.

There are about 180 output signals defined in Mach but I'm thinking that a subset of those only is recognised
by the CSIMO device. Can you put an email to the company to get a definitive answer about which signals,
both input and output, that their device will recognise.

If I'm correct it make me wonder if the CISMO device is the correct controller to be trying to learn how to
program Mach4. I assure you that Mach4 and Lua are entirely hard enough without adding limitations
imposed by  controller shortcomings.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 31, 2018, 03:40:05 AM
Hi,
If you tell me which question to ask exactly, I will provide you.
It is not easy to understand for a person who does not know the thread of the speech, so it is necessary to ask a specific question.
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on January 31, 2018, 04:09:59 AM
Hi,
we need to know if there are any restrictions on the range of Mach4s input and output signals that are recognized by their device.

In particular why is OSIG_ENABLE0 not able to be attached to an output pin.

I still want to see a screenshot of Machs Output Signals page. I have asked you four or five times for a screenshot....it gets pretty tedious having to ask repeatedly.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on January 31, 2018, 04:18:02 AM
Hi,
yes, you're right, I'm sorry.
as soon as possible I make screenschot.
Title: Re: Mach4 Button OFFLINE
Post by: Fledermaus on January 31, 2018, 07:17:00 AM
I use a CSMIO/IP-A and experience no problem in attaching any listed signal to a chosen I/O pin. CS Labs do not appear to impose any undue restrictions on this.

 OSIG_ENABLEx are normally used to enable drives and there is no problem assigning output pins via Mach4's Output Signals configuration.

OSIG_ENABLE0 is normally generated by the core, so it is debatable whether users should be directly programming it.

Allan
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on February 01, 2018, 02:47:54 AM
Hi,
I have the screenshot, with this configuration the relay turns on and off ONLY when I press ENABLE / DISABLE in Mach4.
The m210 and m211 macros have no effect on the relay.
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on February 01, 2018, 03:05:01 AM
Hi,
that looks right. Just try scanning the complete Output Signals page just to make sure that no other output signal has been attached to the
same pin.

Also would you copy and post one of the macros, m210 say. Mainly to check that I have programmed it right, although it works here.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on February 01, 2018, 03:24:41 AM
CSMIO does not allow you to use the same PIN twice.
When a PIN number is assigned, it disappears from the list.

function m210()
local inst=mc.mcGetInstance()
local hsig,rc=mc.mcSignalGetHandle(inst,mc.OSIG_ENABLE0)
mc.mcSignalSetState(hsig,0)
end
if (mc.mcInEditor()==1) then
    m210()
end
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on February 01, 2018, 04:22:36 AM
Hi,
well that looks alright too.

Further you have an on screen LED to reflect OSIG_ENABLE0 and the LED worked...didn't it? So the macros work in Mach but can't be communicated to
the controller.

Despite what Allan says I don' think the controller recognizes OSIG_ENABLE0. If you're reading this Allan would you be kind enough to
test whether indeed the CSMIO device can recognize OSIG_ENABLE0.

In the mean time we'll have to try something else.

May I suggest using OSIG_OUTPUT10....surely the CSMIO device will recognize user output. Remove OSIG_ENABLE0 from the macros
and substitute OSIG_OUTPUT10. Now on Machs Output Signals page disable Enable#0 and enable Output#10 and attach CSMIO's Out.1

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on February 01, 2018, 04:41:31 AM
OK done.
with this your last solution WORKS !!!!!
m210 and m211 macros WORK !!!
P.S. YES the led connected to ENABLE # 0 has worked.
The use of the macro only had a visual effect, the relay did not work.
you are a great .. !!
now..?
what will be the next step?
I think it will be necessary to memorize the position of the DRO axes on Mach4?
Title: Re: Mach4 Button OFFLINE
Post by: Fledermaus on February 01, 2018, 05:33:43 AM
Craig

Of course CSMIO recognises OSIG_ENABLE0 - I use it to enable Motor 0. I think the issue you were having may be a conflict with the core, as the signal was changing in response to Enable/Disable, as it normally does.

Though Mach's LED reacted in response to OSIG_ENABLE0, it would have been interesting to know if the LED on the CSMIO itself also reacted, proving that the command was reaching the controller.

Though the CSMIO is not perfect, it performs very solidly on the basic functions such as I/O.
Allan
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on February 01, 2018, 05:34:49 AM
Hi,
that's good news. There are still some unanswered questions.....why does the controller not recognize OSIG_ENABLE0.
Are there other Mach output signals that it will not recognize?
Is there similar limitations on input signals?

These are fundamental questions which will occur again and again when programming Mach. If you can't answer them or get an answer for them
you will waste a lot of time in the future.

As to the rest of the code:
Button Event- if the servos are enabled, disable them and remember the machine coordinates of the current position
                     if the servos are disabled calculate a G53 move which will restore the machine to the machine coordinates prior to being disabled and then re-enable the servos.

You will need to set up a folder where you can write and debug code without putting it in the screen load script and potentially screw Mach up while you mess around.
In your profile folder make a new folder OfflineButton. This is where you will put your code and work on it.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on February 01, 2018, 05:44:07 AM
Hi,
the evidence is that the device does not connect OSIG_ENABLE0 to an output pin. The last twenty or more posts in this thread have been about this very issue.
Given that its not my device I can't email the manufacturer and ask WTF?

If you can see what OP is doing wrong by all means.....

In the mean time would you be kind enough to attempt to attach OSIG_ENABLE0 to a spare output pin on your controller and see if you can get it to work?
I tried every thing I can think of, at least from the other side of the world, and I've given up, I think the controller or its plugin is faulty.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on February 01, 2018, 05:48:45 AM
Yes @joeaverage , it's exactly the behavior I want!!
you understood perfectly!!!
now I have to go to work, but I will follow the developments and update as soon as possible.
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on February 01, 2018, 05:54:06 AM
P.S OSIG_ENABLE0 activates / deactivates the relay via ENABLE / DISABLE in Mach4.
and nothing else!
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on February 01, 2018, 06:09:23 AM
Hi,
not quite correct, yes Mach both sets and resets the Enable signals but you can using the API turn them on and off.....you've already proven that by having an
on screen LED. Indeed that's why I wanted to use that particular signal, Mach will still be able to set/reset AND you will be able to specifically set/reset as well.

The problem we've had is that we cant connect that to a pin on the controller. I can with the ESS.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on February 01, 2018, 06:18:48 AM
I have done so many tests that I am now confused ..
I will try (if I can do it) to assign the output to the LED.
speaking different language, for me it's all much more difficult to understand.
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on February 01, 2018, 06:39:15 AM
Hi,
I wouldn't worry about it, we trying to use a workaround anyway.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on February 01, 2018, 06:41:52 AM
let me try again.
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on February 02, 2018, 01:46:02 AM
Hi,
I tried again ...
negative result ... it is always the same.
with ENABLE # 0 I can only switch on / off the LED on the screen, without affecting the relay.
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on February 02, 2018, 02:16:46 AM
Hi,
I think its worth getting some insight into this behavior from CS Labs. I/O is absolutely fundamental to any CNC program.
Understanding exactly how your software and hardware interact is required to achieve any worthwhile result.

With the ESS I can turn a pin (port 1 pin 1) on and off by operating the Enable/Disable button of Mach OR by running the macros. This is what I'm hoping that you
can get your controller to do.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on February 02, 2018, 02:41:45 AM
Hi,
with the transition to the macro tested yesterday, the relay works.
I would say to continue on that road .. what do you think?
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on February 02, 2018, 03:00:28 AM
Hi,
yes, that's the way to proceed. May complicate the logic a bit but we should be able to get something to work whereas if we try to carry on with
OSIG_ENABLE0 we are going to get nowhere.

I would still ask CS labs about it, you need to know how and why even if you can work around it at the moment.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on February 02, 2018, 03:22:36 AM
if you want to try to ask CSLAB, explain that you are helping a friend who owns CSMIO. (They are very available, I give you the certainty !, Not very quick in the answers, (will have many open questions).
not a question of my laziness.
the reason is that you could ask correct and targeted questions.
If you speak English correctly, the questions are clear.
with a translator, I never have the security of being able to make myself understood.
in this way, you can work with safe bases, so less time is wasted.
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on February 02, 2018, 05:21:29 AM
I sincerely ask myself why this OFFLINE function has not already been integrated into Mach4 (as it was in Mach3).
I consider it an indispensable function for security reasons!
machine tools are not video games! a trivial error can be very expensive, both in terms of damage to the machine itself and to the operator!
by programming on the machine, manually, you must be clear that you have not made mistakes!
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on February 02, 2018, 06:24:02 AM
Hi,
Mach4 IS NOT Mach3 and never will be. Mach3 had hundreds of little cheats and work-arounds that it became a nightmare to maintain or develop.
The 'Offline' button is an example. I know you have become used to it in Mach3 and believe it is therefore universal in the world of CNC....its not.
Every controller manufacturer has their own interpretation of it, all claim that theirs is the 'only correct way' to do it. There is no such thing as the
'only correct way'.

Mach4s strength is that it is very flexible, you can program it to behave much like Mach3 or maybe even identically, or any other way that seems right to you.
The real market for Mach4 is OEM manufacturers, they have a piece of software that they can adapt to their machine, it might be simple like a lathe
but it might also be a multiaxis grinder or 5 axis wire EDM or a 12 axis Swiss lathe or....the list goes on.

The challenge for you is to learn how to program Mach4 to behave the way you want. You can whinge and moan that it should all be done for you but its not
and NFS has no interest in doing it for you, if you can't be bothered to learn why should they be bothered to help?

This is a preliminary sketch of the code. Note that I have written it as a function so that I can use the debugger. When in service this code will
be in the screenload script and attached as an event script for your button.

Code: [Select]
function OfflineButton()
local inst=mc.mcGetInstance()
local hsigenable=mc.mcSignalGetHandle(inst,mc.OSIG_ENABLE0)
local hsigbuttonstate=mc.mcSignalGetHandle(inst,mc.OSIG_OUTPUT2)
if (mc.mcSignalGetState(hsigenable)==1) then
    if (mc.mcSignalGetState(hsigbuttonstate)==1) then
        -- Mach is enabled and the servos are 'online'
        -- Need to save current position and set servos 'offline'
        local Xpos=mc.mcAxisGetMachinePos(inst,mc.X_AXIS)
        local Zpos=mc.mcAxisGetMachinePos(inst,mc.Z_AXIS)
        mc.mcCntlSetPoundVar(inst,500,Xpos)
        mc.mcCntlSetPoundVar(inst,501,Zpos)
        mc.mcSignalSetState(hsigbuttonstate,0)
    else
        --Mach enabled but servos 'offline'
        --Need to restore current position and reset servos 'online'
        local Xpos=mc.mcCntlGetPoundVar(inst,500)
        local Zpos=mc.mcCntlGetPoundVar(inst,501)
        mc.mcCntlGcodeExecuteWait(inst,'g53 g0 x'..Xpos..' z'..Zpos)
        mc.mcSignalSetState(hsigbuttonstate,1)
    end
else
    --Mach disabled....do nothing
end
end
if ( mc.mcInEditor()==1) then
    OfflineButton()
end
You may recall right at the beginning of this thread I said this would be easy. If you have a look at the code it is. Twenty lines of code.
The only real difficulty we've encountered is that the CSMIO device has a quirk I don't understand. Without that quirk it would be simpler still.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on February 02, 2018, 06:29:07 AM
Hi,
just noticed I used OSIG_OUTPUT2 because my screenset already has an LED for Output#2. Substitute whatever output seem good to you.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on February 02, 2018, 06:57:23 AM
thank you!!!! thank you!!!! thank you!!!!
because of the time, I can not test now.
Do I have to create a button on the screen, and enter this code you wrote?
as an image that I have attached?
Title: Re: Mach4 Button OFFLINE
Post by: Fledermaus on February 02, 2018, 09:49:52 AM
Craig

Sorry for the delay in responding.

I created a pair of simple macros to set and reset  OSIG_ENABLE0 and ran them manually from the MDI window of the Diagnostics tab. They had no effect on the Enable0 LED on that screen. I then changed the macros to control   OSIG_OUTPUT0 and this time the related LED reacted accordingly.

It does appear that Mach4 keeps a tight control over the motor enable  signals which are fundamental to machine control. I was using the simulator on my office PC, so it appears that the op's CSMIO is performing in the expected manner and it is your system that is behaving differently.

Personally, I just test my Gcode programs using the simulator in the office, and have never found a discrepancy between this and my CSMIO system.

Allan
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on February 02, 2018, 11:08:27 AM

you were very kind to answer. at least now I confirm that it is not possible to use ENABLE # 0 with CSMIO
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on February 02, 2018, 02:42:34 PM
Hi Allan,
thanks for taking the time to test this out.

I have two macros, m210 and m211, one to turn OSIG_ENABLE0 on and the other to turn it off. On my laptop I have an LED on
the screen to reflect the state of the output and it responds as I expect.

On my machine I attached an output pin of my ESS to OSIG_ENABLE0 and the output pin turns on and off as expected.

You are quite correct Mach influences control over the Enable#.... signals. When Mach is enabled the Enable#... signals go active and when Mach is disabled
they are reset. For the purpose of an 'Offline' button for the OP I wished to add to that functionality, namely be able to programmatically turn the Enable#....
signals on and off. Your investigations suggest that you cant control OSIG_ENABLE0 it that manner. I disagree, I can and do control the output as I've described
and I can and have attached the output signal to a pin on my controller.

There are two issues:
1) Why can't you cause an Enable#... to change state when I can?
2) Why can't the CSMIO device attach an output pin to Enable#0?

To OP:
no, you don't have to attach the code to a button yet. It is a stand-alone function that can be single stepped through with the debugger to test it out.
It was running as expected last night. Try running the function in the debugger. Note at the end rather than step the debugger right through the last
'end' statement and crash the debugger go <shift f5> which causes the debug session to end without crashing it.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: Fledermaus on February 02, 2018, 04:14:29 PM
Craig

I have had another look at this on my office PC using SIM. The plot thickens:

If I run the macros from the debugger, the M0 Enable LED does indeed respond to the macros, as you have observed. If, on the other hand, I execute the macros from the MDI window, there is no response. Make of that what you will.

I will try to remember to go out and run this on the CSMIO over the weekend, just for the sake of completeness.

I think you are incorrect in asserting that output pins cannot be arbitrarily assigned by the CSMIO. I have never seen evidence of this.

Allan
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on February 02, 2018, 04:22:35 PM
Hi Allan,
Quote
I think you are incorrect in asserting that output pins cannot be arbitrarily assigned by the CSMIO. I have never seen evidence of this.
I hope you are right but I cant think of any other reason which would prevent OP from attaching an output pin to a legit Mach signal.
I don't have a CSMIO device and they're not cheap so I won't be getting one any time soon so I can't test it myself.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on February 03, 2018, 02:13:19 AM
Hi,
if your happy with the way the function operates then by all means attach it to your button.

To do that just copy the code EXCEPT for the last:
if (mc.mcInEditor()==1)  then
        OfflineButton()
end

and copy it into the screen load script. Put the function name in the left-up script for your button and your done.

You could put a few statements in the code that provide status messages but they don't affect how it works.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on February 03, 2018, 03:50:17 AM
Hi,
nothing works for me ...
Surely I'm wrong to do something.
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on February 03, 2018, 04:59:11 AM
Hi,
runs fine here.

Have you tried running through the debugger in the editor? Remember that's why I set it up this way so that you could use the editor.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on February 03, 2018, 05:17:58 AM
.
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on February 03, 2018, 05:30:13 AM
Hi,
did you single step through it?

Craig
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on February 03, 2018, 05:40:55 AM
Hi,
do you have the function in a separate folder as I recommended? The screenshot you posted looks like an event script...in which case I doubt you'll be able to
single step through the code.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on February 03, 2018, 05:56:46 AM
I forgot about the folder!
as soon as I can I try again.
is everything good for you?

is asking too much trouble for a video of how to do it?

Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on February 03, 2018, 06:12:52 AM
Hi,

Quote
You will need to set up a folder where you can write and debug code without putting it in the screen load script and potentially screw Mach up while you mess around.
In your profile folder make a new folder OfflineButton. This is where you will put your code and work on it.

This was an instruction to make it easy for you to write/edit and debug the code. What you did instead was go direct to attaching the code to your button which
all but precludes you from testing it. You are trying to run before you can walk.

Once again: set up a folder in your profile that will contain the function. Put the function complete in the folder. Open the editor and browse to the folder and open
the contents in the editor. Run in single step mode, <f5> and <f11> repeating. At the last end statement press <shift f5> rather than crash the editor.
If you are going to program Mach you absolutely need to be able to use the editor and all its functions. I certainly wont be there to hold your hand! Put the code
in a folder and use the editor until you are 100% with it, no excuses!

Craig
Title: Re: Mach4 Button OFFLINE
Post by: Fledermaus on February 03, 2018, 11:13:31 AM
Craig

OK. I tested the macros on my CSMIO system.

 I started Mach4, left it disabled, and opened m201 in the debugger. Running the code, the M0 Enable LED turned on, and I could tell from the locking of the X axis motor that the CSMIO output had also been activated. So far so good. Next I ran m200 in the debugger. the M0 Enable LED turned off as expected, but contrary to my expectations the CSMIO output remained active, i.e. the X axis motor was still energised.

Pressing Enable/Disable caused the motor to lock and unlock, as expected.  I then ran the m201 macro again in the debugger,  This time the M0 Enable LED came on, but the CSMIO output did not, i.e. the motor remained unenergised. Enabling Mach4 and running the m200 macro in the debugger similarly produced no response from the CSMIO, i.e. in this scenario the M0 Enable LED turned off but the motor remained energised.

Finally I enabled Mach4 and ran the 2 macros from the MDI window. Neither had any effect, either on the LED or on the motor itself.

Though the results do not entirely echo those using the simulator, the overall conclusion remains that the Enable outputs cannot be programmatically changed using  API calls from user scripts. Your current approach ingvolving a second output and external logic would therefore seem to be the way ahead if this type of functionality is needed.

Note that my system does not exactly  echo that of the op. I have the CSMIO/IP-A with the latest v3.08 (beta) plugin. I couldn't do what the op hopes to achieve,  even if I wanted to, as the IP-A is closed loop and so would ssurely generate a PID error as soon as the motor position failed to match that expected by Mach.

Allan
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on February 03, 2018, 01:44:32 PM
Hi Allan,
superb testing. Clearly Mach/CSMIO regard the Enable# signals as private and it is not reliable to programmatically set/rest them. Even stranger that
the CSMIO from time to time ignores the state of the signal.

I will double check with my machine but yesterday I had it working as I expected. Enable#0 turned on when Mach was enabled but could also be turned on and
off with macros and the state of the signal is reflected in the state of the output pin of my ESS/BoB combination. I was doing the testing I a hurry and
may therefore have overlooked some facet of its behavior.

In the mean time I have got some code using the second signal approach for Dany to run. It need some refinements like status messages and I think the
button should blink when 'Offline' is active but it works as is. He needs to work through the code so he knows how it works and also to use the editor/debug
functions.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on February 03, 2018, 02:13:10 PM
Hi,
for reasons of time, unfortunately for a few days I can not test.
I will update you as soon as possible.
P.S.  I Never disable the units.
through the relay I will use a function, of which the units ignore any signal. (they still remain in position, without moving)
when the function changes state, normal use of the drives is restored.
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on February 03, 2018, 02:26:57 PM
Hi,

Quote
through the relay I will use a function, of which the units ignore any signal. (they still remain in position, without moving)
when the function changes state, normal use of the drives is restored

Isn't that what they are supposed to do? The trick is that when you restore the servos (so that they again respond to movement signals) is that while
they were disabled you may have jogged or MDI'ed Mach so Mach believes the servos are in one place when in fact they are where they were left
some time ago. Ergo the 'restore machine coordinate' instructions in the code.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on February 03, 2018, 02:55:44 PM
it's exactly like you just said.
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on February 03, 2018, 06:31:41 PM
Hi,
have been doing some testing and the function works as anticipated under some circumstances but not others.

If you go 'offline' and jog or MDI when you go 'online' the machine coordinates reset to that they were prior to going offline. As anticipated.

Where it fails is if some Gcode from a Gcode job is executed between going offline and then later going back online the servos reinstate
but the machine coordinates do not (always) update.

Quote
rc = mc.mcCntlGcodeExecute(
      number mInst,
      string commands)

But the notes say:
Quote
Notes:


If the control is in the idle state, this function will execute the G code in MDI mode.


I can report that if the control is not idle when this statement is executed then you will crash.

There needs to be a test in the code that prevents the statement from running if the control is not in idle state. That's easy enough but there is a further complication
that I can't solve yet.

The return codes for this API are:
Quote
Returns: Return Code Description
MERROR_NOERROR No Error.
MERROR_INVALID_INSTANCE The mInst parameter was out of range.
MERROR_NOT_NOW The operation could not be completed at this time.
MERROR_NOT_COMPILED The macro scripts could not be compiled.

If have found that if a Gcode file is loaded but stopped (control idle) the API will not execute and comes back with a return code of -18 which corresponds to
MERROR_NOT_NOW

I don't know why this should be. I suspect that the GcodeExecuteWait() API requires MDI functionality but the loaded Gcode is already hogging the Gcode
interpreter so the MDI can't run. I feel a call being put out to Daz and Smurph about this!

Craig
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on February 04, 2018, 02:58:52 AM
Hi,
OK I've got a solution that has improved the function a lot.

Code: [Select]
function OfflineButton()
local inst=mc.mcGetInstance()
local hsigenable=mc.mcSignalGetHandle(inst,mc.OSIG_ENABLE0)
local hsigbuttonstate=mc.mcSignalGetHandle(inst,mc.OSIG_OUTPUT2)
if (mc.mcSignalGetState(hsigenable)==1) then
    if (mc.mcSignalGetState(hsigbuttonstate)==1) then
        -- Mach is enabled and the servos are 'online'
        -- Need to save current position and set servos 'offline'
        local state=mc.mcCntlGetState(inst)
        if (state ~=0)then
            mc.mcCntlCycleStop(inst)
        end
        local Xpos=mc.mcAxisGetMachinePos(inst,mc.X_AXIS)
        local Zpos=mc.mcAxisGetMachinePos(inst,mc.Z_AXIS)
        mc.mcCntlSetPoundVar(inst,500,Xpos)
        mc.mcCntlSetPoundVar(inst,501,Zpos)
        mc.mcSignalSetState(hsigbuttonstate,0)
    else
        --Mach enabled but servos 'offline'
        --Need to restore current position and reset servos 'online'
        local state=mc.mcCntlGetState(inst)
        if (state ~=0)then
            mc.mcCntlCycleStop(inst)
        end
        local Xpos=mc.mcCntlGetPoundVar(inst,500)
        local Zpos=mc.mcCntlGetPoundVar(inst,501)     
        local rc=mc.mcCntlGcodeExecuteWait(inst,'g53 g0 x'..Xpos..' z'..Zpos)
        if (rc ~=0) then
                mc.mcCntlEnable(inst,0)
                mc.mcCntlEnable(inst,1)
                rc=mc.mcCntlGcodeExecuteWait(inst,'g53 g0 x'..Xpos..' z'..Zpos)
        end
        if (rc==0) then mc.mcSignalSetState(hsigbuttonstate,1) end
    end
else
    --Mach disabled....do nothing
end
end
if ( mc.mcInEditor()==1) then
    OfflineButton()
end

Note Dany this is the complete fuction code intended to be put in a folder that you may use your new found editor/debug skills!
Once youv've got it running to your satisfaction then strip off the last mc.mcInEditor test lines at the end ans put the remainder in the screen load script.
Note also that I think you have attached the function as 'clicked button' script which is not correct. Attach the function as 'Left up' script.

The changes over my original code all relate to the function performing when using Gcode files. You will note that this group of lines occur in two different
places. It purpose is to test if the controller is at idle before you attempt any thing else. If you do attempt to do something with the control state other than
idle will crash Mach.

        local state=mc.mcCntlGetState(inst)
        if (state ~=0)then                -- state==0 measns control state=idle
            mc.mcCntlCycleStop(inst)  -- A CycleStop will ensure the control state is idle
        end

The second change relates to the difficulty I note and posted in my previous post in this thread. The issue is that if you have a Gcode job loaded and running, even with
the job stopped or EVEN closed, the Gcode interpreter is unavailable to accept a fresh MDI command embedded in the GcodeExecuteWait() API call. The only way I could
find which would ensure that the Gcode interpreter was ready to accept a fresh MDI command was to disable and then enable Mach. This cycle in addition to freeing
the interpreter of code allows the Gcode job as loaded is preserved at its correct line number. I am a little unsure how it handles modals yet but it seems to work on
my laptop.

        local rc=mc.mcCntlGcodeExecuteWait(inst,'g53 g0 x'..Xpos..' z'..Zpos)
        if (rc ~=0) then
                mc.mcCntlEnable(inst,0)
                mc.mcCntlEnable(inst,1)
                rc=mc.mcCntlGcodeExecuteWait(inst,'g53 g0 x'..Xpos..' z'..Zpos)
        end
        if (rc==0) then mc.mcSignalSetState(hsigbuttonstate,1) end

The code works this way: the GcodeExecuteWait() API is attempted. If the return code is zero then the call succeeded. If the call failed the return code will be other than
zero. The two CntlEnable() calls first disable Mach and then enable Mach again. The GcodeExexcuteWait() call should now succeed. If it does as evidenced by a return
code of zero then  OSIG_OUTPUT2 can be set to reinstate the servos.

Still not quite sure why with the control state at idle the GcodeExecuteWait() API wont progress...that's subject to further investigation and another thread. In the mean
time this should go close to what Dany has wanted from the start.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on February 04, 2018, 05:59:39 PM
Hi,
Thanks so much!!!!
I ask for patience, for a short time I have no way of doing tests.
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on February 04, 2018, 06:20:12 PM
Hi Dany,
I was doing some testing this morning, most of it going really well but on occassion it would fail, I'd have
to hit the button a second time to get the servos to re-engage. Haven't sorted out why yet but am thinking about
it. I may have a workaround solution for it yet. Hoping to get some more insight into the workings of Machs
Idle state.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on February 06, 2018, 03:57:32 AM
Hi Dany,
have tightened up on the code. Have included a loop that retries the GcodeExecuteWait() call to a maximum of five times. My testing has shown that its now
reasonably robust. Its time for you to put it into action and see how it performs in the real world.

Code: [Select]
function OfflineButton()
local inst=mc.mcGetInstance()
local hsigenable=mc.mcSignalGetHandle(inst,mc.OSIG_ENABLE0)
local hsigbuttonstate=mc.mcSignalGetHandle(inst,mc.OSIG_OUTPUT2)
if (mc.mcCntlGetState(inst) ~=0)then mc.mcCntlCycleStop(inst)end
if (mc.mcSignalGetState(hsigenable)==1) then
    if (mc.mcSignalGetState(hsigbuttonstate)==1) then
        -- Mach is enabled and the servos are 'online'
        -- Need to save current position and set servos 'offline'
        local Xpos=mc.mcAxisGetMachinePos(inst,mc.X_AXIS)
        local Zpos=mc.mcAxisGetMachinePos(inst,mc.Z_AXIS)
        mc.mcCntlSetPoundVar(inst,500,Xpos)
        mc.mcCntlSetPoundVar(inst,501,Zpos)
        mc.mcSignalSetState(hsigbuttonstate,0)
    else
        --Mach enabled but servos 'offline'
        --Need to restore current position and reset servos 'online'
        local Xpos=mc.mcCntlGetPoundVar(inst,500)
        local Zpos=mc.mcCntlGetPoundVar(inst,501)
        local rc=1
        local iter=0
        repeat
            rc=mc.mcCntlGcodeExecuteWait(inst,'g53 g0 x'..Xpos..' z'..Zpos)
            iter=iter+1
            if iter >=5 then wx.wxMessageBox('GcodeExecuteWait() Failed') break end
            if rc~=0 then mc.mcCntlEnable(inst,0) mc.mcCntlEnable(inst,1) end
        until (rc==0 ) 
        if (rc==0) then mc.mcSignalSetState(hsigbuttonstate,1) end
    end
else
    --Mach disabled....do nothing
end
end
if ( mc.mcInEditor()==1) then
    OfflineButton()
end

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on February 13, 2018, 04:53:25 AM
Hello
sorry for late.
I tried..
but it does not work ...
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on February 13, 2018, 11:40:19 AM
Hi,
have you single stepped through it with the debugger?

Did you attach it to the left-up script or the clicked script?

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on February 14, 2018, 04:51:00 AM
Hi,
I attach the screen image
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on February 14, 2018, 06:44:08 AM
Hi,
that screenshot shows the old code, not the latest. It looks like its attached correctly.

Do you have a copy in a separate folder so you can single step through with the debugger?

Craig
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on February 14, 2018, 06:56:24 AM
Hi,
I see there's something wrong with your button. A regular button has more events than the four shown in your screenshot?

Craig
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on February 14, 2018, 07:07:28 AM
Hi,
yes you have 'Toggle' button not a regular button.

You've done it again, you've avoided doing as I've asked, in particular I've ALWAYS posted the code so that you could put it in a file so you could single step
through it but you insist on attaching it to a button from the get go. If you had done so then you'd know the code was fine therefore there must be something
wrong with the button or the codes attachment.

I've asked you REPEATEDLY to single step through the code. Please do it!

Craig

Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on February 15, 2018, 04:30:48 AM
Hi,
bring patience, I'm not able ...!
I'm a mechanic, I have little experience with programs and computers!
is not it possible to make a video? otherwise we will not come to the conclusion here anymore!
I follow him carefully.
So if everything works, I load it on the Italian forum, to increase the knowledge and interest in Mach4 (which I find an excellent program, only needs support to entice people, Mach4 needs to grow as it deserves!)
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on February 15, 2018, 05:03:19 AM
Hi,
no I will not try to make a video because you are wasting my time. I have given you instructions time and time again to run the CURRENT
code through the debugger. Have you done so?

I have told you that you need to use a standard button. Have you swapped your toggle button out?

I have posted to this thread dozens of times, considerably more than the number of lines of code. I have not only single stepped you through the code
I have microstepped you through it. I've done everything from proposing a solution to writing and debugging the code, I've done everything but
install it on you machine and you still wont follow the instructions to get it to work.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on March 01, 2018, 06:04:33 AM
Hi,
I have tried so many times ..
does not work.
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on March 01, 2018, 06:22:10 AM
Hi,
have you put the latest code I posted into a separate file? Have you then run the code through the editor debugger?

Have you removed the Toggle button and replaced it with an ordinary button? I would suggest you do not attach any code to it.
Because you did not initially put the code in a separate file you have fragments of code, a lot of it buggy, distributed through out Mach.
The whole point of putting the code in a file was to prevent just that. It is now going to be hard to track it all down and get rid of it.

The code works fine here, I'm guessing you have not set it up as I instructed.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on March 06, 2018, 04:01:18 PM
Hi,
I'm not capable with your method.
But I have some news .. !!
I did it, it's improvable, but it works!
if I can make improvements I warn you!
in any case, I thank you as always for your help!



--Remember Position
RememberPosition()
--One way
local inst = mc.mcGetInstance() -- Get the instance of Mach4
local xset = mc.mcAxisGetMachinePos(inst, 0) -- Get current Machine Coordinates
-- local yset = mc.mcAxisGetMachinePos(inst, 1) -- Get current Machine Coordinates
 local zset = mc.mcAxisGetMachinePos(inst, 2) -- Get current Machine Coordinates
 xval = tostring(xset)
-- yval = tostring(yset)
 zval = tostring(zset)
 mc.mcProfileWriteString(inst, "RememberPos", "XRemem", xval) --Create a register and write the machine coordinates to it
-- mc.mcProfileWriteString(inst, "RememberPos", "YRemem", yval) --Create a register and write the machine coordinates to it
 mc.mcProfileWriteString(inst, "RememberPos", "ZRemem", zval) --Create a register and write the machine coordinates to it




-- Return To Position
ReturnToPosition()
local inst = mc.mcGetInstance() -- Get the instance of Mach4
local xrememval = mc.mcProfileGetString(inst, "RememberPos", "XRemem", "NotFound") -- Get the register Value
--local yrememval = mc.mcProfileGetString(inst, "RememberPos", "YRemem", "NotFound") -- Get the register Value
local zrememval = mc.mcProfileGetString(inst, "RememberPos", "ZRemem", "NotFound") -- Get the register Value
mc.mcCntlMdiExecute(inst, "G00 G53 Z0.0000 \n G00 G53 X" .. xrememval .. "\n G00 G53 Y" .. yrememval .. "\n G00 G53 Z" .. zrememval)
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on March 06, 2018, 04:28:58 PM
Hi,
I presume that you still have a toggle button and therefore require two scripts, one for each toggle state.
If thats the case then the code you have posted looks good.

Good work.

Craig
Title: Re: Mach4 Button OFFLINE
Post by: daniba73 on March 17, 2018, 12:46:15 PM
Yes, exactly, that's what you say.
This way it works well, and this is enough for me.

Rather..
little off topic ...
I'm noticing so many problems with the Mach4 lathe.
1-The radius compensation works very badly (if you have 2 spokes, one of which is concave and one convex in a row, it generates wrong movements!).
2-blacklash DOES NOT WORK !!!
3-in the double line G76 there are errors on the "Q" parameters !! in addition to positioning, you are tied to a certain distance in X
4: the single line G76 can not use correctly.
5: the G83 every time the tip returns, hits the bottom of the hole of the previous increment.
I hope to be the cause, in the sense that I was wrong to program (but I do not think).
close off topic.
question.
are they still working on Mach4 ??
Mach4 is a beautiful software!
but he needs to work on it again, and for a long time they do not update the versions ...!
I thank everyone again for the help you gave me!
Title: Re: Mach4 Button OFFLINE
Post by: joeaverage on March 17, 2018, 02:18:38 PM
Hi,
I don't use Mach Lathe so I can't comment,

One thing I noticed:

Quote
2-blacklash DOES NOT WORK !!!

Backlash compensation is a motion controller function not Mach. If you wish backlash to work try hassling CSLabs.

Craig