EMC source code problem
Posted by
Jon Elson
on 2001-09-03 00:37:38 UTC
Hello, collected experts,
Only Linux/Unix C gurus who are also well up to speed on EMC internals
need to read this one!
I have been trying to make some changes to EMC to make my parallel
port motion control stuff send all digital I/O through the real-time section
to serialize access to the parallel port hardware. This involved adding
a new struct to the structure of structs defined in emcmot/emcmot.h
and instantiated for the Linux side in emcmot/usrmotintf.c
I have gotten this compiling, but the problem I'm having is exporting the
pointer to the structure. The 'meta-structure' is defined as EMCMOT_STRUCT
and it has structures defined in it like EMCMOT_COMMAND.
usrmotintf.c instantiates these with lines like
static EMCMOT_COMMAND *emcmotCommand = 0;
and later sets the pointer with this line
emcmotCommand = &(emcmotStruct->command);
Now, it seems that these pointers are then exported to various parts of
EMC for other programs to use. Maybe that is the problem, that I'm
trying to use information in the wrong program module. but, i can see
that modules like emctask/bridgeporttaskintf.c use these structures
without any specific includes or definitions, other than just the
static EMCMOT_COMMAND emcmotCommand;
So, is this is a different pointer that is getting the correct address
somehow,
or is this the SAME pointer as was instantiated in usrmotintf.c, and is
being
connected by the linker?
Anyway, I think I added my structure and pointers in the same way as
these others have been done, but it doesn't seem to be working.
My other routines that want to access the structure find the pointer nil.
Thanks for any advice,
Jon
Only Linux/Unix C gurus who are also well up to speed on EMC internals
need to read this one!
I have been trying to make some changes to EMC to make my parallel
port motion control stuff send all digital I/O through the real-time section
to serialize access to the parallel port hardware. This involved adding
a new struct to the structure of structs defined in emcmot/emcmot.h
and instantiated for the Linux side in emcmot/usrmotintf.c
I have gotten this compiling, but the problem I'm having is exporting the
pointer to the structure. The 'meta-structure' is defined as EMCMOT_STRUCT
and it has structures defined in it like EMCMOT_COMMAND.
usrmotintf.c instantiates these with lines like
static EMCMOT_COMMAND *emcmotCommand = 0;
and later sets the pointer with this line
emcmotCommand = &(emcmotStruct->command);
Now, it seems that these pointers are then exported to various parts of
EMC for other programs to use. Maybe that is the problem, that I'm
trying to use information in the wrong program module. but, i can see
that modules like emctask/bridgeporttaskintf.c use these structures
without any specific includes or definitions, other than just the
static EMCMOT_COMMAND emcmotCommand;
So, is this is a different pointer that is getting the correct address
somehow,
or is this the SAME pointer as was instantiated in usrmotintf.c, and is
being
connected by the linker?
Anyway, I think I added my structure and pointers in the same way as
these others have been done, but it doesn't seem to be working.
My other routines that want to access the structure find the pointer nil.
Thanks for any advice,
Jon
Discussion Thread
Jon Elson
2001-09-03 00:37:38 UTC
EMC source code problem
Art Fenerty
2001-09-03 04:51:30 UTC
Re: [CAD_CAM_EDM_DRO] EMC source code problem