|
1 | | -/* This a library for communication with Maxon Motors EPOS2 motor controllers |
| 1 | +/* This a library for communication with Maxon EPOS4 motor controllers |
2 | 2 | * using MATLAB. |
3 | 3 | * |
4 | | - * Copyright, Eugenio Yime Rodr�guez, 2015 |
| 4 | + * Copyright, Eugenio Yime Rodriguez, 2015 |
5 | 5 | * |
6 | 6 | */ |
7 | 7 |
|
|
12 | 12 | #include "Win2Linux.h" |
13 | 13 | #endif |
14 | 14 |
|
15 | | -void |
16 | | -mexFunction(int nlhs,mxArray *plhs[],int nrhs,const mxArray *prhs[]) |
17 | | -{ |
18 | | - DWORD ErrCode = 0; |
19 | | - BOOL Fault = FALSE; |
| 15 | +void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { |
| 16 | + DWORD ErrCode = 0; |
| 17 | + BOOL Fault = FALSE; |
20 | 18 | HANDLE mHandle; |
21 | | - WORD NodeID; |
22 | | - long lHandle; |
23 | | - int IdMode; |
24 | | - char ErrorInfo[255]; |
| 19 | + WORD NodeID; |
| 20 | + long lHandle; |
| 21 | + int IdMode; |
| 22 | + char ErrorInfo[255]; |
25 | 23 |
|
26 | 24 | /* Examine input (right-hand-side) arguments. */ |
27 | 25 | if (nrhs != 2) { |
28 | 26 | mexPrintf("Error: this function should be use with two input arguments\n"); |
29 | 27 | return; |
30 | 28 | } |
31 | 29 | /* Check first input, handle */ |
32 | | - if (mxGetM(prhs[0]) != 1 || mxGetM(prhs[0]) != 1 ) { |
33 | | - mexPrintf("Error: this function requires two input scalar\n"); |
34 | | - return; |
| 30 | + if (mxGetM(prhs[0]) != 1 || mxGetM(prhs[0]) != 1) { |
| 31 | + mexPrintf("Error: this function requires two input scalar\n"); |
| 32 | + return; |
35 | 33 | } |
36 | 34 | /* Check second input, nodeID */ |
37 | | - if (mxGetM(prhs[1]) != 1 || mxGetM(prhs[1]) != 1 ) { |
38 | | - mexPrintf("Error: this function requires two input scalar\n"); |
39 | | - return; |
| 35 | + if (mxGetM(prhs[1]) != 1 || mxGetM(prhs[1]) != 1) { |
| 36 | + mexPrintf("Error: this function requires two input scalar\n"); |
| 37 | + return; |
40 | 38 | } |
41 | 39 |
|
42 | 40 | /* Examine output (left-hand-side) arguments. */ |
43 | 41 | if (nlhs > 1) { |
44 | 42 | mexPrintf("Error: this function should be use with only one output argument\n"); |
45 | 43 | return; |
46 | 44 | } |
47 | | - |
| 45 | + |
48 | 46 | /* create output matrix */ |
49 | 47 | plhs[0] = mxCreateDoubleScalar(0.0); |
50 | 48 |
|
51 | 49 | /* first input */ |
52 | 50 | lHandle = (long) *mxGetPr(prhs[0]); |
53 | 51 | mHandle = LongToHandle(lHandle); |
54 | 52 | /* second input */ |
55 | | - NodeID = (WORD) *mxGetPr(prhs[1]); |
56 | | - |
| 53 | + NodeID = (WORD) * mxGetPr(prhs[1]); |
| 54 | + |
57 | 55 | /* Set State to Disable */ |
58 | 56 | if (!VCS_SetDisableState(mHandle, NodeID, &ErrCode)) { |
59 | 57 | VCS_GetErrorInfo(ErrCode, ErrorInfo, 255); |
|
0 commit comments