Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: Cartierusm on January 28, 2018, 01:28:25 AM

Title: API Function Codes Help
Post by: Cartierusm on January 28, 2018, 01:28:25 AM
I looked through all of Mach 4 Core API for the function codes, but can't seem to find them.

I want to add some physical buttons to my pendant and need the codes so I can add them to the lua script.

1. Ref All Axis.
2. Zero Fixture Z

Any help would be appreciated.
Title: Re: API Function Codes Help
Post by: joeaverage on January 28, 2018, 02:36:33 AM
Hi,
I would think that a function like that will be built up of several API calls and some logic to glue it all together.

This should get you looking in the right place:
Quote
LUA Syntax:
rc = mc.mcAxisHomeAll(
   number mInst)


Quote
LUA Syntax:
rc = mc.mcAxisSetPos(
   number mInst,
   number axisId,
   number val);


In the Axes category.

Craig
Title: Re: API Function Codes Help
Post by: Cartierusm on January 28, 2018, 11:14:46 AM
Great Thanks!!
Title: Re: API Function Codes Help
Post by: Chaoticone on January 28, 2018, 11:48:34 AM
Map your inputs to signals.

Watch for those signals state changes in screen load siglib.

Based on sig state call functions in the screen load script to do what you want.