usrmotintf.h
1 /******************************************************************** 2 * Description: usrmotintf.h 3 * Decls for interface functions (init, exit, read, write) for user 4 * processes which communicate with the real-time motion controller 5 * in emcmot.c 6 * 7 * Derived from a work by Fred Proctor & Will Shackleford 8 * 9 * Author: 10 * License: GPL Version 2 11 * System: Linux 12 * 13 * Copyright (c) 2004 All rights reserved. 14 ********************************************************************/ 15 #ifndef USRMOTINTF_H 16 #define USRMOTINTF_H 17 18 struct emcmot_status_t; 19 struct emcmot_command_t; 20 struct emcmot_config_t; 21 struct emcmot_debug_t; 22 struct emcmot_error_t; 23 24 #ifdef __cplusplus 25 extern "C" { 26 #endif 27 28 /* usrmotIniLoad() loads params (SHMEM_KEY) from 29 named ini file */ 30 extern int usrmotIniLoad(const char *file); 31 32 /* usrmotReadEmcmotStatus() gets the status info out of 33 the emcmot controller and puts it in arg */ 34 extern int usrmotReadEmcmotStatus(emcmot_status_t * s); 35 36 /* usrmotReadEmcmotConfig() gets the config info out of 37 the emcmot controller and puts it in arg */ 38 extern int usrmotReadEmcmotConfig(emcmot_config_t * s); 39 40 /* usrmotReadEmcmotDebug() gets the debug info out of 41 the emcmot controller and puts it in arg */ 42 extern int usrmotReadEmcmotDebug(emcmot_debug_t * s); 43 44 /* usrmotReadEmcmotError() gets the earliest queued error string out of 45 the emcmot controller and puts it in arg */ 46 extern int usrmotReadEmcmotError(char *e); 47 48 /* usrmotPrintEmcmotStatus() prints the status in s, using which 49 arg to select sub-prints */ 50 extern void usrmotPrintEmcmotStatus(emcmot_status_t *s, int which); 51 52 /* usrmotPrintEmcmotConfig() prints the config in s, using which 53 arg to select sub-prints */ 54 extern void usrmotPrintEmcmotConfig(emcmot_config_t s, int which); 55 56 /* usrmotPrintEmcmotDebug() prints the debug in s, using which 57 arg to select sub-prints */ 58 extern void usrmotPrintEmcmotDebug(emcmot_debug_t *s, int which); 59 60 /* values returned by usrmotWriteEmcmotCommand; negative values 61 are all errors */ 62 #define EMCMOT_COMM_OK 0 /* went through and honored */ 63 #define EMCMOT_COMM_ERROR_CONNECT -1 /* can't even connect */ 64 #define EMCMOT_COMM_ERROR_TIMEOUT -2 /* connected, but send timeout */ 65 #define EMCMOT_COMM_ERROR_COMMAND -3 /* sent, but can't run command now */ 66 #define EMCMOT_COMM_SPLIT_READ_TIMEOUT -4 /* can't read without split */ 67 #define EMCMOT_COMM_INVALID_MOTION_ID -5 /* do not queue a motion id MOTION_INVALID_ID */ 68 69 /* usrmotWriteEmcmotCommand() writes the command to the emcmot process. 70 Return values are as per the #defines above */ 71 extern int usrmotWriteEmcmotCommand(emcmot_command_t * c); 72 73 /* usrmotInit() initializes communication with the emcmot process */ 74 extern int usrmotInit(const char *name); 75 76 /* usrmotExit() terminates communication with the emcmot process */ 77 extern int usrmotExit(void); 78 79 /* usrmotLoadComp() loads the compensation data in file into the joint */ 80 extern int usrmotLoadComp(int joint, const char *file, int type); 81 82 /* usrmotPrintComp() prints the joint compensation data for the specified joint */ 83 extern int usrmotPrintComp(int joint); 84 85 #ifdef __cplusplus 86 } 87 #endif 88 #endif /* USRMOTINTF_H */