-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
from_shcom.h
76 lines (63 loc) · 1.97 KB
/
from_shcom.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef FROM_SHCOM
#define FROM_SHCOM
// The contents of this file are mostly taken from src/emc/usr_intf/shcom.hh in the LinuxCNC source,
// and reduced so that only the relevant parts are included without bringing in too many other dependencies.
#include "linuxcnc/emc.hh"
#include "linuxcnc/emc_nml.hh"
#include "linuxcnc/timer.hh"
#include "nml_oi.hh"
#define JOGTELEOP 0
#define JOGJOINT 1
enum EMC_UPDATE_TYPE {
EMC_UPDATE_NONE = 1,
EMC_UPDATE_AUTO
};
enum EMC_WAIT_TYPE {
EMC_WAIT_RECEIVED = 2,
EMC_WAIT_DONE
};
extern RCS_CMD_CHANNEL *emcCommandBuffer;
extern RCS_STAT_CHANNEL *emcStatusBuffer;
extern NML *emcErrorBuffer;
extern EMC_WAIT_TYPE emcWaitType;
extern EMC_UPDATE_TYPE emcUpdateType;
extern int emcCommandSerialNumber;
extern char error_string[NML_ERROR_LEN];
extern char operator_text_string[NML_TEXT_LEN];
extern char operator_display_string[NML_DISPLAY_LEN];
extern char emc_inifile[LINELEN];
extern char emc_nmlfile[LINELEN];
extern char emc_macrosPath[LINELEN];
extern char emc_openFile[LINELEN];
int iniLoad(const char *filename);
int emcTaskNmlGet();
int emcErrorNmlGet();
int tryNml(double retry_time, double retry_interval);
int updateStatus();
int updateError();
int emcCommandPollDone();
int emcCommandWaitDone();
int emcCommandWaitReceived();
int emcCommandSend(RCS_CMD_MSG & cmd);
int sendAbort();
int sendEstop();
int sendEstopReset();
int sendMachineOn();
int sendMachineOff();
int sendManual();
int sendAuto();
int sendMdi();
int sendSetTeleopEnable(int enable);
int sendHome(int joint);
int sendMdiCmd(const char *mdi);
int sendProgramOpen(const char *program);
int sendProgramRun(int line);
int sendProgramPause();
int sendProgramResume();
int sendJogStop(int ja, int jjogmode);
int sendJogCont(int ja, int jjogmode, double speed);
int sendJogIncr(int ja, int jjogmode, double speed, double incr);
int sendTrajSetAcceleration(double accel);
int sendTrajSetMaxAcceleration(double accel);
int sendSetDout(unsigned char index, unsigned char value);
#endif