Re: Application using EMC Software, a few questions
Posted by
Fred Proctor
on 1999-09-09 11:52:41 UTC
Jose Luis Martinez Lastra wrote:
port?, how can i programm the algorithms there (in the EMC enviroment),
can i use the graphic EMC for visualization the results?
<
If you are only programming digital I/O and want to use the parallel
port, you don't need to run the EMC. The EMC is a computer-numerical
controller (CNC) for machine tools, and this is more than you need.
The easiest way to do this is to use the parallel port C functions
provided in the EMC. This is the code in emc/src/emcnml/parport.c and
emc/src/emcnml/parport.h, with functions like:
/* initializes the port, pass 0 as stuff */
extern int pptDioInit(const char * stuff);
/* reads value of digital input at index, stores in value */
extern int pptDioRead(int index, int *value);
/* writes value (non-zero means 1, 0 is 0) at digital out at index */
extern int pptDioWrite(int index, int value);
/* call this when you're done */
extern int pptDioQuit();
There are other functions for writing whole bytes, etc. in parport.c.
Note that you can simply compile this and link the functions into C code
that you run as a normal Linux process. At the end of parport.c is a
main() routine that does this sort of thing. YOu need to be root to run
the programs since they access hardware directly.
Alas, there is no graphical tool for working with digital I/O. Perhaps
you would like to write one? How about a Tcl/Tk GUI that lets you
program graphically, using ladder logic or some sort of flowchart?
Also, he wrote:
cartesian robot, does it sound stupid? any experience?
<
Sounds smart to me. You can loosely integrate motion and IO using G
codes, as is done now for spindle and coolant control. The two twists on
this are:
1. using a language other than G codes for programming robot motion tool
control; or
2. adding individual addressing of IO bits in G or M codes (anyone have
an example of this?)
--Fred
>Can i make work EMC for handling digital I/Os through the parallel
port?, how can i programm the algorithms there (in the EMC enviroment),
can i use the graphic EMC for visualization the results?
<
If you are only programming digital I/O and want to use the parallel
port, you don't need to run the EMC. The EMC is a computer-numerical
controller (CNC) for machine tools, and this is more than you need.
The easiest way to do this is to use the parallel port C functions
provided in the EMC. This is the code in emc/src/emcnml/parport.c and
emc/src/emcnml/parport.h, with functions like:
/* initializes the port, pass 0 as stuff */
extern int pptDioInit(const char * stuff);
/* reads value of digital input at index, stores in value */
extern int pptDioRead(int index, int *value);
/* writes value (non-zero means 1, 0 is 0) at digital out at index */
extern int pptDioWrite(int index, int value);
/* call this when you're done */
extern int pptDioQuit();
There are other functions for writing whole bytes, etc. in parport.c.
Note that you can simply compile this and link the functions into C code
that you run as a normal Linux process. At the end of parport.c is a
main() routine that does this sort of thing. YOu need to be root to run
the programs since they access hardware directly.
Alas, there is no graphical tool for working with digital I/O. Perhaps
you would like to write one? How about a Tcl/Tk GUI that lets you
program graphically, using ladder logic or some sort of flowchart?
Also, he wrote:
>i will be lucky to integrate the logic and motion program of a small
cartesian robot, does it sound stupid? any experience?
<
Sounds smart to me. You can loosely integrate motion and IO using G
codes, as is done now for spindle and coolant control. The two twists on
this are:
1. using a language other than G codes for programming robot motion tool
control; or
2. adding individual addressing of IO bits in G or M codes (anyone have
an example of this?)
--Fred
Discussion Thread
Jose Luis Martinez Lastra
1999-08-03 10:11:07 UTC
Application using EMC Software, a few questions
Jose Luis Martinez Lastra
1999-09-09 08:40:10 UTC
Re: Application using EMC Software, a few questions
Fred Proctor
1999-09-09 11:52:41 UTC
Re: Application using EMC Software, a few questions
Carles Perello
1999-09-10 00:53:32 UTC
Re: Application using EMC Software, a few questions