Hey Tom,
I hope I did not come off too abrasive. Your architecture comments make sense and are duly noted. I just thought that hey- _setup is a public member and maybe it might be cool to allow things like tool offsets to be adjusted on the fly, etc...
Of course this could be very dangerous and perhaps would allow more harm than good. I will reconsider circumventing the EMC apparatus.
Every looked into EMCrsh? It allows remote terminal command support
Thanks,
-Brad Murry
--- In
DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Brad,
> Â
> I'm not sure exactly what the issue is - and any Application is free to make use of the Interpreter however it wishes - but the _setup structure is basically used to save
the entire internal state of the Interpreter, and the Interpreter assumes a certain coherency and relationships between the data. So to modify things on your own would involve your application into all these internal workings which would be undesirable from an encapsulation stand point. Also changing things on-the-fly asynchronously to the Interpreter would be even more dangerous.   So my thinking in KMotionCNC was to treat the Interpreter as a Black Box where all we need to know for example is that G21 will switch it to MM mode (which turns out to involve lots of internal conversions) the best thing for a GUI button that says "switch to MM mode" should do is submit a G21 to the Interpreter. Admittedly, writing the 1 line disk file is hokey, but there certainly shouldn't be
> any performance consideration as it only happens once per User operation.
> Â
>
Thanks
> TK
>
> --- On Fri, 7/29/11, bradodarb <bradodarb@...> wrote:
>
>
> From: bradodarb <bradodarb@...>
> Subject: [DynoMotion] Re: Interpreter Interpretations....
> To:
DynoMotion@yahoogroups.com> Date: Friday, July 29, 2011, 7:19 PM
>
>
> Â
>
>
>
> Answering my own post again... This is why I need to hoook my board up to a proper machine. Maybe I will look into resurrecting and old project of mine so I can prove this stuff out without bogging down support.
>
> Anywho-
>
> I am hoping someone else can confirm, but it definitely appears that changing the settings values while running will have an immediate effect. I think in my actual CNC
application I will limit which commands can be issued depending on the current modal situation, but I will make them get/sets for a robust implementation.
>
> I just put these lines at the beginning of
> void CKMotionCNCDlg::OnSend()
> in KMotionCNC.sln
> ~
> Interpreter.p_setup->tool_length_offset = 23;
> Interpreter.p_setup->plane = 2;
> return;
> ~
>
> And I saw the Z increase immediately by 23 and my next arc call yeilded an error because of the plane change.
>
> Anyone caring to explore this further please let me know your findings.
>
> I will see what people think over at the EMC forum as well.
>
> -Brad Murry
>
> --- In
DynoMotion@yahoogroups.com, "bradodarb"
<bradodarb@> wrote:
> >
> > Having a look at
> > rs274ngc.cpp
> >
> >
> > This could be good ;) , it looks like it is using the settings inside the methods.
> >
> > Anyone willing to test some of this out?
> >
> > I guess I can overwrite the current DoGCodeLine and see if it affects my axis positions....
> >
> >
> >
> > -Brad
> >
> >
> > --- In
DynoMotion@yahoogroups.com, "bradodarb" <bradodarb@> wrote:
> > >
> > >
> > >
> > > I saw that, and my first response is...really? I realize this is a potential
> > > issue with the EMC and I am not knocking DM. It just
seems to be a odd way to
> > > go about it.
> > >
> > > Is it absolutely necesary to create a file?
> > >
> > >
> > > Anyone else here doing this?
> > >
> > > Andrew Erwwod, how did you handle this(assuming you did) in your
> > > implementation?
> > >
> > > -Brad Murry
> > >
> > >
> > >
> > > --- In
DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > > Yes. If you search in KMotionCNC if the User clicks on the MM or inch Radio buttons it calls:
> > > > ÂÂ
> > > > void CKMotionCNCDlg::Onmm()
> > >
> {
> > > >    DoGCodeLine("G21");
> > > > }
> > > > void CKMotionCNCDlg::Oninch()
> > > > {
> > > >    DoGCodeLine("G20");
> > > > }
> > > > ÂÂ
> > > > ÂÂ
> > > > Which creates a 1 line GCode File and executes it like the MDI.
> > > >
> > > > TK
> > > > ÂÂ
> > > >
> > > > --- On Fri, 7/29/11, bradodarb <bradodarb@> wrote:
> > > >
> > > >
> > > > From: bradodarb <bradodarb@>
> > > > Subject: [DynoMotion] Re: Interpreter Interpretations....
> > > > To:
DynoMotion@yahoogroups.com> > > > Date: Friday, July 29, 2011, 4:32 PM
> > > >
> > > >
> > > > ÂÂ
> > > >
> > > >
> > > >
> > > > I see, so perhaps some/all setup params should be made as "read only"(only provide get value functions) when I export?
> > > >
> > > > " I think it simulates GCode to effect the change rather than modifying the internal variables"
> > > >
> > > > Does this mean it drops it into MDI mode and makes the calls and then back? I guess I would be able to tell in the code...
> > > >
> > > > Thanks again,
> > > > -Brad Murry
> > > >
> > > > --- In
DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > >
> > > > > Hi Brad,
> > > > > ÂÂÂ
> > > > > Again I think most of these are used internally. For example to change the Tool Index the User would execute a Hxx command in G Code. However KMotionCNC does display some settings on the screen like current tool and allows the User to change the tool directly, but I think it simulates GCode to effect the change rather than modifying the internal variables.
> > > > >
> > > > > TK
> > > > >
> > > > > --- On Fri, 7/29/11, bradodarb <bradodarb@> wrote:
> > > >
>
> > > > >
> > > > > From: bradodarb <bradodarb@>
> > > > > Subject: [DynoMotion] Re: Interpreter Interpretations....
> > > > > To:
DynoMotion@yahoogroups.com> > > > > Date: Friday, July 29, 2011, 3:40 PM
> > > > >
> > > > >
> > > > > ÂÂÂ
> > > > >
> > > > >
> > > > >
> > > > > Hello,
> > > > >
> > > > > Int the case of:
> > > > >
> > > > > int tool_table_index; // tool index used with cutter comp
> > > > >
> > > > > double
tool_length_offset; // current tool length offset
> > > > >
> > > > > int length_offset_index; // for use with tool length offsets
> > > > >
> > > > > and
> > > > >
> > > > > double cutter_comp_radius; // current cutter compensation radius
> > > > >
> > > > > How do these values interact/override each other?
> > > > >
> > > > > Are some of them to be considered read only, or can I override values pulled from tool_table_index and length_offset_index
> > > > > by updating the tool_length_offset and cutter_comp_radius?
> > > > >
> > > > > Just trying to get my head wrapped 'round it all.
> > > > >
> > > > > Thanks,
> > > > >
> > > > > -Brad
Murry
> > > > >
> > > > > --- In
DynoMotion@yahoogroups.com, "bradodarb" <bradodarb@> wrote:
> > > > > >
> > > > > > Tom,
> > > > > >
> > > > > > I see some of the setup params are not commented(mut most are)
> > > > > >
> > > > > > Can you clarify these?:
> > > > > > ON_OFF block_delete;
> > > > > > int cutter_radius_compensation;
> > > > > > double cycle_z;
> > > > > > int current_line;
> > > > > >
> > > > > > fpos_t sub_stack_pos[MAX_SUB_STACK];
> > > > > > fpos_t
sub_stack_sub_start_pos[MAX_SUB_STACK];
> > > > > > int sub_stack_lineno[MAX_SUB_STACK];
> > > > > > int sub_stack_sub_start_lineno[MAX_SUB_STACK];
> > > > > > int sub_stack_call_cnt[MAX_SUB_STACK];
> > > > > > int stacki;
> > > > > >
> > > > > > Thank you,
> > > > > >
> > > > > > -Brad Murry
> > > > > >
> > > > > > --- In
DynoMotion@yahoogroups.com, "bradodarb" <bradodarb@> wrote:
> > > > > > >
> > > > > > > "Thank you for your time, I think this is the last thing I need to wrap!
> > > > > > >
> >
> > > > > I've heard that before :} "
> > > > > > >
> > > > > > > Ha!, I should clarify that what I meant is : the Interpreter is the last thing I plan to wrap - I'm sure there will be many clarifications needed down the road epecially once I get this thing connected to a real world machine.
> > > > > > >
> > > > > > > There are too many assumptions I have used in implementing everything (for the sake of progress), and I think I may email you the source first so you can tell me if it is on the right track - plus there are likely a lot of members that may not need to be/should not be exported. Once you approve of the exported members and such I will release the source publicly. Sound like a plan?
> > > > > > >
> > > > > > >
> > > > > > > -Brad Murry
> > >
> > > >
> > > > > > >
> > > > > > > --- In
DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > >
> > > > > > > > See below
> > > > > > > >
> > > > > > > >
> > > > > > > > --- On Fri, 7/29/11, bradodarb <bradodarb@> wrote:
> > > > > > > >
> > > > > > > >
> > > > > > > > From: bradodarb <bradodarb@>
> > > > > > > > Subject: [DynoMotion] Re: Interpreter Interpretations....
> > > > > > > > To:
DynoMotion@yahoogroups.com> > > > > > > > Date: Friday, July 29, 2011, 12:36 PM
> > > > > > > >
> > > > > > > >
> > > > > > > > ÃÆ'‚ÂÂÂ
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Excellent Tom- Thanks!
> > > > > > > >
> > > > > > > > I do have a concern and a few more methods to clarify...
> > > > > > > >
> > > > > > > > > bool m_ReadToolFile;obsolete - always reads
> > > > > > > >
> > > > > > > > I may have mentioned before that I wish to directly set all setup params and tool tables. Will this impede my intentions?
> > > > > > > >
> > > > > > > > If the filenames are not set (they default to NULL) then they will not be read
> > > > > > > >
> > > > > > > > Also, are there any other pitfalls I may run into while trying to set params you are normally using a file for from memory?
> > > > > > > >
> > > > > > > > In case you are interested as to why I do not want to use the existing file formats:
> > > > > > > >
> > > > > > > > The plan is to have .net classes that contain all the data memebers dor things like tools and also the members in setup_struct.
> > > > > > >
>
> > > > > > > > This will allow me to serialize and de-serialize using XML so there is no manual parsing required by my application. I am also using these data classes for MVVM, so they are all implementing INotifyPropertyChanged.
> > > > > > > >
> > > > > > > > Ok, so that is a concern, here are some remaining members I am not quite sure about:
> > > > > > > >
> > > > > > > > MCODE_ACTION McodeActions[MAX_MCODE_ACTIONS];ÃÆ'‚ MCodes(in GCode) can be configured to do various "Actions" such as Set/Clear a bit, Run a C Program in KFLOP, Run a Windows Program, etc.ÃÆ'‚ This structure defines what is to be performed for various M Codes.ÃÆ'‚ User Buttons also use this mechanism as "pseudo M
codes" and so can be configured to do likewise "Actions"
> > > > > > > >
> > > > > > > > int ExecutePC(const char *Name);
> > > > > > > > Calling this spawns a Windows PC Application by the specified name
> > > > > > > >
> > > > > > > > char ToolFile[MAX_PATH];ÃÆ'‚ Can be used to define Tool Parameters
> > > > > > > > char SetupFile[MAX_PATH];ÃÆ'‚ Can be used to define inital Interpreter Settings
> > > > > > > > char GeoFile[MAX_PATH];ÃÆ'‚ Can be used to define a 2.5D Geometric correction file
> > > > > > > >
> > > > > > > > CCoordMotion CoordMotion; -- There is only one CoordMotion
object per board, right? Yes
> > > > > > > >
> > > > > > > > These below are all for internal Interpreter use only
> > > > > > > > int m_CurrentLine;
> > > > > > > > int m_GCodeReads;
> > > > > > > > CString m_InFile; Gcode File?
> > > > > > > > int m_exitcode;
> > > > > > > > int DoExecute();
> > > > > > > > int DoExecuteComplete();
> > > > > > > >
> > > > > > > >
> > > > > > > > I think after this I will have some questions on some members in the setup_struct...
> > > > > > > >
> > > > > > > > Thank you for your time, I think this is the last thing I need to wrap!
> > > > > > >
>
> > > > > > > > I've heard that before :}
> > > > > > > > Thanks
> > > > > > > > TK
> > > > > > > > ÃÆ'‚ÂÂÂ
> > > > > > > >
> > > > > > > > -Brad Murry
> > > > > > > >
> > > > > > > > --- In
DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > > >
> > > > > > > > > See below
> > > > > > > > > TK
> > > > > > > > >
> > > > > > > > > --- On Fri, 7/29/11, bradodarb
<bradodarb@> wrote:
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > From: bradodarb <bradodarb@>
> > > > > > > > > Subject: [DynoMotion] Interpreter Interpretations....
> > > > > > > > > To:
DynoMotion@yahoogroups.com> > > > > > > > > Date: Friday, July 29, 2011, 11:52 AM
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > ÃÆ'Æ'‚ÃÆ'‚ÂÂÂ
> > > > > > > > >
> > > > > > > >
>
> > > > > > > > >
> > > > > > > > > Hello Tom,
> > > > > > > > >
> > > > > > > > > I am implementing the interpreter today and although some of the public members below seem intuitive, I would like to make sure I have everything right. Can you give me brief descripts on each member and tell me whether you think they should be exposed as properties or not?
> > > > > > > > >
> > > > > > > > > bool m_InitializeOnExecute;ÃÆ'Æ'‚ÃÆ'‚ don't exportÃÆ'Æ'‚ÃÆ'‚ÂÂÂ
> > > > > > > > > bool m_ReadToolFile;obsolete - always reads
> > > > > > > > > int m_start,
m_end;obsolete - unused
> > > > > > > > >
> > > > > > > > > ÃÆ'Æ'‚ÃÆ'‚ÂÂÂ
> > > > > > > > > After a Halt and a possible Tool replacement or Offset change
> > > > > > > > > there is a mechanism to "Resume"
> > > > > > > > >
> > > > > > > > > bool m_Resume;ÃÆ'Æ'‚ÃÆ'‚ Set if any partÃÆ'Æ'‚ÃÆ'‚ of theÃÆ'Æ'‚ÃÆ'‚ resume sequence is desired
> > > > > > > > > double m_ResumeSafeZ; Safe Z height to be raised
toÃÆ'Æ'‚ÃÆ'‚ÂÂÂ
> > > > > > > > > int m_ResumeSafeRelAbs;ÃÆ'Æ'‚ÃÆ'‚ Specifies if the Z heights are absolute or relative
> > > > > > > > > BOOL m_ResumeMoveToSafeZ;ÃÆ'Æ'‚ÃÆ'‚ Specifies whether or not the Z should be first moved up
> > > > > > > > > BOOL m_ResumeTraverseXY;ÃÆ'Æ'‚ÃÆ'‚ Specifies whether an xy motion should be made back to some position
> > > > > > > > > double m_ResumeTraverseSafeX;ÃÆ'Æ'‚ÃÆ'‚ Position in X
> > > >
> > > > > double m_ResumeTraverseSafeY;ÃÆ'Æ'‚ÃÆ'‚ Position in Y
> > > > > > > > > BOOL m_ResumeSafeStartSpindle; Specifies if the Spindle should be re-started
> > > > > > > > > int m_ResumeSafeSpindleCWCCW;ÃÆ'Æ'‚ÃÆ'‚ Specifies Spindle direction if it is to be re-started
> > > > > > > > > BOOL m_ResumeDoSafeFeedZ;ÃÆ'Æ'‚ÃÆ'‚ Specifies if the Z should then be fed down to some height
> > > > > > > > > double m_ResumeFeedSafeZ;ÃÆ'Æ'‚ÃÆ'‚ Specifies height Z should be fed down to
> > > > >
> > > > double m_ResumeResumeFeedRate;ÃÆ'Æ'‚ÃÆ'‚ double m_ResumeZFeedRate;Specifies Rate at which feed rate should be restored to
> > > > > > > > > BOOL m_ResumeRestoreFeedRate; Specifies whether or not the specified feed rate should be restored
> > > > > > > > >
> > > > > > > > > Thanks,
> > > > > > > > > Brad Murry
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>