Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: cpu224 on December 23, 2018, 07:13:31 AM

Title: Mach 4
Post by: cpu224 on December 23, 2018, 07:13:31 AM
Hello
I have just installed Mach 4 with the IP-M controller.
And now I have 2 questions
1. I have installed a potentiometer for the feed, when I turn it also changes the feed rate on the screen but not the jog, you can change that.
2. I can not find any settings for OEM switches eg. Start-Stop break.

greeting
Torsten
Title: Re: Mach 4
Post by: joeaverage on December 23, 2018, 01:49:08 PM
Hi,
1) Yes you can do this, note that typically the jog rate and the feed rate are separate. If you wish to link them you can use this API:

Quote
LUA Syntax:
rc = mc.mcJogSetRate(
      number mInst,
      number axisId,
      number percent)

Description:
Set the jog rate of the given axis as a percentage of the axis' maximum velocity.

You could write a small script in the PLC script which would then continuously cause the jog rate to be the same or some fixed percentage of the feed rate.

Quote
2. I can not find any settings for OEM switches eg. Start-Stop break.

OEMs are a Mach3 term and do not occur in Mach4 at all. You need to read the manual:
Quote
Mach4 CNC Controller
Lua Scripting Guide

found in the Docs folder of your Mach4Hobby directory, particularly section 5.1 page 18. You will find that Mach4 signals
are handled in a different manner to Mach3, in particular they are not polled as in Mach3 and consequently lend themselves to treatment
in a Signal Library Table. Understanding how the Signal Library Table works is a major breakthrough in your understanding of Mach4
and a perfect example of the 'function as a first class value' programming paradigm that is offered by Lua. A simple concept.....but Oh so
valuable!

Thereafter you will find input signal (ISIG_INPUT*********) and output signals (OSIG_OUTPUT*********) listed in the API.chm in the docs folder.
I have attached aof list, I find it useful enough I have put it in the Docs folder as well. There are hundreds of signals defined.

Craig
Title: Re: Mach 4
Post by: cpu224 on December 23, 2018, 05:47:48 PM
thank you