Dynomotion

Group: DynoMotion Message: 12075 From: mp.3333 Date: 8/7/2015
Subject: SetMCodeAction

Tom, is the SetMCodeAction method available to use within vb and is this the best way to setup up the mcodes?


Thanks, Mike

Group: DynoMotion Message: 12076 From: Tom Kerekes Date: 8/7/2015
Subject: Re: SetMCodeAction
Hi Mike,

Yes.  Note that the Action index is a packed array of all the available actions (ie M100 is not index 100). 

They are in the array using this scheme:

#define MAX_MCODE_ACTIONS_M1 11        // actually only 2-10  are used
#define MAX_MCODE_ACTIONS_BUTTONS 10
#define MAX_MCODE_ACTIONS_M100 20
#define MAX_MCODE_ACTIONS_SPECIAL 8
#define MAX_MCODE_ACTIONS (MAX_MCODE_ACTIONS_M1+MAX_MCODE_ACTIONS_M100+MAX_MCODE_ACTIONS_BUTTONS+MAX_MCODE_ACTIONS_SPECIAL)
#define MAX_MCODE_DOUBLE_PARAMS 5
#define MCODE_ACTIONS_M100_OFFSET (MAX_MCODE_ACTIONS_M1+MAX_MCODE_ACTIONS_BUTTONS)
#define MCODE_ACTIONS_SPECIAL_OFFSET (MAX_MCODE_ACTIONS_M1+MAX_MCODE_ACTIONS_BUTTONS+MAX_MCODE_ACTIONS_M100)

HTH
Regards
TK

Group: DynoMotion Message: 12077 From: mp.3333 Date: 8/7/2015
Subject: Re: SetMCodeAction

Tom, how do I declare this to get access to SetMCodeAction.  I can't get rid of error when using this:

Private KMInt As New KMotion_dotNet.KM_Interpreter().


Thanks, Mike



Group: DynoMotion Message: 12078 From: Tom Kerekes Date: 8/7/2015
Subject: Re: SetMCodeAction
Hi Mike,

The Interpreter object (and CoordMotion object) is created when the KM_Controller object is created.  You don't need to create it separately.

So KM_Interpreter members can be accessed as:

_Controller.CoordMotion.Interpreter.SetMcodeAction

HTH
Regards
TK

Group: DynoMotion Message: 12079 From: mp.3333 Date: 8/7/2015
Subject: Re: SetMCodeAction

Tom, I see it now.  Thanks.


So, it is looking for 8 parameters...some optional I guess.  If I want M100 to set bit 47 to 1, how is that coded?


Mike

Group: DynoMotion Message: 12080 From: mp.3333 Date: 8/7/2015
Subject: Re: SetMCodeAction
OK...I think this works....M100 is index of 21 and M101 is index of 22.