The EMC_STAT struct is defined in emc.hh in emc2/src/emc/nml_intf Basicly there are 3 memories: 1). the motion / HAL memory region 2). the shared memory between motion and task 3). the NML memory region.
I think you took care ok of 1). For 2). you need to add the variable you want to emcmot_status_t (defined in src/emc/motion/motion.h) and update it in src/emc/motion/control.c: update_status() >From there you need to map it to EMC_STAT, for that (3) you need to add it to EMC_MOTION_STAT, and update it in src/emc/task/taskintf.cc: emcMotionUpdate() Once it's updated you can reach it as a part of EMC_STAT (EMC_STAT contains EMC_MOTION_STAT motion;). So you want to access emcStatus->motion->controlshaftPos. I would suggest you take a look at spindle.enabled and try to follow that through the various layers. Let me know if I can be of more help, but preferably on the emc-developers list Regards, Alex ----- Original Message ----- From: "Lindenmayr Bernd" <[email protected]> To: <[email protected]> Sent: Monday, September 21, 2009 1:27 PM Subject: Re: [Emc-users] add a new Hal-Pin to motion controller Hi Alex! Thanks! I changed the names, but the error-message is still there. Please correct me, if I get something wrong...There are two structs. One is called emcmot_hal_data. This contains all pointers to the HAL-Pins. My new pointer is called control_shaft_pos. The other struct is emcmotStatus and is located in share memory and will be updated cyclically. My new variable is called controlshaftPos. In emcsh.cc I call the funcion Tcl_NewDoubleObj() to get the variable from the status-struct: shaftposobj = Tcl_NewDoubleObj(emcStatus->controlshaftPos); shaftposobj is my new Tcl_objekt which is connected to Tcl_SetObjResult(interp, shaftposobj) I don´t understand the following errormessage : emc/usr_intf/emcsh.cc:3318: Fehler: ?class EMC_STAT? hat kein Element namens ?controlshaftPos? That means that it doesn´t exist any element in class EMC_STAT which is called "controlshaftPos" which is the variable of the status-struct. Where is the connection of the class EMC_STAT and the struct emcmotStatus ?? Thanks for your thoughts... Bernd ************************ ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
