S
Hi All,
This the status of my SMM client interface. The IO manager registers with the name "IOManager" and will have write access to all inputs.
/* *******************************************
* definition of the plc context
*
* each process that requires access to the shared memory
* must hold a valid context. the context is used to identify
* the process and it's attributes to the shared memory
* manager and thus permit access control, etc to the
* io table
* ******************************************* */
struct tag_plc_context {
int id;
};
typedef struct tag_plc_context plc_context_t;
/* *******************************************
* prototypes
* ******************************************* */
/* context generation/destruction */
plc_context_t *register(const char *process_name);
void unregister(plc_context_t *env);
/* create an io table for this process. this will populate a memory area that belongs to this process with a copy of the io in the shared memory manager.
on successful completion it returns '0', otherwise it returns an error status.
*/
int init_scan(plc_context_t *env);
/* update the SMM io data
on successful completion it returns '0', otherwise it returns an error status.
*/
int commit_io(plc_env_t *env);
/* retrieve the address of an io point
on successful completion it returns a the address of the io_point to be set, otherwise it returns '0' and sets errno.
*/
long get_iopoint_addr(plc_env_t *env,const char *name);
/* retrieve the value for an input. the immediate functions force the shared memory manager to initiate a transfer directly from the io manager.
on successful completion it returns a pointer to a plc_io_point structure, otherwise it returns null and sets the errno.
*/
void *get_input_by_name(plc_env_t *env,const char *name);
void *get_input_by_addr(plc_env_t *env,const long address);
void *get_input_by_name_immediate(plc_env_t *env,const char *name);
void *get_input_by_addr_immediate(plc_env_t *env,const long address);
/* set the value for an output. the immediate functions force the shared memory manager to initiate a transfer directly to the io manager.
on successful completion it returns a pointer to a plc_io_point structure, otherwise it returns null and sets the errno.
*/
int set_output_by_name(plc_env_t *env,const char *name);
int set_output_by_addr(plc_env_t *env,const long address);
int set_output_by_name_immediate(plc_env_t *env,const char *name);
int set_output_by_addr_immediate(plc_env_t *env,const long address);
Debian GNU User
Simon Martin
Project Manager
Isys
mailto: [email protected]
There is a chasm of carbon and silicon the software cannot bridge
_______________________________________________
LinuxPLC mailing list
[email protected]
http://linuxplc.org/mailman/listinfo/linuxplc
This the status of my SMM client interface. The IO manager registers with the name "IOManager" and will have write access to all inputs.
/* *******************************************
* definition of the plc context
*
* each process that requires access to the shared memory
* must hold a valid context. the context is used to identify
* the process and it's attributes to the shared memory
* manager and thus permit access control, etc to the
* io table
* ******************************************* */
struct tag_plc_context {
int id;
};
typedef struct tag_plc_context plc_context_t;
/* *******************************************
* prototypes
* ******************************************* */
/* context generation/destruction */
plc_context_t *register(const char *process_name);
void unregister(plc_context_t *env);
/* create an io table for this process. this will populate a memory area that belongs to this process with a copy of the io in the shared memory manager.
on successful completion it returns '0', otherwise it returns an error status.
*/
int init_scan(plc_context_t *env);
/* update the SMM io data
on successful completion it returns '0', otherwise it returns an error status.
*/
int commit_io(plc_env_t *env);
/* retrieve the address of an io point
on successful completion it returns a the address of the io_point to be set, otherwise it returns '0' and sets errno.
*/
long get_iopoint_addr(plc_env_t *env,const char *name);
/* retrieve the value for an input. the immediate functions force the shared memory manager to initiate a transfer directly from the io manager.
on successful completion it returns a pointer to a plc_io_point structure, otherwise it returns null and sets the errno.
*/
void *get_input_by_name(plc_env_t *env,const char *name);
void *get_input_by_addr(plc_env_t *env,const long address);
void *get_input_by_name_immediate(plc_env_t *env,const char *name);
void *get_input_by_addr_immediate(plc_env_t *env,const long address);
/* set the value for an output. the immediate functions force the shared memory manager to initiate a transfer directly to the io manager.
on successful completion it returns a pointer to a plc_io_point structure, otherwise it returns null and sets the errno.
*/
int set_output_by_name(plc_env_t *env,const char *name);
int set_output_by_addr(plc_env_t *env,const long address);
int set_output_by_name_immediate(plc_env_t *env,const char *name);
int set_output_by_addr_immediate(plc_env_t *env,const long address);
Debian GNU User
Simon Martin
Project Manager
Isys
mailto: [email protected]
There is a chasm of carbon and silicon the software cannot bridge
_______________________________________________
LinuxPLC mailing list
[email protected]
http://linuxplc.org/mailman/listinfo/linuxplc