From: Fred P. <fre...@ni...> - 2003-10-17 16:11:34
|
dan falck wrote: > Fred, > > I happened to read in the developer archives a message that you had > written regarding "hot comments" that could be used inside G-code in > EMC. Could you elaborate further on this with some more examples? Hot comments are a quick and dirty way to get the interpreter to handle custom extensions. It lets you pass information as comments, which are ignored by the interpreter except that it calls the COMMENT() function when it encounters them. The COMMENT function is defined in emc/src/emctask/emccanon.cc, and if you look inside you'll see some stuff I put in a few years ago to log probed point values. The interpreter reads ahead and will likely call this function before you really want it called. There is no easy way around this. The way around it is to have COMMENT put something on the interp_list, e.g., interp_list.append(your_new_msg) as seen throughout the rest of emccanon.cc. Then, in emctaskmain.cc, handle your_new_message as the other NML messages are handled by checkPreconditions(), checkPostconditions(), and issueCommand(). --Fred -- Mr. Frederick M. Proctor Group Leader, Control Systems Group National Institute of Standards and Technology 100 Bureau Drive, Stop 8230 Gaithersburg, MD 20899-8230 301-975-3425 (voice) 301-990-9688 (fax) fre...@ni... (email) |