m5apiw32.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 1999-2006 AMTEC robotics GmbH
3  * Copyright (c) 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10 
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
19 #include "../Device/Device.h"
20 #include "../Util/IOFunctions.h"
21 #include "../Util/Message.h"
22 
23 //#pragma data_seg(".shared")
24 //static int g_iM5DllRefCount = 0;
25 //
26 //
27 #ifdef DEBUG_M5_API
28 M5DLL_API int g_iM5DebugLevel = 5; //debug level
29 M5DLL_API int g_iM5DebugFile = 1; //write debug file
30 M5DLL_API int g_iM5Debug = 0; //write debug output to stdout
31 #else
35 #endif
36 
37 //#pragma data_seg()
38 
39 //#pragma comment(linker, "/SECTION:.shared,RWS")
40 
41 static std::vector<CDevice*> g_apclDevice;
42 static std::vector<int> g_aiDeviceRefCount;
43 //HANDLE g_hM5Dll;
44 
45 #if defined (_WIN32)
46 BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved )
47 {
48 // BOOL bInit;
49 // CMessage clDebug("M5apiw32", g_iM5DebugLevel, g_iM5Debug, g_iM5DebugFile);
50 // clDebug.debug(0,"Entering M5Dll main");
51  switch (ul_reason_for_call)
52  {
53  // The DLL is loading due to process
54  // initialization or a call to LoadLibrary.
55 
56  case DLL_PROCESS_ATTACH:
57 // clDebug.debug(0,"Process attach M5Dll");
58  // Initialize critical section if this is the first process.
59 /*
60  if(g_iM5DllRefCount == 0)
61  {
62 
63  clDebug.debug(0,"Creating mutex for M5Dll");
64  g_hM5Dll = CreateMutex(NULL,FALSE,"M5MUTEX");
65  if(g_hM5Dll == NULL)
66  {
67  clDebug.debug(0,"Creation of mutex failed");
68  return FALSE;
69  }
70  g_pcDebugFileName = "M5Debug.txt";
71  }
72  else
73  {
74  clDebug.debug(0,"Opening mutex for M5Dll");
75  g_hM5Dll = OpenMutex(SYNCHRONIZE,FALSE,"M5MUTEX");
76  if(g_hM5Dll == NULL)
77  {
78  clDebug.debug(0,"Open of mutex failed");
79  return FALSE;
80  }
81  g_pcDebugFileName = "M5Debug.txt";
82  }
83 */
84 // g_iM5DllRefCount++;
85 // clDebug.debug(0,"M5Dll ref count %i", g_iM5DllRefCount);
86  break;
87 
88  // The attached process creates a new thread.
89 
90  case DLL_THREAD_ATTACH:
91 // clDebug.debug(0,"Thread attach M5Dll");
92 // clDebug.debug(0,"M5Dll ref count %i", g_iM5DllRefCount);
93  break;
94 
95  // The thread of the attached process terminates.
96 
97  case DLL_THREAD_DETACH:
98 // clDebug.debug(0,"Thread detach M5Dll");
99 // clDebug.debug(0,"M5Dll ref count %i", g_iM5DllRefCount);
100  break;
101 
102  // The DLL is unloading from a process due to
103  // process termination or a call to FreeLibrary.
104 
105  case DLL_PROCESS_DETACH:
106 // clDebug.debug(0,"Process detach M5Dll");
107 // g_iM5DllRefCount--;
108 // if(g_iM5DllRefCount == 0)
109 // clDebug.debug(0,"Deleting mutex for M5Dll");
110 // CloseHandle(g_hM5Dll);
111 // clDebug.debug(0,"M5Dll ref count %i", g_iM5DllRefCount);
112  break;
113 
114  default:
115  break;
116  }
117 
118  return TRUE;
119  UNREFERENCED_PARAMETER(hModule);
120  UNREFERENCED_PARAMETER(lpReserved);
121 }
122 #endif
123 
125 {
126  return M5DLLVERSION;
127 }
128 
129 M5DLL_API int WINAPI PCube_setDllDebug( int iDebug, int iDebugLevel, int iDebugFile )
130 {
131  g_iM5Debug = iDebug;
132  g_iM5DebugLevel = iDebugFile;
133  g_iM5DebugFile = iDebugLevel;
134  for(int i = 0; i < g_aiDeviceRefCount.size();i++)
135  if( g_apclDevice[i] != NULL )
136  {
137  g_apclDevice[i]->setDebug(iDebug);
138  g_apclDevice[i]->setDebugLevel(iDebugLevel);
139  g_apclDevice[i]->setDebugFile(iDebugFile);
140  }
141  return 0;
142 }
143 
144 M5DLL_API int WINAPI PCube_configFromFile( const char* acFileName )
145 {
146  int iRetVal, i, j;
147  char acBuffer[128];
148  char acInitString[128];
149  char acDevice[128];
150  char acModule[128];
151  char acDeviceName[128];
152  int iDeviceNumber = 0;
153  int iDeviceStart = 0;
154  int iModuleNumber = 0;
155  int iModuleStart = 0;
156  int iDeviceId = -1;
157  int iModuleId = -1;
158  float fHomeOffset = 0.0;
159  float fHomeVel = 0.0;
160  int iC0 = 0;
161  int iDamp = 0;
162  int iA0 = 0;
163  float fMinPos = 0.0;
164  float fMaxPos = 0.0;
165  float fMaxDeltaPos = 0.0;
166  float fMaxVel = 0.0;
167  float fMaxAcc = 0.0;
168  float fMaxCur = 0.0;
169  util_searchString("PROCESS", "Debug", "0", acBuffer, 128, acFileName);
170  g_iM5Debug = atoi(acBuffer);
171  util_searchString("PROCESS", "DebugLevel", "0", acBuffer, 128, acFileName);
172  g_iM5DebugLevel = atoi(acBuffer);
173  util_searchString("PROCESS", "DebugFile", "0", acBuffer, 128, acFileName);
174  g_iM5DebugFile = atoi(acBuffer);
175  CMessage clDebug("M5apiw32", g_iM5DebugLevel, g_iM5Debug, g_iM5DebugFile);
176 
177  iRetVal = util_searchString("PROCESS", "DeviceNumber", "0", acBuffer, 128, acFileName);
178  if(iRetVal < 0)
179  {
180  clDebug.warning("could not open file %s", acFileName);
181  return ERRID_DEV_OPENINIFILE;
182  }
183  iDeviceNumber = atoi(acBuffer);
184  util_searchString("PROCESS", "DeviceStart", "0", acBuffer, 128, acFileName);
185  iDeviceStart = atoi(acBuffer);
186  util_searchString("PROCESS", "ModuleNumber", "0", acBuffer, 128, acFileName);
187  iModuleNumber = atoi(acBuffer);
188  util_searchString("PROCESS", "ModuleStart", "0", acBuffer, 128, acFileName);
189  iModuleStart = atoi(acBuffer);
190 
191  for(i = 0; i < iDeviceNumber; i++)
192  {
193  sprintf(acDevice,"DEVICE_%02d",i + iDeviceStart);
194  util_searchString(acDevice, "DeviceName", "not available", acDeviceName, 128, acFileName);
195  util_searchString(acDevice, "InitString", "not available", acInitString, 128, acFileName);
196  clDebug.debug(0,"Trying to open device %s with initstring %s", acDeviceName, acInitString);
197  iRetVal = PCube_openDevice(&iDeviceId, acInitString);
198  if(iRetVal < 0)
199  {
200  clDebug.debug(0,"Cound not open device %s with initstring %s", acDeviceName, acInitString);
201  return iRetVal;
202  }
203  (g_apclDevice[iDeviceId])->setName(acDeviceName);
204  clDebug.debug(0,"Successfully open device %s with initstring %s", acDeviceName, acInitString);
205  }
206 
207  for(i = 0; i < iModuleNumber; i++)
208  {
209  sprintf(acModule,"MODULE_%02d",i + iModuleStart);
210  util_searchString(acModule, "DeviceName", "CAN", acDeviceName, 128, acFileName);
211  util_searchString(acModule, "ModuleId", "-1", acBuffer, 128, acFileName);
212  iModuleId = atoi(acBuffer);
213  clDebug.debug(0,"Trying to config module %i on device %s ", iModuleId, acDeviceName);
214  iDeviceId = -1;
215  for(j = 0; j < g_apclDevice.size(); j++)
216  {
217  if(g_apclDevice[j] != NULL)
218  if(strcmp(acDeviceName, (g_apclDevice[j])->getName()) == 0)
219  {
220  iDeviceId = j;
221  break;
222  }
223  }
224  if(iDeviceId < 0)
225  {
226  clDebug.debug(0,"Cound not found device %s", acDeviceName);
227  return ERRID_DEV_NODEVICENAME;
228  }
229  util_searchString(acModule, "HomeOffset", "not available", acBuffer, 128, acFileName);
230  if(strcmp(acBuffer, "not available") != 0)
231  {
232  fHomeOffset = atof(acBuffer);
233  iRetVal = PCube_setHomeOffset(iDeviceId, iModuleId, fHomeOffset);
234  if(iRetVal < 0)
235  {
236  clDebug.debug(0,"Cound not set homeoffset of module %i on device %s", iModuleId, acDeviceName);
237  return iRetVal;
238  }
239  clDebug.debug(0,"Set homeoffset to %f of module %i on device %s", fHomeOffset, iModuleId, acDeviceName);
240  }
241  util_searchString(acModule, "HomeVel", "not available", acBuffer, 128, acFileName);
242  if(strcmp(acBuffer, "not available") != 0)
243  {
244  fHomeVel = atof(acBuffer);
245  iRetVal = PCube_setHomeVel(iDeviceId, iModuleId, fHomeVel);
246  if(iRetVal < 0)
247  {
248  clDebug.debug(0,"Cound not set homevel of module %i on device %s", iModuleId, acDeviceName);
249  return iRetVal;
250  }
251  clDebug.debug(0,"Set homevel to %f of module %i on device %s", fHomeVel, iModuleId, acDeviceName);
252  }
253  util_searchString(acModule, "C0", "not available", acBuffer, 128, acFileName);
254  if(strcmp(acBuffer, "not available") != 0)
255  {
256  iC0 = atoi(acBuffer);
257  iRetVal = PCube_setC0(iDeviceId, iModuleId, iC0);
258  if(iRetVal < 0)
259  {
260  clDebug.debug(0,"Cound not set C0 of module %i on device %s", iModuleId, acDeviceName);
261  return iRetVal;
262  }
263  clDebug.debug(0,"Set CO to %i of module %i on device %s", iC0, iModuleId, acDeviceName);
264  }
265  util_searchString(acModule, "Damp", "not available", acBuffer, 128, acFileName);
266  if(strcmp(acBuffer, "not available") != 0)
267  {
268  iDamp= atoi(acBuffer);
269  iRetVal = PCube_setDamp(iDeviceId, iModuleId, iDamp);
270  if(iRetVal < 0)
271  {
272  clDebug.debug(0,"Cound not set damp of module %i on device %s", iModuleId, acDeviceName);
273  return iRetVal;
274  }
275  clDebug.debug(0,"Set damp to %i of module %i on device %s", iDamp, iModuleId, acDeviceName);
276  }
277  util_searchString(acModule, "A0", "not available", acBuffer, 128, acFileName);
278  if(strcmp(acBuffer, "not available") != 0)
279  {
280  iA0 = atoi(acBuffer);
281  iRetVal = PCube_setA0(iDeviceId, iModuleId, iA0);
282  if(iRetVal < 0)
283  {
284  clDebug.debug(0,"Cound not set A0 of module %i on device %s", iModuleId, acDeviceName);
285  return iRetVal;
286  }
287  clDebug.debug(0,"Set A0 to %i of module %i on device %s", iA0, iModuleId, acDeviceName);
288  }
289  util_searchString(acModule, "MinPos", "not available", acBuffer, 128, acFileName);
290  if(strcmp(acBuffer, "not available") != 0)
291  {
292  fMinPos = atof(acBuffer);
293  iRetVal = PCube_setMinPos(iDeviceId, iModuleId, fMinPos);
294  if(iRetVal < 0)
295  {
296  clDebug.debug(0,"Cound not set minpos of module %i on device %s", iModuleId, acDeviceName);
297  return iRetVal;
298  }
299  clDebug.debug(0,"Set minpos to %f of module %i on device %s", fMinPos, iModuleId, acDeviceName);
300  }
301  util_searchString(acModule, "MaxPos", "not available", acBuffer, 128, acFileName);
302  if(strcmp(acBuffer, "not available") != 0)
303  {
304  fMaxPos = atof(acBuffer);
305  iRetVal = PCube_setMaxPos(iDeviceId, iModuleId, fMaxPos);
306  if(iRetVal < 0)
307  {
308  clDebug.debug(0,"Cound not set maxpos of module %i on device %s", iModuleId, acDeviceName);
309  return iRetVal;
310  }
311  clDebug.debug(0,"Set maxpos to %f of module %i on device %s", fMaxPos, iModuleId, acDeviceName);
312  }
313  util_searchString(acModule, "MaxDeltaPos", "not available", acBuffer, 128, acFileName);
314  if(strcmp(acBuffer, "not available") != 0)
315  {
316  fMaxDeltaPos = atof(acBuffer);
317  iRetVal = PCube_setMaxDeltaPos(iDeviceId, iModuleId, fMaxDeltaPos);
318  if(iRetVal < 0)
319  {
320  clDebug.debug(0,"Cound not set maxdeltapos of module %i on device %s", iModuleId, acDeviceName);
321  return iRetVal;
322  }
323  clDebug.debug(0,"Set maxdeltapos to %f of module %i on device %s", fMaxDeltaPos, iModuleId, acDeviceName);
324  }
325  util_searchString(acModule, "MaxVel", "not available", acBuffer, 128, acFileName);
326  if(strcmp(acBuffer, "not available") != 0)
327  {
328  fMaxVel = atof(acBuffer);
329  iRetVal = PCube_setMaxVel(iDeviceId, iModuleId, fMaxVel);
330  if(iRetVal < 0)
331  {
332  clDebug.debug(0,"Cound not set maxvel of module %i on device %s", iModuleId, acDeviceName);
333  return iRetVal;
334  }
335  clDebug.debug(0,"Set maxvel to %f of module %i on device %s", fMaxVel, iModuleId, acDeviceName);
336  }
337  util_searchString(acModule, "MaxAcc", "not available", acBuffer, 128, acFileName);
338  if(strcmp(acBuffer, "not available") != 0)
339  {
340  fMaxAcc = atof(acBuffer);
341  iRetVal = PCube_setMaxAcc(iDeviceId, iModuleId, fMaxAcc);
342  if(iRetVal < 0)
343  {
344  clDebug.debug(0,"Cound not set maxacc of module %i on device %s", iModuleId, acDeviceName);
345  return iRetVal;
346  }
347  clDebug.debug(0,"Set maxacc to %f of module %i on device %s", fMaxAcc, iModuleId, acDeviceName);
348  }
349  util_searchString(acModule, "MaxCur", "not available", acBuffer, 128, acFileName);
350  if(strcmp(acBuffer, "not available") != 0)
351  {
352  fMaxCur = atof(acBuffer);
353  iRetVal = PCube_setMaxCur(iDeviceId, iModuleId, fMaxCur);
354  if(iRetVal < 0)
355  {
356  clDebug.debug(0,"Cound not set maxcur of module %i on device %s", iModuleId, acDeviceName);
357  return iRetVal;
358  }
359  clDebug.debug(0,"Set maxcur to %f of module %i on device %s", fMaxCur, iModuleId, acDeviceName);
360  }
361  clDebug.debug(0,"Successfully config module %i on device %s ", iModuleId, acDeviceName);
362  }
363  return 0;
364 }
365 
366 M5DLL_API int WINAPI PCube_openDevice( int* piDeviceId, const char* acInitString )
367 {
368  int iRetVal = 0;
369  int i, iDeviceNumber;
370  bool bReplace = false;
371  CMessage clDebug("M5apiw32", g_iM5DebugLevel, g_iM5Debug, g_iM5DebugFile);
372  if(acInitString == NULL || strlen(acInitString) == 0)
373  {
374  return ERRID_DEV_NOINITSTRING;
375  }
376  iDeviceNumber = g_apclDevice.size();
377  clDebug.debug(0,"number of possible devices %i", iDeviceNumber);
378  for (i=0;i<iDeviceNumber;i++)
379  {
380  clDebug.debug(0,"checking device %i", i);
381  if(g_apclDevice[i] != NULL)
382  if(strcmp(g_apclDevice[i]->getInitString(),acInitString)==0)
383  {
384  *piDeviceId = i;
385  g_aiDeviceRefCount[i]++;
386  clDebug.debug(0,"using device with id %i", i);
387  return 0;
388  }
389  }
390  CDevice* pclDevice = newDevice(acInitString);
391  if(pclDevice == NULL)
392  {
393  return ERRID_DEV_NODEVICENAME;
394  }
395  clDebug.debug(0,"created new device");
396  pclDevice->setDebug(g_iM5Debug);
397  pclDevice->setDebugLevel(g_iM5DebugLevel);
398  pclDevice->setDebugFile(g_iM5DebugFile);
399  iRetVal = pclDevice->init(acInitString);
400  if(iRetVal != 0)
401  {
402  clDebug.debug(0,"init error device");
403  delete pclDevice;
404  return iRetVal;
405  }
406 
407  for (i=0;i<iDeviceNumber;i++)
408  if(g_apclDevice[i] == NULL)
409  {
410  g_apclDevice[i] = pclDevice;
411  g_aiDeviceRefCount[i] = 1;
412  *piDeviceId = i;
413  bReplace = true;
414  clDebug.debug(0,"replacing device with id %i", i);
415  break;
416  }
417  if(bReplace == false)
418  {
419  g_apclDevice.push_back(pclDevice);
420  g_aiDeviceRefCount.push_back(1);
421  *piDeviceId = g_apclDevice.size()-1;
422  clDebug.debug(0,"adding device with id %i", *piDeviceId);
423  }
424  return iRetVal;
425 }
426 
427 M5DLL_API int WINAPI PCube_closeDevice( int iDeviceId )
428 {
429  if(0 > iDeviceId || iDeviceId >= g_aiDeviceRefCount.size())
431  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
433  if( g_apclDevice[iDeviceId] == NULL )
435 
436  g_aiDeviceRefCount[iDeviceId]--;
437  if (g_aiDeviceRefCount[iDeviceId]>0)
438  return 0;
439 
440  int iRetVal = g_apclDevice[iDeviceId]->exit();
441  delete g_apclDevice[iDeviceId];
442  g_apclDevice[iDeviceId] = NULL;
443  return iRetVal;
444 }
445 
447 {
448  int i;
449  for(i = 0; i < g_aiDeviceRefCount.size();i++)
450  g_aiDeviceRefCount[i] = 0;
451  for(i = 0; i < g_aiDeviceRefCount.size();i++)
452  if( g_apclDevice[i] != NULL )
453  {
454  g_apclDevice[i]->exit();
455  delete g_apclDevice[i];
456  g_apclDevice[i] = NULL;
457  }
458  return 0;
459 }
460 
461 M5DLL_API const char* WINAPI PCube_getDeviceRevision( int iDeviceId )
462 {
463  static const char acString[] = "";
464  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
465  return acString;
466  if( g_apclDevice[iDeviceId] == NULL )
467  return acString;
468 
469  return g_apclDevice[iDeviceId]->getRevision();
470 }
471 
472 M5DLL_API const char* WINAPI PCube_getDeviceName( int iDeviceId )
473 {
474  static const char acString[] = "";
475  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
476  return acString;
477  if( g_apclDevice[iDeviceId] == NULL )
478  return acString;
479 
480  return g_apclDevice[iDeviceId]->getName();
481 }
482 
483 M5DLL_API const char* WINAPI PCube_getDeviceInitString( int iDeviceId )
484 {
485  static const char acString[] = "";
486  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
487  return acString;
488  if( g_apclDevice[iDeviceId] == NULL )
489  return acString;
490 
491  return g_apclDevice[iDeviceId]->getInitString();
492 }
493 
494 M5DLL_API int WINAPI PCube_setDeviceName( int iDeviceId, const char* acDeviceName )
495 {
496  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
498  if( g_apclDevice[iDeviceId] == NULL )
500 
501  g_apclDevice[iDeviceId]->setName(acDeviceName);
502  return 0;
503 }
504 
505 M5DLL_API int WINAPI PCube_setDeviceDebug( int iDeviceId, int iDebug, int iDebugLevel, int iDebugFile )
506 {
507  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
509  if( g_apclDevice[iDeviceId] == NULL )
511 
512  g_apclDevice[iDeviceId]->setDebug(iDebug);
513  g_apclDevice[iDeviceId]->setDebugLevel(iDebugLevel);
514  g_apclDevice[iDeviceId]->setDebugFile(iDebugFile);
515  return 0;
516 }
517 
519 {
520  int iDeviceCount = 0;
521  for(int i = 0; i < g_apclDevice.size(); i++)
522  if( g_apclDevice[i] != NULL )
523  iDeviceCount++;
524 
525  return iDeviceCount;
526 }
527 
529 {
530  int iDeviceCount = 0;
531  for(int i = 0; i < g_apclDevice.size(); i++)
532  if( g_apclDevice[i] != NULL )
533  {
534  *(aiIdMap++) = i;
535  iDeviceCount++;
536  }
537 
538  return iDeviceCount;
539 }
540 
542 {
543  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
545  if( g_apclDevice[iDeviceId] == NULL )
547 
548  return g_apclDevice[iDeviceId]->getModuleCount();
549 }
550 
551 M5DLL_API int WINAPI PCube_getModuleIdMap( int iDeviceId, int* aiIdMap )
552 {
553  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
555  if( g_apclDevice[iDeviceId] == NULL )
557 
558  int i;
559  static std::vector<int> aiModules;
560  int iRetVal = g_apclDevice[iDeviceId]->getModuleIdMap(aiModules);
561  for(i = 0; i < aiModules.size(); i++)
562  *(aiIdMap++) = aiModules[i];
563  for(i = aiModules.size(); i < MAX_MODULES; i++)
564  *(aiIdMap++) = 0;
565  return iRetVal;
566 }
567 
568 M5DLL_API int WINAPI PCube_getModuleState( int iDeviceId, int iModuleId, unsigned long* puiState )
569 {
570  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
572  if( g_apclDevice[iDeviceId] == NULL )
574 
575  int iRetVal = g_apclDevice[iDeviceId]->getModuleState( iModuleId, puiState );
576 
577  return iRetVal;
578 }
579 
580 M5DLL_API int WINAPI PCube_getModuleType( int iDeviceId, int iModuleId, unsigned char* pucValue )
581 {
582  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
584  if( g_apclDevice[iDeviceId] == NULL )
586 
587  int iRetVal = g_apclDevice[iDeviceId]->getModuleType( iModuleId, pucValue );
588 
589  return iRetVal;
590 }
591 
592 M5DLL_API int WINAPI PCube_getModuleVersion( int iDeviceId, int iModuleId, unsigned short* puiValue )
593 {
594  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
596  if( g_apclDevice[iDeviceId] == NULL )
598 
599  int iRetVal = g_apclDevice[iDeviceId]->getModuleVersion( iModuleId, puiValue );
600 
601  return iRetVal;
602 }
603 
604 M5DLL_API int WINAPI PCube_getModuleSerialNo( int iDeviceId, int iModuleId, unsigned long* puiValue )
605 {
606  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
608  if( g_apclDevice[iDeviceId] == NULL )
610 
611  int iRetVal = g_apclDevice[iDeviceId]->getModuleSerialNo( iModuleId, puiValue );
612 
613  return iRetVal;
614 }
615 
616 M5DLL_API int WINAPI PCube_getDefConfig( int iDeviceId, int iModuleId, unsigned long* puiValue )
617 {
618  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
620  if( g_apclDevice[iDeviceId] == NULL )
622 
623  int iRetVal = g_apclDevice[iDeviceId]->getDefConfig( iModuleId, puiValue );
624 
625  return iRetVal;
626 }
627 
628 M5DLL_API int WINAPI PCube_getDefSetup( int iDeviceId, int iModuleId, unsigned long* puiValue )
629 {
630  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
632  if( g_apclDevice[iDeviceId] == NULL )
634 
635  int iRetVal = g_apclDevice[iDeviceId]->getDefSetup( iModuleId, puiValue );
636 
637  return iRetVal;
638 }
639 
640 M5DLL_API int WINAPI PCube_getDefBaudRate( int iDeviceId, int iModuleId, unsigned char* pucValue )
641 {
642  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
644  if( g_apclDevice[iDeviceId] == NULL )
646 
647  int iRetVal = g_apclDevice[iDeviceId]->getDefBaudRate( iModuleId, pucValue );
648 
649  return iRetVal;
650 }
651 
652 M5DLL_API int WINAPI PCube_getDefBurnCount( int iDeviceId, int iModuleId, unsigned char* pucValue )
653 {
654  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
656  if( g_apclDevice[iDeviceId] == NULL )
658 
659  int iRetVal = g_apclDevice[iDeviceId]->getDefBurnCount( iModuleId, pucValue );
660 
661  return iRetVal;
662 }
663 
664 M5DLL_API int WINAPI PCube_getDefGearRatio( int iDeviceId, int iModuleId, float* pfValue )
665 {
666  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
668  if( g_apclDevice[iDeviceId] == NULL )
670 
671  int iRetVal = g_apclDevice[iDeviceId]->getDefGearRatio( iModuleId, pfValue );
672 
673  return iRetVal;
674 }
675 
676 M5DLL_API int WINAPI PCube_getDefLinearRatio( int iDeviceId, int iModuleId, float* pfValue )
677 {
678  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
680  if( g_apclDevice[iDeviceId] == NULL )
682 
683  int iRetVal = g_apclDevice[iDeviceId]->getDefLinearRatio( iModuleId, pfValue );
684 
685  return iRetVal;
686 }
687 
688 M5DLL_API int WINAPI PCube_getDefCurRatio( int iDeviceId, int iModuleId, float* pfValue )
689 {
690  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
692  if( g_apclDevice[iDeviceId] == NULL )
694 
695  int iRetVal = g_apclDevice[iDeviceId]->getDefCurRatio( iModuleId, pfValue );
696 
697  return iRetVal;
698 }
699 
700 M5DLL_API int WINAPI PCube_getDefBrakeTimeOut( int iDeviceId, int iModuleId, unsigned short* puiValue )
701 {
702  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
704  if( g_apclDevice[iDeviceId] == NULL )
706 
707  int iRetVal = g_apclDevice[iDeviceId]->getDefBrakeTimeOut( iModuleId, puiValue );
708 
709  return iRetVal;
710 }
711 
712 M5DLL_API int WINAPI PCube_getDefIncPerTurn( int iDeviceId, int iModuleId, unsigned long* puiValue )
713 {
714  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
716  if( g_apclDevice[iDeviceId] == NULL )
718 
719  int iRetVal = g_apclDevice[iDeviceId]->getDefIncPerTurn( iModuleId, puiValue );
720 
721  return iRetVal;
722 }
723 
724 M5DLL_API int WINAPI PCube_getDefDioData( int iDeviceId, int iModuleId, unsigned long* puiValue )
725 {
726  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
728  if( g_apclDevice[iDeviceId] == NULL )
730 
731  int iRetVal = g_apclDevice[iDeviceId]->getDefDioData( iModuleId, puiValue );
732 
733  return iRetVal;
734 }
735 
736 M5DLL_API int WINAPI PCube_getDefA0( int iDeviceId, int iModuleId, short* piValue )
737 {
738  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
740  if( g_apclDevice[iDeviceId] == NULL )
742 
743  int iRetVal = g_apclDevice[iDeviceId]->getDefA0( iModuleId, piValue );
744 
745  return iRetVal;
746 }
747 
748 M5DLL_API int WINAPI PCube_getDefC0( int iDeviceId, int iModuleId, short* piValue )
749 {
750  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
752  if( g_apclDevice[iDeviceId] == NULL )
754 
755  int iRetVal = g_apclDevice[iDeviceId]->getDefC0( iModuleId, piValue );
756 
757  return iRetVal;
758 }
759 
760 M5DLL_API int WINAPI PCube_getDefDamp( int iDeviceId, int iModuleId, short* piValue )
761 {
762  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
764  if( g_apclDevice[iDeviceId] == NULL )
766 
767  int iRetVal = g_apclDevice[iDeviceId]->getDefDamp( iModuleId, piValue );
768 
769  return iRetVal;
770 }
771 
772 M5DLL_API int WINAPI PCube_getDefHomeOffset( int iDeviceId, int iModuleId, float* pfValue )
773 {
774  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
776  if( g_apclDevice[iDeviceId] == NULL )
778 
779  int iRetVal = g_apclDevice[iDeviceId]->getDefHomeOffset( iModuleId, pfValue );
780 
781  return iRetVal;
782 }
783 
784 M5DLL_API int WINAPI PCube_getDefHomeVel( int iDeviceId, int iModuleId, float* pfValue )
785 {
786  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
788  if( g_apclDevice[iDeviceId] == NULL )
790 
791  int iRetVal = g_apclDevice[iDeviceId]->getDefHomeVel( iModuleId, pfValue );
792 
793  return iRetVal;
794 }
795 
796 M5DLL_API int WINAPI PCube_getDefMinPos( int iDeviceId, int iModuleId, float* pfValue )
797 {
798  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
800  if( g_apclDevice[iDeviceId] == NULL )
802 
803  int iRetVal = g_apclDevice[iDeviceId]->getDefMinPos( iModuleId, pfValue );
804 
805  return iRetVal;
806 }
807 
808 M5DLL_API int WINAPI PCube_getDefMaxPos( int iDeviceId, int iModuleId, float* pfValue )
809 {
810  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
812  if( g_apclDevice[iDeviceId] == NULL )
814 
815  int iRetVal = g_apclDevice[iDeviceId]->getDefMaxPos( iModuleId, pfValue );
816 
817  return iRetVal;
818 }
819 
820 M5DLL_API int WINAPI PCube_getDefMaxVel( int iDeviceId, int iModuleId, float* pfValue )
821 {
822  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
824  if( g_apclDevice[iDeviceId] == NULL )
826 
827  int iRetVal = g_apclDevice[iDeviceId]->getDefMaxVel( iModuleId, pfValue );
828 
829  return iRetVal;
830 }
831 
832 M5DLL_API int WINAPI PCube_getDefMaxAcc( int iDeviceId, int iModuleId, float* pfValue )
833 {
834  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
836  if( g_apclDevice[iDeviceId] == NULL )
838 
839  int iRetVal = g_apclDevice[iDeviceId]->getDefMaxAcc( iModuleId, pfValue );
840 
841  return iRetVal;
842 }
843 
844 M5DLL_API int WINAPI PCube_getDefMaxCur( int iDeviceId, int iModuleId, float* pfValue )
845 {
846  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
848  if( g_apclDevice[iDeviceId] == NULL )
850 
851  int iRetVal = g_apclDevice[iDeviceId]->getDefMaxCur( iModuleId, pfValue );
852 
853  return iRetVal;
854 }
855 
856 M5DLL_API int WINAPI PCube_getDefMaxDeltaPos( int iDeviceId, int iModuleId, float* pfValue )
857 {
858  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
860  if( g_apclDevice[iDeviceId] == NULL )
862 
863  int iRetVal = g_apclDevice[iDeviceId]->getDefMaxDeltaPos( iModuleId, pfValue );
864 
865  return iRetVal;
866 }
867 
868 M5DLL_API int WINAPI PCube_getConfig( int iDeviceId, int iModuleId, unsigned long* puiValue )
869 {
870  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
872  if( g_apclDevice[iDeviceId] == NULL )
874 
875  int iRetVal = g_apclDevice[iDeviceId]->getConfig( iModuleId, puiValue );
876 
877  return iRetVal;
878 }
879 
880 M5DLL_API int WINAPI PCube_getHomeOffset( int iDeviceId, int iModuleId, float* pValue )
881 {
882  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
884  if( g_apclDevice[iDeviceId] == NULL )
886 
887  int iRetVal = g_apclDevice[iDeviceId]->getHomeOffset( iModuleId, pValue );
888 
889  return iRetVal;
890 }
891 
892 M5DLL_API int WINAPI PCube_getHomeOffsetInc( int iDeviceId, int iModuleId, long* piValue )
893 {
894  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
896  if( g_apclDevice[iDeviceId] == NULL )
898 
899  int iRetVal = g_apclDevice[iDeviceId]->getHomeOffsetInc( iModuleId, piValue );
900 
901  return iRetVal;
902 }
903 
904 M5DLL_API int WINAPI PCube_getIncRatio( int iDeviceId, int iModuleId, float* pValue )
905 {
906  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
908  if( g_apclDevice[iDeviceId] == NULL )
910 
911  int iRetVal = g_apclDevice[iDeviceId]->getIncRatio( iModuleId, pValue );
912 
913  return iRetVal;
914 }
915 
916 M5DLL_API int WINAPI PCube_getDioData( int iDeviceId, int iModuleId, unsigned long* puiValue )
917 {
918  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
920  if( g_apclDevice[iDeviceId] == NULL )
922 
923  int iRetVal = g_apclDevice[iDeviceId]->getDioData( iModuleId, puiValue );
924 
925  return iRetVal;
926 }
927 
928 M5DLL_API int WINAPI PCube_getA0( int iDeviceId, int iModuleId, short* piValue )
929 {
930  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
932  if( g_apclDevice[iDeviceId] == NULL )
934 
935  int iRetVal = g_apclDevice[iDeviceId]->getA0( iModuleId, piValue );
936 
937  return iRetVal;
938 }
939 
940 M5DLL_API int WINAPI PCube_getC0( int iDeviceId, int iModuleId, short* piValue )
941 {
942  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
944  if( g_apclDevice[iDeviceId] == NULL )
946 
947  int iRetVal = g_apclDevice[iDeviceId]->getC0( iModuleId, piValue );
948 
949  return iRetVal;
950 }
951 
952 M5DLL_API int WINAPI PCube_getDamp( int iDeviceId, int iModuleId, short* piValue )
953 {
954  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
956  if( g_apclDevice[iDeviceId] == NULL )
958 
959  int iRetVal = g_apclDevice[iDeviceId]->getDamp( iModuleId, piValue );
960 
961  return iRetVal;
962 }
963 
964 M5DLL_API int WINAPI PCube_getPos( int iDeviceId, int iModuleId, float* pfPos )
965 {
966  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
968  if( g_apclDevice[iDeviceId] == NULL )
970 
971  int iRetVal = g_apclDevice[iDeviceId]->getPos( iModuleId, pfPos );
972 
973  return iRetVal;
974 }
975 
976 M5DLL_API int WINAPI PCube_getVel( int iDeviceId, int iModuleId, float* pfVel )
977 {
978  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
980  if( g_apclDevice[iDeviceId] == NULL )
982 
983  int iRetVal = g_apclDevice[iDeviceId]->getVel( iModuleId, pfVel );
984 
985  return iRetVal;
986 }
987 
988 M5DLL_API int WINAPI PCube_getCur( int iDeviceId, int iModuleId, float* pfCur )
989 {
990  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
992  if( g_apclDevice[iDeviceId] == NULL )
994 
995  int iRetVal = g_apclDevice[iDeviceId]->getCur( iModuleId, pfCur );
996 
997  return iRetVal;
998 }
999 
1000 M5DLL_API int WINAPI PCube_getMinPos( int iDeviceId, int iModuleId, float* pfValue )
1001 {
1002  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1003  return ERRID_DEV_WRONGDEVICEID;
1004  if( g_apclDevice[iDeviceId] == NULL )
1005  return ERRID_DEV_NOTINITIALIZED;
1006 
1007  int iRetVal = g_apclDevice[iDeviceId]->getMinPos( iModuleId, pfValue );
1008 
1009  return iRetVal;
1010 }
1011 
1012 M5DLL_API int WINAPI PCube_getMaxPos( int iDeviceId, int iModuleId, float* pfValue )
1013 {
1014  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1015  return ERRID_DEV_WRONGDEVICEID;
1016  if( g_apclDevice[iDeviceId] == NULL )
1017  return ERRID_DEV_NOTINITIALIZED;
1018 
1019  int iRetVal = g_apclDevice[iDeviceId]->getMaxPos( iModuleId, pfValue );
1020 
1021  return iRetVal;
1022 }
1023 
1024 M5DLL_API int WINAPI PCube_getMaxVel( int iDeviceId, int iModuleId, float* pfValue )
1025 {
1026  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1027  return ERRID_DEV_WRONGDEVICEID;
1028  if( g_apclDevice[iDeviceId] == NULL )
1029  return ERRID_DEV_NOTINITIALIZED;
1030 
1031  int iRetVal = g_apclDevice[iDeviceId]->getMaxVel( iModuleId, pfValue );
1032 
1033  return iRetVal;
1034 }
1035 
1036 M5DLL_API int WINAPI PCube_getMaxAcc( int iDeviceId, int iModuleId, float* pfValue )
1037 {
1038  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1039  return ERRID_DEV_WRONGDEVICEID;
1040  if( g_apclDevice[iDeviceId] == NULL )
1041  return ERRID_DEV_NOTINITIALIZED;
1042 
1043  int iRetVal = g_apclDevice[iDeviceId]->getMaxAcc( iModuleId, pfValue );
1044 
1045  return iRetVal;
1046 }
1047 
1048 M5DLL_API int WINAPI PCube_getMaxCur( int iDeviceId, int iModuleId, float* pfValue )
1049 {
1050  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1051  return ERRID_DEV_WRONGDEVICEID;
1052  if( g_apclDevice[iDeviceId] == NULL )
1053  return ERRID_DEV_NOTINITIALIZED;
1054 
1055  int iRetVal = g_apclDevice[iDeviceId]->getMaxCur( iModuleId, pfValue );
1056 
1057  return iRetVal;
1058 }
1059 
1060 M5DLL_API int WINAPI PCube_getDeltaPos( int iDeviceId, int iModuleId, float* pfValue )
1061 {
1062  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1063  return ERRID_DEV_WRONGDEVICEID;
1064  if( g_apclDevice[iDeviceId] == NULL )
1065  return ERRID_DEV_NOTINITIALIZED;
1066 
1067  int iRetVal = g_apclDevice[iDeviceId]->getDeltaPos( iModuleId, pfValue );
1068 
1069  return iRetVal;
1070 }
1071 
1072 M5DLL_API int WINAPI PCube_getMaxDeltaPos( int iDeviceId, int iModuleId, float* pfValue )
1073 {
1074  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1075  return ERRID_DEV_WRONGDEVICEID;
1076  if( g_apclDevice[iDeviceId] == NULL )
1077  return ERRID_DEV_NOTINITIALIZED;
1078 
1079  int iRetVal = g_apclDevice[iDeviceId]->getMaxDeltaPos( iModuleId, pfValue );
1080 
1081  return iRetVal;
1082 }
1083 
1084 M5DLL_API int WINAPI PCube_getSavePos( int iDeviceId, int iModuleId, float* pfValue )
1085 {
1086  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1087  return ERRID_DEV_WRONGDEVICEID;
1088  if( g_apclDevice[iDeviceId] == NULL )
1089  return ERRID_DEV_NOTINITIALIZED;
1090 
1091  int iRetVal = g_apclDevice[iDeviceId]->getSavePos( iModuleId, pfValue );
1092 
1093  return iRetVal;
1094 }
1095 
1096 M5DLL_API int WINAPI PCube_getIPolVel( int iDeviceId, int iModuleId, float* pValue )
1097 {
1098  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1099  return ERRID_DEV_WRONGDEVICEID;
1100  if( g_apclDevice[iDeviceId] == NULL )
1101  return ERRID_DEV_NOTINITIALIZED;
1102 
1103  int iRetVal = g_apclDevice[iDeviceId]->getIPolVel( iModuleId, pValue );
1104 
1105  return iRetVal;
1106 }
1107 
1108 M5DLL_API int WINAPI PCube_getPosCountInc( int iDeviceId, int iModuleId, long* piValue )
1109 {
1110  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1111  return ERRID_DEV_WRONGDEVICEID;
1112  if( g_apclDevice[iDeviceId] == NULL )
1113  return ERRID_DEV_NOTINITIALIZED;
1114 
1115  int iRetVal = g_apclDevice[iDeviceId]->getPosCountInc( iModuleId, piValue );
1116 
1117  return iRetVal;
1118 }
1119 
1120 M5DLL_API int WINAPI PCube_getPosInc( int iDeviceId, int iModuleId, long* piValue )
1121 {
1122  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1123  return ERRID_DEV_WRONGDEVICEID;
1124  if( g_apclDevice[iDeviceId] == NULL )
1125  return ERRID_DEV_NOTINITIALIZED;
1126 
1127  int iRetVal = g_apclDevice[iDeviceId]->getPosInc( iModuleId, piValue );
1128 
1129  return iRetVal;
1130 }
1131 
1132 M5DLL_API int WINAPI PCube_getVelInc( int iDeviceId, int iModuleId, long* piValue )
1133 {
1134  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1135  return ERRID_DEV_WRONGDEVICEID;
1136  if( g_apclDevice[iDeviceId] == NULL )
1137  return ERRID_DEV_NOTINITIALIZED;
1138 
1139  int iRetVal = g_apclDevice[iDeviceId]->getVelInc( iModuleId, piValue );
1140 
1141  return iRetVal;
1142 }
1143 
1144 M5DLL_API int WINAPI PCube_getCurInc( int iDeviceId, int iModuleId, short* piValue )
1145 {
1146  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1147  return ERRID_DEV_WRONGDEVICEID;
1148  if( g_apclDevice[iDeviceId] == NULL )
1149  return ERRID_DEV_NOTINITIALIZED;
1150 
1151  int iRetVal = g_apclDevice[iDeviceId]->getCurInc( iModuleId, piValue );
1152 
1153  return iRetVal;
1154 }
1155 
1156 M5DLL_API int WINAPI PCube_getMinPosInc( int iDeviceId, int iModuleId, long* piValue )
1157 {
1158  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1159  return ERRID_DEV_WRONGDEVICEID;
1160  if( g_apclDevice[iDeviceId] == NULL )
1161  return ERRID_DEV_NOTINITIALIZED;
1162 
1163  int iRetVal = g_apclDevice[iDeviceId]->getMinPosInc( iModuleId, piValue );
1164 
1165  return iRetVal;
1166 }
1167 
1168 M5DLL_API int WINAPI PCube_getMaxPosInc( int iDeviceId, int iModuleId, long* piValue )
1169 {
1170  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1171  return ERRID_DEV_WRONGDEVICEID;
1172  if( g_apclDevice[iDeviceId] == NULL )
1173  return ERRID_DEV_NOTINITIALIZED;
1174 
1175  int iRetVal = g_apclDevice[iDeviceId]->getMaxPosInc( iModuleId, piValue );
1176 
1177  return iRetVal;
1178 }
1179 
1180 M5DLL_API int WINAPI PCube_getMaxVelInc( int iDeviceId, int iModuleId, long* piValue )
1181 {
1182  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1183  return ERRID_DEV_WRONGDEVICEID;
1184  if( g_apclDevice[iDeviceId] == NULL )
1185  return ERRID_DEV_NOTINITIALIZED;
1186 
1187  int iRetVal = g_apclDevice[iDeviceId]->getMaxVelInc( iModuleId, piValue );
1188 
1189  return iRetVal;
1190 }
1191 
1192 M5DLL_API int WINAPI PCube_getMaxAccInc( int iDeviceId, int iModuleId, long* piValue )
1193 {
1194  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1195  return ERRID_DEV_WRONGDEVICEID;
1196  if( g_apclDevice[iDeviceId] == NULL )
1197  return ERRID_DEV_NOTINITIALIZED;
1198 
1199  int iRetVal = g_apclDevice[iDeviceId]->getMaxAccInc( iModuleId, piValue );
1200 
1201  return iRetVal;
1202 }
1203 
1204 M5DLL_API int WINAPI PCube_getDeltaPosInc( int iDeviceId, int iModuleId, long* piValue )
1205 {
1206  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1207  return ERRID_DEV_WRONGDEVICEID;
1208  if( g_apclDevice[iDeviceId] == NULL )
1209  return ERRID_DEV_NOTINITIALIZED;
1210 
1211  int iRetVal = g_apclDevice[iDeviceId]->getDeltaPosInc( iModuleId, piValue );
1212 
1213  return iRetVal;
1214 }
1215 
1216 M5DLL_API int WINAPI PCube_getMaxDeltaPosInc( int iDeviceId, int iModuleId, long* piValue )
1217 {
1218  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1219  return ERRID_DEV_WRONGDEVICEID;
1220  if( g_apclDevice[iDeviceId] == NULL )
1221  return ERRID_DEV_NOTINITIALIZED;
1222 
1223  int iRetVal = g_apclDevice[iDeviceId]->getMaxDeltaPosInc( iModuleId, piValue );
1224 
1225  return iRetVal;
1226 }
1227 
1228 M5DLL_API int WINAPI PCube_getStateDioPos( int iDeviceId, int iModuleId, unsigned long* puiState, unsigned char* pucDio, float* pfPos )
1229 {
1230  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1231  return ERRID_DEV_WRONGDEVICEID;
1232  if( g_apclDevice[iDeviceId] == NULL )
1233  return ERRID_DEV_NOTINITIALIZED;
1234 
1235  int iRetVal = g_apclDevice[iDeviceId]->getStateDioPos( iModuleId, puiState, pucDio, pfPos);
1236 
1237  return iRetVal;
1238 }
1239 
1240 M5DLL_API int WINAPI PCube_getHomeVel( int iDeviceId, int iModuleId, float* pValue )
1241 {
1242  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1243  return ERRID_DEV_WRONGDEVICEID;
1244  if( g_apclDevice[iDeviceId] == NULL )
1245  return ERRID_DEV_NOTINITIALIZED;
1246 
1247  int iRetVal = g_apclDevice[iDeviceId]->getHomeVel( iModuleId, pValue );
1248 
1249  return iRetVal;
1250 }
1251 
1252 M5DLL_API int WINAPI PCube_getHomeVelInc( int iDeviceId, int iModuleId, long* piValue )
1253 {
1254  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1255  return ERRID_DEV_WRONGDEVICEID;
1256  if( g_apclDevice[iDeviceId] == NULL )
1257  return ERRID_DEV_NOTINITIALIZED;
1258 
1259  int iRetVal = g_apclDevice[iDeviceId]->getHomeVelInc( iModuleId, piValue );
1260 
1261  return iRetVal;
1262 }
1263 
1264 M5DLL_API int WINAPI PCube_getSyncTime( int iDeviceId, int iModuleId, short* piValue )
1265 {
1266  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1267  return ERRID_DEV_WRONGDEVICEID;
1268  if( g_apclDevice[iDeviceId] == NULL )
1269  return ERRID_DEV_NOTINITIALIZED;
1270 
1271  int iRetVal = g_apclDevice[iDeviceId]->getSyncTime( iModuleId, piValue );
1272 
1273  return iRetVal;
1274 }
1275 
1276 M5DLL_API int WINAPI PCube_setConfig( int iDeviceId, int iModuleId, unsigned long puiValue )
1277 {
1278  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1279  return ERRID_DEV_WRONGDEVICEID;
1280  if( g_apclDevice[iDeviceId] == NULL )
1281  return ERRID_DEV_NOTINITIALIZED;
1282 
1283  int iRetVal = g_apclDevice[iDeviceId]->setConfig( iModuleId, puiValue );
1284 
1285  return iRetVal;
1286 }
1287 
1288 M5DLL_API int WINAPI PCube_setHomeOffset( int iDeviceId, int iModuleId, float fValue )
1289 {
1290  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1291  return ERRID_DEV_WRONGDEVICEID;
1292  if( g_apclDevice[iDeviceId] == NULL )
1293  return ERRID_DEV_NOTINITIALIZED;
1294 
1295  int iRetVal = g_apclDevice[iDeviceId]->setHomeOffset( iModuleId, fValue );
1296 
1297  return iRetVal;
1298 }
1299 
1300 M5DLL_API int WINAPI PCube_setHomeOffsetInc( int iDeviceId, int iModuleId, long iValue )
1301 {
1302  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1303  return ERRID_DEV_WRONGDEVICEID;
1304  if( g_apclDevice[iDeviceId] == NULL )
1305  return ERRID_DEV_NOTINITIALIZED;
1306 
1307  int iRetVal = g_apclDevice[iDeviceId]->setHomeOffsetInc( iModuleId, iValue );
1308 
1309  return iRetVal;
1310 }
1311 
1312 M5DLL_API int WINAPI PCube_setDioData( int iDeviceId, int iModuleId, unsigned long uiValue )
1313 {
1314  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1315  return ERRID_DEV_WRONGDEVICEID;
1316  if( g_apclDevice[iDeviceId] == NULL )
1317  return ERRID_DEV_NOTINITIALIZED;
1318 
1319  int iRetVal = g_apclDevice[iDeviceId]->setDioData( iModuleId, uiValue );
1320 
1321  return iRetVal;
1322 }
1323 
1324 M5DLL_API int WINAPI PCube_setA0( int iDeviceId, int iModuleId, short iValue )
1325 {
1326  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1327  return ERRID_DEV_WRONGDEVICEID;
1328  if( g_apclDevice[iDeviceId] == NULL )
1329  return ERRID_DEV_NOTINITIALIZED;
1330 
1331  int iRetVal = g_apclDevice[iDeviceId]->setA0( iModuleId, iValue );
1332 
1333  return iRetVal;
1334 }
1335 
1336 M5DLL_API int WINAPI PCube_setC0( int iDeviceId, int iModuleId, short iValue )
1337 {
1338  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1339  return ERRID_DEV_WRONGDEVICEID;
1340  if( g_apclDevice[iDeviceId] == NULL )
1341  return ERRID_DEV_NOTINITIALIZED;
1342 
1343  int iRetVal = g_apclDevice[iDeviceId]->setC0( iModuleId, iValue );
1344 
1345  return iRetVal;
1346 }
1347 
1348 M5DLL_API int WINAPI PCube_setDamp( int iDeviceId, int iModuleId, short iValue )
1349 {
1350  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1351  return ERRID_DEV_WRONGDEVICEID;
1352  if( g_apclDevice[iDeviceId] == NULL )
1353  return ERRID_DEV_NOTINITIALIZED;
1354 
1355  int iRetVal = g_apclDevice[iDeviceId]->setDamp( iModuleId, iValue );
1356 
1357  return iRetVal;
1358 }
1359 
1360 M5DLL_API int WINAPI PCube_setMinPos( int iDeviceId, int iModuleId, float fValue )
1361 {
1362  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1363  return ERRID_DEV_WRONGDEVICEID;
1364  if( g_apclDevice[iDeviceId] == NULL )
1365  return ERRID_DEV_NOTINITIALIZED;
1366 
1367  int iRetVal = g_apclDevice[iDeviceId]->setMinPos( iModuleId, fValue );
1368 
1369  return iRetVal;
1370 }
1371 
1372 M5DLL_API int WINAPI PCube_setMaxPos( int iDeviceId, int iModuleId, float fValue )
1373 {
1374  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1375  return ERRID_DEV_WRONGDEVICEID;
1376  if( g_apclDevice[iDeviceId] == NULL )
1377  return ERRID_DEV_NOTINITIALIZED;
1378 
1379  int iRetVal = g_apclDevice[iDeviceId]->setMaxPos( iModuleId, fValue );
1380 
1381  return iRetVal;
1382 }
1383 
1384 M5DLL_API int WINAPI PCube_setMaxVel( int iDeviceId, int iModuleId, float fValue )
1385 {
1386  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1387  return ERRID_DEV_WRONGDEVICEID;
1388  if( g_apclDevice[iDeviceId] == NULL )
1389  return ERRID_DEV_NOTINITIALIZED;
1390 
1391  int iRetVal = g_apclDevice[iDeviceId]->setMaxVel( iModuleId, fValue );
1392 
1393  return iRetVal;
1394 }
1395 
1396 M5DLL_API int WINAPI PCube_setMaxAcc( int iDeviceId, int iModuleId, float fValue )
1397 {
1398  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1399  return ERRID_DEV_WRONGDEVICEID;
1400  if( g_apclDevice[iDeviceId] == NULL )
1401  return ERRID_DEV_NOTINITIALIZED;
1402 
1403  int iRetVal = g_apclDevice[iDeviceId]->setMaxAcc( iModuleId, fValue );
1404 
1405  return iRetVal;
1406 }
1407 
1408 M5DLL_API int WINAPI PCube_setMaxCur( int iDeviceId, int iModuleId, float fValue )
1409 {
1410  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1411  return ERRID_DEV_WRONGDEVICEID;
1412  if( g_apclDevice[iDeviceId] == NULL )
1413  return ERRID_DEV_NOTINITIALIZED;
1414 
1415  int iRetVal = g_apclDevice[iDeviceId]->setMaxCur( iModuleId, fValue );
1416 
1417  return iRetVal;
1418 }
1419 
1420 M5DLL_API int WINAPI PCube_setMaxDeltaPos( int iDeviceId, int iModuleId, float fValue )
1421 {
1422  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1423  return ERRID_DEV_WRONGDEVICEID;
1424  if( g_apclDevice[iDeviceId] == NULL )
1425  return ERRID_DEV_NOTINITIALIZED;
1426 
1427  int iRetVal = g_apclDevice[iDeviceId]->setMaxDeltaPos( iModuleId, fValue );
1428 
1429  return iRetVal;
1430 }
1431 
1432 M5DLL_API int WINAPI PCube_setMinPosInc( int iDeviceId, int iModuleId, long iValue )
1433 {
1434  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1435  return ERRID_DEV_WRONGDEVICEID;
1436  if( g_apclDevice[iDeviceId] == NULL )
1437  return ERRID_DEV_NOTINITIALIZED;
1438 
1439  int iRetVal = g_apclDevice[iDeviceId]->setMinPosInc( iModuleId, iValue );
1440 
1441  return iRetVal;
1442 }
1443 
1444 M5DLL_API int WINAPI PCube_setMaxPosInc( int iDeviceId, int iModuleId, long iValue )
1445 {
1446  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1447  return ERRID_DEV_WRONGDEVICEID;
1448  if( g_apclDevice[iDeviceId] == NULL )
1449  return ERRID_DEV_NOTINITIALIZED;
1450 
1451  int iRetVal = g_apclDevice[iDeviceId]->setMaxPosInc( iModuleId, iValue );
1452 
1453  return iRetVal;
1454 }
1455 
1456 M5DLL_API int WINAPI PCube_setMaxVelInc( int iDeviceId, int iModuleId, long iValue )
1457 {
1458  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1459  return ERRID_DEV_WRONGDEVICEID;
1460  if( g_apclDevice[iDeviceId] == NULL )
1461  return ERRID_DEV_NOTINITIALIZED;
1462 
1463  int iRetVal = g_apclDevice[iDeviceId]->setMaxVelInc( iModuleId, iValue );
1464 
1465  return iRetVal;
1466 }
1467 
1468 M5DLL_API int WINAPI PCube_setMaxAccInc( int iDeviceId, int iModuleId, long iValue )
1469 {
1470  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1471  return ERRID_DEV_WRONGDEVICEID;
1472  if( g_apclDevice[iDeviceId] == NULL )
1473  return ERRID_DEV_NOTINITIALIZED;
1474 
1475  int iRetVal = g_apclDevice[iDeviceId]->setMaxAccInc( iModuleId, iValue );
1476 
1477  return iRetVal;
1478 }
1479 
1480 M5DLL_API int WINAPI PCube_setMaxDeltaPosInc( int iDeviceId, int iModuleId, long iValue )
1481 {
1482  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1483  return ERRID_DEV_WRONGDEVICEID;
1484  if( g_apclDevice[iDeviceId] == NULL )
1485  return ERRID_DEV_NOTINITIALIZED;
1486 
1487  int iRetVal = g_apclDevice[iDeviceId]->setMaxDeltaPosInc( iModuleId, iValue );
1488 
1489  return iRetVal;
1490 }
1491 
1492 M5DLL_API int WINAPI PCube_setHomeVel( int iDeviceId, int iModuleId, float fValue )
1493 {
1494  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1495  return ERRID_DEV_WRONGDEVICEID;
1496  if( g_apclDevice[iDeviceId] == NULL )
1497  return ERRID_DEV_NOTINITIALIZED;
1498 
1499  int iRetVal = g_apclDevice[iDeviceId]->setHomeVel( iModuleId, fValue );
1500 
1501  return iRetVal;
1502 }
1503 
1504 M5DLL_API int WINAPI PCube_setHomeVelInc( int iDeviceId, int iModuleId, long iValue )
1505 {
1506  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1507  return ERRID_DEV_WRONGDEVICEID;
1508  if( g_apclDevice[iDeviceId] == NULL )
1509  return ERRID_DEV_NOTINITIALIZED;
1510 
1511  int iRetVal = g_apclDevice[iDeviceId]->setHomeVelInc( iModuleId, iValue );
1512 
1513  return iRetVal;
1514 }
1515 
1516 M5DLL_API int WINAPI PCube_setRampVel( int iDeviceId, int iModuleId, float fValue )
1517 {
1518  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1519  return ERRID_DEV_WRONGDEVICEID;
1520  if( g_apclDevice[iDeviceId] == NULL )
1521  return ERRID_DEV_NOTINITIALIZED;
1522 
1523  int iRetVal = g_apclDevice[iDeviceId]->setRampVel( iModuleId, fValue );
1524 
1525  return iRetVal;
1526 }
1527 
1528 M5DLL_API int WINAPI PCube_setRampVelInc( int iDeviceId, int iModuleId, long iValue )
1529 {
1530  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1531  return ERRID_DEV_WRONGDEVICEID;
1532  if( g_apclDevice[iDeviceId] == NULL )
1533  return ERRID_DEV_NOTINITIALIZED;
1534 
1535  int iRetVal = g_apclDevice[iDeviceId]->setRampVelInc( iModuleId, iValue );
1536 
1537  return iRetVal;
1538 }
1539 
1540 M5DLL_API int WINAPI PCube_setRampAcc( int iDeviceId, int iModuleId, float fValue )
1541 {
1542  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1543  return ERRID_DEV_WRONGDEVICEID;
1544  if( g_apclDevice[iDeviceId] == NULL )
1545  return ERRID_DEV_NOTINITIALIZED;
1546 
1547  int iRetVal = g_apclDevice[iDeviceId]->setRampAcc( iModuleId, fValue );
1548 
1549  return iRetVal;
1550 }
1551 
1552 M5DLL_API int WINAPI PCube_setRampAccInc( int iDeviceId, int iModuleId, long iValue )
1553 {
1554  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1555  return ERRID_DEV_WRONGDEVICEID;
1556  if( g_apclDevice[iDeviceId] == NULL )
1557  return ERRID_DEV_NOTINITIALIZED;
1558 
1559  int iRetVal = g_apclDevice[iDeviceId]->setRampAccInc( iModuleId, iValue );
1560 
1561  return iRetVal;
1562 }
1563 
1564 M5DLL_API int WINAPI PCube_setSyncTime( int iDeviceId, int iModuleId, short iValue )
1565 {
1566  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1567  return ERRID_DEV_WRONGDEVICEID;
1568  if( g_apclDevice[iDeviceId] == NULL )
1569  return ERRID_DEV_NOTINITIALIZED;
1570 
1571  int iRetVal = g_apclDevice[iDeviceId]->setSyncTime( iModuleId, iValue );
1572 
1573  return iRetVal;
1574 }
1575 
1577 {
1578  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1579  return ERRID_DEV_WRONGDEVICEID;
1580  if( g_apclDevice[iDeviceId] == NULL )
1581  return ERRID_DEV_NOTINITIALIZED;
1582 
1583  int iRetVal = g_apclDevice[iDeviceId]->updateModuleIdMap();
1584 
1585  return iRetVal;
1586 }
1587 
1588 M5DLL_API int WINAPI PCube_homeModule( int iDeviceId, int iModuleId )
1589 {
1590  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1591  return ERRID_DEV_WRONGDEVICEID;
1592  if( g_apclDevice[iDeviceId] == NULL )
1593  return ERRID_DEV_NOTINITIALIZED;
1594 
1595  int iRetVal = g_apclDevice[iDeviceId]->homeModule( iModuleId );
1596 
1597  return iRetVal;
1598 }
1599 
1600 M5DLL_API int WINAPI PCube_haltModule( int iDeviceId, int iModuleId )
1601 {
1602  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1603  return ERRID_DEV_WRONGDEVICEID;
1604  if( g_apclDevice[iDeviceId] == NULL )
1605  return ERRID_DEV_NOTINITIALIZED;
1606 
1607  int iRetVal = g_apclDevice[iDeviceId]->haltModule( iModuleId );
1608 
1609  return iRetVal;
1610 }
1611 
1612 M5DLL_API int WINAPI PCube_resetModule( int iDeviceId, int iModuleId )
1613 {
1614  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1615  return ERRID_DEV_WRONGDEVICEID;
1616  if( g_apclDevice[iDeviceId] == NULL )
1617  return ERRID_DEV_NOTINITIALIZED;
1618 
1619  int iRetVal = g_apclDevice[iDeviceId]->resetModule( iModuleId );
1620 
1621  return iRetVal;
1622 }
1623 
1624 M5DLL_API int WINAPI PCube_recalcPIDParams( int iDeviceId, int iModuleId )
1625 {
1626  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1627  return ERRID_DEV_WRONGDEVICEID;
1628  if( g_apclDevice[iDeviceId] == NULL )
1629  return ERRID_DEV_NOTINITIALIZED;
1630 
1631  int iRetVal = g_apclDevice[iDeviceId]->recalcPIDParams( iModuleId );
1632 
1633  return iRetVal;
1634 }
1635 
1636 M5DLL_API int WINAPI PCube_movePos( int iDeviceId, int iModuleId, float fPos )
1637 {
1638  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1639  return ERRID_DEV_WRONGDEVICEID;
1640  if( g_apclDevice[iDeviceId] == NULL )
1641  return ERRID_DEV_NOTINITIALIZED;
1642 
1643  int iRetVal = g_apclDevice[iDeviceId]->movePos( iModuleId, fPos );
1644 
1645  return iRetVal;
1646 }
1647 
1648 M5DLL_API int WINAPI PCube_moveRamp( int iDeviceId, int iModuleId, float fPos, float fVel, float fAcc )
1649 {
1650  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1651  return ERRID_DEV_WRONGDEVICEID;
1652  if( g_apclDevice[iDeviceId] == NULL )
1653  return ERRID_DEV_NOTINITIALIZED;
1654 
1655  int iRetVal = g_apclDevice[iDeviceId]->moveRamp( iModuleId, fPos, fVel, fAcc );
1656 
1657  return iRetVal;
1658 }
1659 
1660 M5DLL_API int WINAPI PCube_moveVel( int iDeviceId, int iModuleId, float fVel )
1661 {
1662  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1663  return ERRID_DEV_WRONGDEVICEID;
1664  if( g_apclDevice[iDeviceId] == NULL )
1665  return ERRID_DEV_NOTINITIALIZED;
1666 
1667  int iRetVal = g_apclDevice[iDeviceId]->moveVel( iModuleId, fVel );
1668 
1669  return iRetVal;
1670 }
1671 
1672 M5DLL_API int WINAPI PCube_moveCur( int iDeviceId, int iModuleId, float fCur )
1673 {
1674  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1675  return ERRID_DEV_WRONGDEVICEID;
1676  if( g_apclDevice[iDeviceId] == NULL )
1677  return ERRID_DEV_NOTINITIALIZED;
1678 
1679  int iRetVal = g_apclDevice[iDeviceId]->moveCur( iModuleId, fCur );
1680 
1681  return iRetVal;
1682 }
1683 
1684 M5DLL_API int WINAPI PCube_moveStep( int iDeviceId, int iModuleId, float fPos, unsigned short uiTime )
1685 {
1686  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1687  return ERRID_DEV_WRONGDEVICEID;
1688  if( g_apclDevice[iDeviceId] == NULL )
1689  return ERRID_DEV_NOTINITIALIZED;
1690 
1691  int iRetVal = g_apclDevice[iDeviceId]->moveStep( iModuleId, fPos, uiTime );
1692 
1693  return iRetVal;
1694 }
1695 
1696 M5DLL_API int WINAPI PCube_movePosInc( int iDeviceId, int iModuleId, long iPos )
1697 {
1698  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1699  return ERRID_DEV_WRONGDEVICEID;
1700  if( g_apclDevice[iDeviceId] == NULL )
1701  return ERRID_DEV_NOTINITIALIZED;
1702 
1703  int iRetVal = g_apclDevice[iDeviceId]->movePosInc( iModuleId, iPos );
1704 
1705  return iRetVal;
1706 }
1707 
1708 M5DLL_API int WINAPI PCube_moveRampInc( int iDeviceId, int iModuleId, long iPos, long iVel, long iAcc )
1709 {
1710  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1711  return ERRID_DEV_WRONGDEVICEID;
1712  if( g_apclDevice[iDeviceId] == NULL )
1713  return ERRID_DEV_NOTINITIALIZED;
1714 
1715  int iRetVal = g_apclDevice[iDeviceId]->moveRampInc( iModuleId, iPos, iVel, iAcc );
1716 
1717  return iRetVal;
1718 }
1719 
1720 M5DLL_API int WINAPI PCube_moveVelInc( int iDeviceId, int iModuleId, long iVel )
1721 {
1722  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1723  return ERRID_DEV_WRONGDEVICEID;
1724  if( g_apclDevice[iDeviceId] == NULL )
1725  return ERRID_DEV_NOTINITIALIZED;
1726 
1727  int iRetVal = g_apclDevice[iDeviceId]->moveVelInc( iModuleId, iVel );
1728 
1729  return iRetVal;
1730 }
1731 
1732 M5DLL_API int WINAPI PCube_moveCurInc( int iDeviceId, int iModuleId, long iCur )
1733 {
1734  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1735  return ERRID_DEV_WRONGDEVICEID;
1736  if( g_apclDevice[iDeviceId] == NULL )
1737  return ERRID_DEV_NOTINITIALIZED;
1738 
1739  int iRetVal = g_apclDevice[iDeviceId]->moveCurInc( iModuleId, iCur );
1740 
1741  return iRetVal;
1742 }
1743 
1744 M5DLL_API int WINAPI PCube_moveStepInc( int iDeviceId, int iModuleId, long iPos, unsigned short uiTime )
1745 {
1746  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1747  return ERRID_DEV_WRONGDEVICEID;
1748  if( g_apclDevice[iDeviceId] == NULL )
1749  return ERRID_DEV_NOTINITIALIZED;
1750 
1751  int iRetVal = g_apclDevice[iDeviceId]->moveStepInc( iModuleId, iPos, uiTime );
1752 
1753  return iRetVal;
1754 }
1755 
1756 M5DLL_API int WINAPI PCube_movePosExtended( int iDeviceId, int iModuleId, float fPos, unsigned long* puiState, unsigned char* pucDio, float* pfPos )
1757 {
1758  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1759  return ERRID_DEV_WRONGDEVICEID;
1760  if( g_apclDevice[iDeviceId] == NULL )
1761  return ERRID_DEV_NOTINITIALIZED;
1762 
1763  int iRetVal = g_apclDevice[iDeviceId]->movePosExtended( iModuleId, fPos, puiState, pucDio, pfPos );
1764 
1765  return iRetVal;
1766 }
1767 
1768 M5DLL_API int WINAPI PCube_moveRampExtended( int iDeviceId, int iModuleId, float fPos, float fVel, float fAcc, unsigned long* puiState, unsigned char* pucDio, float* pfPos )
1769 {
1770  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1771  return ERRID_DEV_WRONGDEVICEID;
1772  if( g_apclDevice[iDeviceId] == NULL )
1773  return ERRID_DEV_NOTINITIALIZED;
1774 
1775  int iRetVal = g_apclDevice[iDeviceId]->moveRampExtended( iModuleId, fPos, fVel, fAcc, puiState, pucDio, pfPos );
1776 
1777  return iRetVal;
1778 }
1779 
1780 M5DLL_API int WINAPI PCube_moveVelExtended( int iDeviceId, int iModuleId, float fCur, unsigned long* puiState, unsigned char* pucDio, float* pfPos )
1781 {
1782  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1783  return ERRID_DEV_WRONGDEVICEID;
1784  if( g_apclDevice[iDeviceId] == NULL )
1785  return ERRID_DEV_NOTINITIALIZED;
1786 
1787  int iRetVal = g_apclDevice[iDeviceId]->moveVelExtended( iModuleId, fCur, puiState, pucDio, pfPos );
1788 
1789  return iRetVal;
1790 }
1791 
1792 M5DLL_API int WINAPI PCube_moveCurExtended( int iDeviceId, int iModuleId, float fCur, unsigned long* puiState, unsigned char* pucDio, float* pfPos )
1793 {
1794  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1795  return ERRID_DEV_WRONGDEVICEID;
1796  if( g_apclDevice[iDeviceId] == NULL )
1797  return ERRID_DEV_NOTINITIALIZED;
1798 
1799  int iRetVal = g_apclDevice[iDeviceId]->moveCurExtended( iModuleId, fCur, puiState, pucDio, pfPos );
1800 
1801  return iRetVal;
1802 }
1803 
1804 M5DLL_API int WINAPI PCube_moveStepExtended( int iDeviceId, int iModuleId, float fPos, unsigned short uiTime, unsigned long* puiState, unsigned char* pucDio, float* pfPos )
1805 {
1806  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1807  return ERRID_DEV_WRONGDEVICEID;
1808  if( g_apclDevice[iDeviceId] == NULL )
1809  return ERRID_DEV_NOTINITIALIZED;
1810 
1811  int iRetVal = g_apclDevice[iDeviceId]->moveStepExtended( iModuleId, fPos, uiTime, puiState, pucDio, pfPos );
1812 
1813  return iRetVal;
1814 }
1815 
1816 M5DLL_API int WINAPI PCube_homeAll( int iDeviceId )
1817 {
1818  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1819  return ERRID_DEV_WRONGDEVICEID;
1820  if( g_apclDevice[iDeviceId] == NULL )
1821  return ERRID_DEV_NOTINITIALIZED;
1822 
1823  int iRetVal = g_apclDevice[iDeviceId]->homeAll();
1824 
1825  return iRetVal;
1826 }
1827 
1828 M5DLL_API int WINAPI PCube_resetAll( int iDeviceId )
1829 {
1830  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1831  return ERRID_DEV_WRONGDEVICEID;
1832  if( g_apclDevice[iDeviceId] == NULL )
1833  return ERRID_DEV_NOTINITIALIZED;
1834 
1835  int iRetVal = g_apclDevice[iDeviceId]->resetAll();
1836 
1837  return iRetVal;
1838 }
1839 
1840 M5DLL_API int WINAPI PCube_haltAll( int iDeviceId )
1841 {
1842  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1843  return ERRID_DEV_WRONGDEVICEID;
1844  if( g_apclDevice[iDeviceId] == NULL )
1845  return ERRID_DEV_NOTINITIALIZED;
1846 
1847  int iRetVal = g_apclDevice[iDeviceId]->haltAll();
1848 
1849  return iRetVal;
1850 }
1851 
1853 {
1854  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1855  return ERRID_DEV_WRONGDEVICEID;
1856  if( g_apclDevice[iDeviceId] == NULL )
1857  return ERRID_DEV_NOTINITIALIZED;
1858 
1859  int iRetVal = g_apclDevice[iDeviceId]->serveWatchdogAll();
1860 
1861  return iRetVal;
1862 }
1863 
1864 M5DLL_API int WINAPI PCube_setBaudRateAll( int iDeviceId, unsigned char ucValue )
1865 {
1866  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1867  return ERRID_DEV_WRONGDEVICEID;
1868  if( g_apclDevice[iDeviceId] == NULL )
1869  return ERRID_DEV_NOTINITIALIZED;
1870 
1871  int iRetVal = g_apclDevice[iDeviceId]->setBaudRateAll(ucValue);
1872 
1873  return iRetVal;
1874 }
1875 
1877 {
1878  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1879  return ERRID_DEV_WRONGDEVICEID;
1880  if( g_apclDevice[iDeviceId] == NULL )
1881  return ERRID_DEV_NOTINITIALIZED;
1882 
1883  int iRetVal = g_apclDevice[iDeviceId]->startMotionAll();
1884 
1885  return iRetVal;
1886 }
1887 
1888 M5DLL_API int WINAPI PCube_savePosAll( int iDeviceId )
1889 {
1890  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1891  return ERRID_DEV_WRONGDEVICEID;
1892  if( g_apclDevice[iDeviceId] == NULL )
1893  return ERRID_DEV_NOTINITIALIZED;
1894 
1895  int iRetVal = g_apclDevice[iDeviceId]->savePosAll();
1896 
1897  return iRetVal;
1898 }
1899 
1900 M5DLL_API int WINAPI PCube_waitForHomeEnd( int iDeviceId, int iModuleId, unsigned long uiTime )
1901 {
1902  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1903  return ERRID_DEV_WRONGDEVICEID;
1904  if( g_apclDevice[iDeviceId] == NULL )
1905  return ERRID_DEV_NOTINITIALIZED;
1906 
1907  int iRetVal = g_apclDevice[iDeviceId]->waitForHomeEnd( iModuleId, uiTime );
1908 
1909  return iRetVal;
1910 }
1911 
1912 M5DLL_API int WINAPI PCube_waitForMotionEnd( int iDeviceId, int iModuleId, unsigned long uiTime )
1913 {
1914  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1915  return ERRID_DEV_WRONGDEVICEID;
1916  if( g_apclDevice[iDeviceId] == NULL )
1917  return ERRID_DEV_NOTINITIALIZED;
1918 
1919  int iRetVal = g_apclDevice[iDeviceId]->waitForMotionEnd( iModuleId, uiTime );
1920 
1921  return iRetVal;
1922 }
1923 
1924 M5DLL_API int WINAPI PCube_waitForRampEnd( int iDeviceId, int iModuleId, unsigned long uiTime )
1925 {
1926  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1927  return ERRID_DEV_WRONGDEVICEID;
1928  if( g_apclDevice[iDeviceId] == NULL )
1929  return ERRID_DEV_NOTINITIALIZED;
1930 
1931  int iRetVal = g_apclDevice[iDeviceId]->waitForRampEnd( iModuleId, uiTime );
1932 
1933  return iRetVal;
1934 }
1935 
1936 M5DLL_API int WINAPI PCube_waitForRampDec( int iDeviceId, int iModuleId, unsigned long uiTime )
1937 {
1938  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1939  return ERRID_DEV_WRONGDEVICEID;
1940  if( g_apclDevice[iDeviceId] == NULL )
1941  return ERRID_DEV_NOTINITIALIZED;
1942 
1943  int iRetVal = g_apclDevice[iDeviceId]->waitForRampDec( iModuleId, uiTime );
1944 
1945  return iRetVal;
1946 }
1947 
1948 M5DLL_API int WINAPI PCube_waitForRampSteady( int iDeviceId, int iModuleId, unsigned long uiTime )
1949 {
1950  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1951  return ERRID_DEV_WRONGDEVICEID;
1952  if( g_apclDevice[iDeviceId] == NULL )
1953  return ERRID_DEV_NOTINITIALIZED;
1954 
1955  int iRetVal = g_apclDevice[iDeviceId]->waitForRampSteady( iModuleId, uiTime );
1956 
1957  return iRetVal;
1958 }
1959 
1960 M5DLL_API int WINAPI PCube_waitForHomeEndAll( int iDeviceId, unsigned long uiTime )
1961 {
1962  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1963  return ERRID_DEV_WRONGDEVICEID;
1964  if( g_apclDevice[iDeviceId] == NULL )
1965  return ERRID_DEV_NOTINITIALIZED;
1966 
1967  int iRetVal = g_apclDevice[iDeviceId]->waitForHomeEndAll( uiTime );
1968 
1969  return iRetVal;
1970 }
1971 
1972 M5DLL_API int WINAPI PCube_waitForMotionEndAll( int iDeviceId, unsigned long uiTime )
1973 {
1974  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1975  return ERRID_DEV_WRONGDEVICEID;
1976  if( g_apclDevice[iDeviceId] == NULL )
1977  return ERRID_DEV_NOTINITIALIZED;
1978 
1979  int iRetVal = g_apclDevice[iDeviceId]->waitForMotionEndAll( uiTime );
1980 
1981  return iRetVal;
1982 }
1983 
1984 M5DLL_API int WINAPI PCube_waitForRampEndAll( int iDeviceId, unsigned long uiTime )
1985 {
1986  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1987  return ERRID_DEV_WRONGDEVICEID;
1988  if( g_apclDevice[iDeviceId] == NULL )
1989  return ERRID_DEV_NOTINITIALIZED;
1990 
1991  int iRetVal = g_apclDevice[iDeviceId]->waitForRampEndAll( uiTime );
1992 
1993  return iRetVal;
1994 }
1995 
1997 {
1998  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
1999  return ERRID_DEV_WRONGDEVICEID;
2000  if( g_apclDevice[iDeviceId] == NULL )
2001  return ERRID_DEV_NOTINITIALIZED;
2002 
2003  int iRetVal = g_apclDevice[iDeviceId]->waitForStartMotionAll();
2004 
2005  return iRetVal;
2006 }
2007 
2008 M5DLL_API int WINAPI PCube_xmit8Bytes( int iDeviceId, int iModuleId, void* pBytes )
2009 {
2010  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2011  return ERRID_DEV_WRONGDEVICEID;
2012  if( g_apclDevice[iDeviceId] == NULL )
2013  return ERRID_DEV_NOTINITIALIZED;
2014 
2015  int iRetVal = g_apclDevice[iDeviceId]->xmit8Bytes( iModuleId, pBytes );
2016 
2017  return iRetVal;
2018 }
2019 
2020 M5DLL_API int WINAPI PCube_xack8Bytes( int iDeviceId, int iModuleId, void* pBytes )
2021 {
2022  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2023  return ERRID_DEV_WRONGDEVICEID;
2024  if( g_apclDevice[iDeviceId] == NULL )
2025  return ERRID_DEV_NOTINITIALIZED;
2026 
2027  int iRetVal = g_apclDevice[iDeviceId]->xack8Bytes( iModuleId, pBytes );
2028 
2029  return iRetVal;
2030 }
2031 
2032 M5DLL_API int WINAPI PCube_doInternal( int iDeviceId, int iModuleId, void* pBytes )
2033 {
2034  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2035  return ERRID_DEV_WRONGDEVICEID;
2036  if( g_apclDevice[iDeviceId] == NULL )
2037  return ERRID_DEV_NOTINITIALIZED;
2038 
2039  int iRetVal = g_apclDevice[iDeviceId]->doInternal( iModuleId, pBytes );
2040 
2041  return iRetVal;
2042 }
2043 
2044 M5DLL_API int WINAPI PCube_getStateInternal( int iDeviceId, int iModuleId, unsigned long* pStat )
2045 {
2046  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2047  return ERRID_DEV_WRONGDEVICEID;
2048  if( g_apclDevice[iDeviceId] == NULL )
2049  return ERRID_DEV_NOTINITIALIZED;
2050 
2051  int iRetVal = g_apclDevice[iDeviceId]->getStateInternal( iModuleId, pStat );
2052 
2053  return iRetVal;
2054 }
2055 
2056 M5DLL_API int WINAPI PCube_initDLR_FTS( int iDeviceId )
2057 {
2058  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2059  return ERRID_DEV_WRONGDEVICEID;
2060  if( g_apclDevice[iDeviceId] == NULL )
2061  return ERRID_DEV_NOTINITIALIZED;
2062 
2063  int iRetVal = g_apclDevice[iDeviceId]->initDLR_FTS();
2064 
2065  return iRetVal;
2066 }
2067 
2068 M5DLL_API int WINAPI PCube_getDataDLR_FTS( int iDeviceId, float* fVal0, float* fVal1, float* fVal2, float* fVal3, float* fVal4, float* fVal5, long* piState )
2069 {
2070  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2071  return ERRID_DEV_WRONGDEVICEID;
2072  if( g_apclDevice[iDeviceId] == NULL )
2073  return ERRID_DEV_NOTINITIALIZED;
2074 
2075  static std::vector<float> afVector;
2076  int iRetVal = g_apclDevice[iDeviceId]->getDataDLR_FTS( afVector, piState );
2077  *fVal0 = afVector[0];
2078  *fVal1 = afVector[1];
2079  *fVal2 = afVector[2];
2080  *fVal3 = afVector[3];
2081  *fVal4 = afVector[4];
2082  *fVal5 = afVector[5];
2083 
2084  return iRetVal;
2085 }
2086 
2087 M5DLL_API int WINAPI PCube_getDataSCHUNK_FTC( int iDeviceId, int iModulId, int iChannelTypeId, float* fVal0, float* fVal1, float* fVal2, float* fVal3, float* fVal4, float* fVal5, short* piState )
2088 {
2089  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2090  return ERRID_DEV_WRONGDEVICEID;
2091  if( g_apclDevice[iDeviceId] == NULL )
2092  return ERRID_DEV_NOTINITIALIZED;
2093 
2094  static std::vector<float> afVector;
2095  int iRetVal = g_apclDevice[iDeviceId]->getDataSCHUNK_FTC( iModulId, iChannelTypeId, afVector, piState );
2096  *fVal0 = afVector[0];
2097  *fVal1 = afVector[1];
2098  *fVal2 = afVector[2];
2099  *fVal3 = afVector[3];
2100  *fVal4 = afVector[4];
2101  *fVal5 = afVector[5];
2102 
2103  return iRetVal;
2104 }
2105 
2106 M5DLL_API int WINAPI PCube_setNullSCHUNK_FTC( int iDeviceId, int iModulId, short* piState )
2107 {
2108  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2109  return ERRID_DEV_WRONGDEVICEID;
2110  if( g_apclDevice[iDeviceId] == NULL )
2111  return ERRID_DEV_NOTINITIALIZED;
2112 
2113  int iRetVal = g_apclDevice[iDeviceId]->setNullSCHUNK_FTC( iModulId, piState );
2114 
2115  return iRetVal;
2116 }
2117 
2118 M5DLL_API int WINAPI PCube_initEMS_IO( int iDeviceId, unsigned char ucType, unsigned long uiSerialNo )
2119 {
2120  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2121  return ERRID_DEV_WRONGDEVICEID;
2122  if( g_apclDevice[iDeviceId] == NULL )
2123  return ERRID_DEV_NOTINITIALIZED;
2124 
2125 // int iRetVal = g_apclDevice[iDeviceId]->initEMS_IO( ucType, uiSerialNo );
2126 // return iRetVal;
2127  return ERRID_DEV_WRONGDEVICEID;
2128 }
2129 
2130 M5DLL_API int WINAPI PCube_getDataEMS_DIO( int iDeviceId, int iModuleId, int iChannelId, int* pData )
2131 {
2132  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2133  return ERRID_DEV_WRONGDEVICEID;
2134  if( g_apclDevice[iDeviceId] == NULL )
2135  return ERRID_DEV_NOTINITIALIZED;
2136 
2137  bool bData = false;
2138 // int iRetVal = g_apclDevice[iDeviceId]->getDataEMS_IO( iModuleId, iChannelId, bData );
2139 // *pData = (int)bData;
2140 // return iRetVal;
2141  return ERRID_DEV_WRONGDEVICEID;
2142 }
2143 
2144 M5DLL_API int WINAPI PCube_setDataEMS_DIO( int iDeviceId, int iModuleId, int iChannelId, int iData )
2145 {
2146  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2147  return ERRID_DEV_WRONGDEVICEID;
2148  if( g_apclDevice[iDeviceId] == NULL )
2149  return ERRID_DEV_NOTINITIALIZED;
2150 
2151  bool bData = (bool)iData;
2152 // int iRetVal = g_apclDevice[iDeviceId]->setDataEMS_IO( iModuleId, iChannelId, bData );
2153 // return iRetVal;
2154  return ERRID_DEV_WRONGDEVICEID;
2155 }
2156 
2157 M5DLL_API int WINAPI PCube_getDataEMS_AIO( int iDeviceId, int iModuleId, int iChannelId, float* pfData )
2158 {
2159  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2160  return ERRID_DEV_WRONGDEVICEID;
2161  if( g_apclDevice[iDeviceId] == NULL )
2162  return ERRID_DEV_NOTINITIALIZED;
2163 
2164 // int iRetVal = g_apclDevice[iDeviceId]->getDataEMS_IO( iModuleId, iChannelId, *pfData );
2165 // return iRetVal;
2166  return ERRID_DEV_WRONGDEVICEID;
2167 }
2168 
2169 M5DLL_API int WINAPI PCube_setDataEMS_AIO( int iDeviceId, int iModuleId, int iChannelId, float fData )
2170 {
2171  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2172  return ERRID_DEV_WRONGDEVICEID;
2173  if( g_apclDevice[iDeviceId] == NULL )
2174  return ERRID_DEV_NOTINITIALIZED;
2175 
2176 // int iRetVal = g_apclDevice[iDeviceId]->setDataEMS_IO( iModuleId, iChannelId, fData );
2177 // return iRetVal;
2178  return ERRID_DEV_WRONGDEVICEID;
2179 }
2180 
2181 M5DLL_API int WINAPI PCube_getDataMP55_IO( int iDeviceId, int iModuleId, float* pfData )
2182 {
2183  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2184  return ERRID_DEV_WRONGDEVICEID;
2185  if( g_apclDevice[iDeviceId] == NULL )
2186  return ERRID_DEV_NOTINITIALIZED;
2187 
2188  int iRetVal = g_apclDevice[iDeviceId]->getDataMP55_IO( iModuleId, pfData );
2189 
2190  return iRetVal;
2191 }
2192 
2193 M5DLL_API int WINAPI PCube_setTaraMP55_IO( int iDeviceId, int iModuleId, float fData )
2194 {
2195  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2196  return ERRID_DEV_WRONGDEVICEID;
2197  if( g_apclDevice[iDeviceId] == NULL )
2198  return ERRID_DEV_NOTINITIALIZED;
2199 
2200  int iRetVal = g_apclDevice[iDeviceId]->setTaraMP55_IO( iModuleId, fData );
2201 
2202  return iRetVal;
2203 }
2204 
2205 M5DLL_API int WINAPI PCube_getDefCurOffset( int iDeviceId, int iModuleId, float* pfValue )
2206 {
2207  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2208  return ERRID_DEV_WRONGDEVICEID;
2209  if( g_apclDevice[iDeviceId] == NULL )
2210  return ERRID_DEV_NOTINITIALIZED;
2211 
2212  int iRetVal = g_apclDevice[iDeviceId]->getDefCurOffset( iModuleId, pfValue );
2213 
2214  return iRetVal;
2215 }
2216 
2217 M5DLL_API int WINAPI PCube_setInitMP55_IO_fast( int iDeviceId, int iModuleId )
2218 {
2219  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2220  return ERRID_DEV_WRONGDEVICEID;
2221  if( g_apclDevice[iDeviceId] == NULL )
2222  return ERRID_DEV_NOTINITIALIZED;
2223 
2224  int iRetVal = g_apclDevice[iDeviceId]->setInitMP55_IO_fast( iModuleId );
2225 
2226  return iRetVal;
2227 }
2228 
2229 M5DLL_API int WINAPI PCube_getDataMP55_IO_fast( int iDeviceId, int iModuleId, float* pfData )
2230 {
2231  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2232  return ERRID_DEV_WRONGDEVICEID;
2233  if( g_apclDevice[iDeviceId] == NULL )
2234  return ERRID_DEV_NOTINITIALIZED;
2235 
2236  int iRetVal = g_apclDevice[iDeviceId]->getDataMP55_IO_fast( iModuleId, pfData );
2237 
2238  return iRetVal;
2239 }
2240 
2241 M5DLL_API int WINAPI PCube_getRawMotorCurrent( int iDeviceId, int iModuleId, short* piValue )
2242 {
2243  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2244  return ERRID_DEV_WRONGDEVICEID;
2245  if( g_apclDevice[iDeviceId] == NULL )
2246  return ERRID_DEV_NOTINITIALIZED;
2247 
2248  int iRetVal = g_apclDevice[iDeviceId]->getRawMotorCurrent( iModuleId, piValue );
2249 
2250  return iRetVal;
2251 }
2252 
2253 M5DLL_API int WINAPI PCube_getRawMotorSupply( int iDeviceId, int iModuleId, short* piValue )
2254 {
2255  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2256  return ERRID_DEV_WRONGDEVICEID;
2257  if( g_apclDevice[iDeviceId] == NULL )
2258  return ERRID_DEV_NOTINITIALIZED;
2259 
2260  int iRetVal = g_apclDevice[iDeviceId]->getRawMotorSupply( iModuleId, piValue );
2261 
2262  return iRetVal;
2263 }
2264 
2265 M5DLL_API int WINAPI PCube_getRawTemperature( int iDeviceId, int iModuleId, short* piValue )
2266 {
2267  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2268  return ERRID_DEV_WRONGDEVICEID;
2269  if( g_apclDevice[iDeviceId] == NULL )
2270  return ERRID_DEV_NOTINITIALIZED;
2271 
2272  int iRetVal = g_apclDevice[iDeviceId]->getRawTemperature( iModuleId, piValue );
2273 
2274  return iRetVal;
2275 }
2276 
2277 M5DLL_API int WINAPI PCube_getRawLogicSupply( int iDeviceId, int iModuleId, short* piValue )
2278 {
2279  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2280  return ERRID_DEV_WRONGDEVICEID;
2281  if( g_apclDevice[iDeviceId] == NULL )
2282  return ERRID_DEV_NOTINITIALIZED;
2283 
2284  int iRetVal = g_apclDevice[iDeviceId]->getRawLogicSupply( iModuleId, piValue );
2285 
2286  return iRetVal;
2287 }
2288 
2289 M5DLL_API int WINAPI PCube_getCanOpenRawAbsEnc( int iDeviceId, int iModuleId, short* piValue )
2290 {
2291  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2292  return ERRID_DEV_WRONGDEVICEID;
2293  if( g_apclDevice[iDeviceId] == NULL )
2294  return ERRID_DEV_NOTINITIALIZED;
2295 
2296  int iRetVal = g_apclDevice[iDeviceId]->getCanOpenRawAbsEnc( iModuleId, piValue );
2297 
2298  return iRetVal;
2299 }
2300 
2301 M5DLL_API int WINAPI PCube_getLoadLimit( int iDeviceId, int iModuleId, long* piValue)
2302 {
2303  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2304  return ERRID_DEV_WRONGDEVICEID;
2305  if( g_apclDevice[iDeviceId] == NULL )
2306  return ERRID_DEV_NOTINITIALIZED;
2307 
2308  int iRetVal = g_apclDevice[iDeviceId]->getLoadLimit( iModuleId, piValue );
2309 
2310  return iRetVal;
2311 }
2312 
2313 M5DLL_API int WINAPI PCube_getMaxLoadGradient( int iDeviceId, int iModuleId, long* piValue)
2314 {
2315  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2316  return ERRID_DEV_WRONGDEVICEID;
2317  if( g_apclDevice[iDeviceId] == NULL )
2318  return ERRID_DEV_NOTINITIALIZED;
2319 
2320  int iRetVal = g_apclDevice[iDeviceId]->getMaxLoadGradient( iModuleId, piValue );
2321 
2322  return iRetVal;
2323 }
2324 
2325 M5DLL_API int WINAPI PCube_getLoadDeltaTime( int iDeviceId, int iModuleId, unsigned short* piValue)
2326 {
2327  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2328  return ERRID_DEV_WRONGDEVICEID;
2329  if( g_apclDevice[iDeviceId] == NULL )
2330  return ERRID_DEV_NOTINITIALIZED;
2331 
2332  int iRetVal = g_apclDevice[iDeviceId]->getLoadDeltaTime( iModuleId, piValue );
2333 
2334  return iRetVal;
2335 }
2336 
2337 M5DLL_API int WINAPI PCube_setLoadLimit( int iDeviceId, int iModuleId, long iValue)
2338 {
2339  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2340  return ERRID_DEV_WRONGDEVICEID;
2341  if( g_apclDevice[iDeviceId] == NULL )
2342  return ERRID_DEV_NOTINITIALIZED;
2343 
2344  int iRetVal = g_apclDevice[iDeviceId]->setLoadLimit( iModuleId, iValue );
2345 
2346  return iRetVal;
2347 }
2348 
2349 M5DLL_API int WINAPI PCube_setMaxLoadGradient( int iDeviceId, int iModuleId, long iValue)
2350 {
2351  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2352  return ERRID_DEV_WRONGDEVICEID;
2353  if( g_apclDevice[iDeviceId] == NULL )
2354  return ERRID_DEV_NOTINITIALIZED;
2355 
2356  int iRetVal = g_apclDevice[iDeviceId]->setMaxLoadGradient( iModuleId, iValue );
2357 
2358  return iRetVal;
2359 }
2360 
2361 M5DLL_API int WINAPI PCube_setLoadDeltaTime( int iDeviceId, int iModuleId, unsigned short iValue)
2362 {
2363  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2364  return ERRID_DEV_WRONGDEVICEID;
2365  if( g_apclDevice[iDeviceId] == NULL )
2366  return ERRID_DEV_NOTINITIALIZED;
2367 
2368  int iRetVal = g_apclDevice[iDeviceId]->setLoadDeltaTime( iModuleId, iValue );
2369 
2370  return iRetVal;
2371 }
2372 
2373 M5DLL_API int WINAPI PCube_saveParameters( int iDeviceId, int iModuleId )
2374 {
2375  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2376  return ERRID_DEV_WRONGDEVICEID;
2377  if( g_apclDevice[iDeviceId] == NULL )
2378  return ERRID_DEV_NOTINITIALIZED;
2379 
2380  int iRetVal = g_apclDevice[iDeviceId]->saveParameters( iModuleId );
2381 
2382  return iRetVal;
2383 }
2384 
2385 M5DLL_API int WINAPI PCube_getDefCANBaudRate( int iDeviceId, int iModuleId, unsigned char* pucValue )
2386 {
2387  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2388  return ERRID_DEV_WRONGDEVICEID;
2389  if( g_apclDevice[iDeviceId] == NULL )
2390  return ERRID_DEV_NOTINITIALIZED;
2391 
2392  int iRetVal = g_apclDevice[iDeviceId]->getDefCANBaudRate( iModuleId, pucValue );
2393 
2394  return iRetVal;
2395 }
2396 
2397 M5DLL_API int WINAPI PCube_getDefRSBaudRate( int iDeviceId, int iModuleId, unsigned char* pucValue )
2398 {
2399  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2400  return ERRID_DEV_WRONGDEVICEID;
2401  if( g_apclDevice[iDeviceId] == NULL )
2402  return ERRID_DEV_NOTINITIALIZED;
2403 
2404  int iRetVal = g_apclDevice[iDeviceId]->getDefRSBaudRate( iModuleId, pucValue );
2405 
2406  return iRetVal;
2407 }
2408 
2409 M5DLL_API int WINAPI PCube_setDefGearRatio( int iDeviceId, int iModuleId, float fValue )
2410 {
2411  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2412  return ERRID_DEV_WRONGDEVICEID;
2413  if( g_apclDevice[iDeviceId] == NULL )
2414  return ERRID_DEV_NOTINITIALIZED;
2415 
2416  int iRetVal = g_apclDevice[iDeviceId]->setDefGearRatio( iModuleId, fValue );
2417 
2418  return iRetVal;
2419 }
2420 
2421 M5DLL_API int WINAPI PCube_setDefLinRatio( int iDeviceId, int iModuleId, float fValue )
2422 {
2423  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2424  return ERRID_DEV_WRONGDEVICEID;
2425  if( g_apclDevice[iDeviceId] == NULL )
2426  return ERRID_DEV_NOTINITIALIZED;
2427 
2428  int iRetVal = g_apclDevice[iDeviceId]->setDefLinRatio( iModuleId, fValue );
2429 
2430  return iRetVal;
2431 }
2432 
2433 M5DLL_API int WINAPI PCube_setDefCurRatio( int iDeviceId, int iModuleId, float fValue )
2434 {
2435  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2436  return ERRID_DEV_WRONGDEVICEID;
2437  if( g_apclDevice[iDeviceId] == NULL )
2438  return ERRID_DEV_NOTINITIALIZED;
2439 
2440  int iRetVal = g_apclDevice[iDeviceId]->setDefCurRatio( iModuleId, fValue );
2441 
2442  return iRetVal;
2443 }
2444 
2445 M5DLL_API int WINAPI PCube_setDefHomeAcc( int iDeviceId, int iModuleId, float fValue )
2446 {
2447  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2448  return ERRID_DEV_WRONGDEVICEID;
2449  if( g_apclDevice[iDeviceId] == NULL )
2450  return ERRID_DEV_NOTINITIALIZED;
2451 
2452  int iRetVal = g_apclDevice[iDeviceId]->setDefHomeAcc( iModuleId, fValue );
2453 
2454  return iRetVal;
2455 }
2456 
2457 M5DLL_API int WINAPI PCube_setModuleSerialNo( int iDeviceId, int iModuleId, unsigned long uiValue )
2458 {
2459  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2460  return ERRID_DEV_WRONGDEVICEID;
2461  if( g_apclDevice[iDeviceId] == NULL )
2462  return ERRID_DEV_NOTINITIALIZED;
2463 
2464  int iRetVal = g_apclDevice[iDeviceId]->setModuleSerialNo( iModuleId, uiValue );
2465 
2466  return iRetVal;
2467 }
2468 
2469 M5DLL_API int WINAPI PCube_setDefIncPerTurn( int iDeviceId, int iModuleId, unsigned long uiValue )
2470 {
2471  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2472  return ERRID_DEV_WRONGDEVICEID;
2473  if( g_apclDevice[iDeviceId] == NULL )
2474  return ERRID_DEV_NOTINITIALIZED;
2475 
2476  int iRetVal = g_apclDevice[iDeviceId]->setDefIncPerTurn( iModuleId, uiValue );
2477 
2478  return iRetVal;
2479 }
2480 
2481 M5DLL_API int WINAPI PCube_setDefBrakeTimeOut( int iDeviceId, int iModuleId, unsigned short uiValue )
2482 {
2483  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2484  return ERRID_DEV_WRONGDEVICEID;
2485  if( g_apclDevice[iDeviceId] == NULL )
2486  return ERRID_DEV_NOTINITIALIZED;
2487 
2488  int iRetVal = g_apclDevice[iDeviceId]->setDefBrakeTimeOut( iModuleId, uiValue );
2489 
2490  return iRetVal;
2491 }
2492 
2493 M5DLL_API int WINAPI PCube_setDefAddress( int iDeviceId, int iModuleId, unsigned char uiValue )
2494 {
2495  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2496  return ERRID_DEV_WRONGDEVICEID;
2497  if( g_apclDevice[iDeviceId] == NULL )
2498  return ERRID_DEV_NOTINITIALIZED;
2499 
2500  int iRetVal = g_apclDevice[iDeviceId]->setDefAddress( iModuleId, uiValue );
2501 
2502  return iRetVal;
2503 }
2504 
2505 M5DLL_API int WINAPI PCube_setDefCANBaudRate( int iDeviceId, int iModuleId, unsigned char uiValue )
2506 {
2507  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2508  return ERRID_DEV_WRONGDEVICEID;
2509  if( g_apclDevice[iDeviceId] == NULL )
2510  return ERRID_DEV_NOTINITIALIZED;
2511 
2512  int iRetVal = g_apclDevice[iDeviceId]->setDefCANBaudRate( iModuleId, uiValue );
2513 
2514  return iRetVal;
2515 }
2516 
2517 M5DLL_API int WINAPI PCube_setDefRSBaudRate( int iDeviceId, int iModuleId, unsigned char uiValue )
2518 {
2519  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2520  return ERRID_DEV_WRONGDEVICEID;
2521  if( g_apclDevice[iDeviceId] == NULL )
2522  return ERRID_DEV_NOTINITIALIZED;
2523 
2524  int iRetVal = g_apclDevice[iDeviceId]->setDefRSBaudRate( iModuleId, uiValue );
2525 
2526  return iRetVal;
2527 }
2528 
2529 M5DLL_API int WINAPI PCube_setDefSetup( int iDeviceId, int iModuleId, unsigned long uiValue )
2530 {
2531  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2532  return ERRID_DEV_WRONGDEVICEID;
2533  if( g_apclDevice[iDeviceId] == NULL )
2534  return ERRID_DEV_NOTINITIALIZED;
2535 
2536  int iRetVal = g_apclDevice[iDeviceId]->setDefSetup( iModuleId, uiValue );
2537 
2538  return iRetVal;
2539 }
2540 
2541 M5DLL_API int WINAPI PCube_getMotorCurrent( int iDeviceId, int iModuleId, float* pfValue )
2542 {
2543  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2544  return ERRID_DEV_WRONGDEVICEID;
2545  if( g_apclDevice[iDeviceId] == NULL )
2546  return ERRID_DEV_NOTINITIALIZED;
2547 
2548  int iRetVal = g_apclDevice[iDeviceId]->getMotorCurrent( iModuleId, pfValue );
2549 
2550  return iRetVal;
2551 }
2552 
2553 M5DLL_API int WINAPI PCube_getMotorSupply( int iDeviceId, int iModuleId, float* pfValue )
2554 {
2555  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2556  return ERRID_DEV_WRONGDEVICEID;
2557  if( g_apclDevice[iDeviceId] == NULL )
2558  return ERRID_DEV_NOTINITIALIZED;
2559 
2560  int iRetVal = g_apclDevice[iDeviceId]->getMotorSupply( iModuleId, pfValue );
2561 
2562  return iRetVal;
2563 }
2564 
2565 M5DLL_API int WINAPI PCube_getTemperature( int iDeviceId, int iModuleId, float* pfValue )
2566 {
2567  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2568  return ERRID_DEV_WRONGDEVICEID;
2569  if( g_apclDevice[iDeviceId] == NULL )
2570  return ERRID_DEV_NOTINITIALIZED;
2571 
2572  int iRetVal = g_apclDevice[iDeviceId]->getTemperature( iModuleId, pfValue );
2573 
2574  return iRetVal;
2575 }
2576 
2577 M5DLL_API int WINAPI PCube_getLogicSupply( int iDeviceId, int iModuleId, float* pfValue )
2578 {
2579  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2580  return ERRID_DEV_WRONGDEVICEID;
2581  if( g_apclDevice[iDeviceId] == NULL )
2582  return ERRID_DEV_NOTINITIALIZED;
2583 
2584  int iRetVal = g_apclDevice[iDeviceId]->getLogicSupply( iModuleId, pfValue );
2585 
2586  return iRetVal;
2587 }
2588 
2589 M5DLL_API int WINAPI PCube_getMinLogicVoltage( int iDeviceId, int iModuleId, float* pfValue )
2590 {
2591  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2592  return ERRID_DEV_WRONGDEVICEID;
2593  if( g_apclDevice[iDeviceId] == NULL )
2594  return ERRID_DEV_NOTINITIALIZED;
2595 
2596  int iRetVal = g_apclDevice[iDeviceId]->getMinLogicVoltage( iModuleId, pfValue );
2597 
2598  return iRetVal;
2599 }
2600 
2601 M5DLL_API int WINAPI PCube_getMaxLogicVoltage( int iDeviceId, int iModuleId, float* pfValue )
2602 {
2603  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2604  return ERRID_DEV_WRONGDEVICEID;
2605  if( g_apclDevice[iDeviceId] == NULL )
2606  return ERRID_DEV_NOTINITIALIZED;
2607 
2608  int iRetVal = g_apclDevice[iDeviceId]->getMaxLogicVoltage( iModuleId, pfValue );
2609 
2610  return iRetVal;
2611 }
2612 
2613 M5DLL_API int WINAPI PCube_getMinMotorVoltage( int iDeviceId, int iModuleId, float* pfValue )
2614 {
2615  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2616  return ERRID_DEV_WRONGDEVICEID;
2617  if( g_apclDevice[iDeviceId] == NULL )
2618  return ERRID_DEV_NOTINITIALIZED;
2619 
2620  int iRetVal = g_apclDevice[iDeviceId]->getMinMotorVoltage( iModuleId, pfValue );
2621 
2622  return iRetVal;
2623 }
2624 
2625 M5DLL_API int WINAPI PCube_getMaxMotorVoltage( int iDeviceId, int iModuleId, float* pfValue )
2626 {
2627  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2628  return ERRID_DEV_WRONGDEVICEID;
2629  if( g_apclDevice[iDeviceId] == NULL )
2630  return ERRID_DEV_NOTINITIALIZED;
2631 
2632  int iRetVal = g_apclDevice[iDeviceId]->getMaxMotorVoltage( iModuleId, pfValue );
2633 
2634  return iRetVal;
2635 }
2636 
2637 M5DLL_API int WINAPI PCube_getNominalMotorCurrent( int iDeviceId, int iModuleId, float* pfValue )
2638 {
2639  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2640  return ERRID_DEV_WRONGDEVICEID;
2641  if( g_apclDevice[iDeviceId] == NULL )
2642  return ERRID_DEV_NOTINITIALIZED;
2643 
2644  int iRetVal = g_apclDevice[iDeviceId]->getNominalMotorCurrent( iModuleId, pfValue );
2645 
2646  return iRetVal;
2647 }
2648 
2649 M5DLL_API int WINAPI PCube_getMaximumMotorCurrent( int iDeviceId, int iModuleId, float* pfValue )
2650 {
2651  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2652  return ERRID_DEV_WRONGDEVICEID;
2653  if( g_apclDevice[iDeviceId] == NULL )
2654  return ERRID_DEV_NOTINITIALIZED;
2655 
2656  int iRetVal = g_apclDevice[iDeviceId]->getMaximumMotorCurrent( iModuleId, pfValue );
2657 
2658  return iRetVal;
2659 }
2660 
2661 M5DLL_API int WINAPI PCube_getLogicUndershootTime( int iDeviceId, int iModuleId, long* piValue )
2662 {
2663  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2664  return ERRID_DEV_WRONGDEVICEID;
2665  if( g_apclDevice[iDeviceId] == NULL )
2666  return ERRID_DEV_NOTINITIALIZED;
2667 
2668  int iRetVal = g_apclDevice[iDeviceId]->getLogicUndershootTime( iModuleId, piValue );
2669 
2670  return iRetVal;
2671 }
2672 
2673 M5DLL_API int WINAPI PCube_getLogicOvershootTime( int iDeviceId, int iModuleId, long* piValue )
2674 {
2675  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2676  return ERRID_DEV_WRONGDEVICEID;
2677  if( g_apclDevice[iDeviceId] == NULL )
2678  return ERRID_DEV_NOTINITIALIZED;
2679 
2680  int iRetVal = g_apclDevice[iDeviceId]->getLogicOvershootTime( iModuleId, piValue );
2681 
2682  return iRetVal;
2683 }
2684 
2685 M5DLL_API int WINAPI PCube_getMotorUndershootTime( int iDeviceId, int iModuleId, long* piValue )
2686 {
2687  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2688  return ERRID_DEV_WRONGDEVICEID;
2689  if( g_apclDevice[iDeviceId] == NULL )
2690  return ERRID_DEV_NOTINITIALIZED;
2691 
2692  int iRetVal = g_apclDevice[iDeviceId]->getMotorUndershootTime( iModuleId, piValue );
2693 
2694  return iRetVal;
2695 }
2696 
2697 M5DLL_API int WINAPI PCube_getMotorOvershootTime( int iDeviceId, int iModuleId, long* piValue )
2698 {
2699  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2700  return ERRID_DEV_WRONGDEVICEID;
2701  if( g_apclDevice[iDeviceId] == NULL )
2702  return ERRID_DEV_NOTINITIALIZED;
2703 
2704  int iRetVal = g_apclDevice[iDeviceId]->getMotorOvershootTime( iModuleId, piValue );
2705 
2706  return iRetVal;
2707 }
2708 
2709 M5DLL_API int WINAPI PCube_getNomCurOvershootTime( int iDeviceId, int iModuleId, long* piValue )
2710 {
2711  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2712  return ERRID_DEV_WRONGDEVICEID;
2713  if( g_apclDevice[iDeviceId] == NULL )
2714  return ERRID_DEV_NOTINITIALIZED;
2715 
2716  int iRetVal = g_apclDevice[iDeviceId]->getNomCurOvershootTime( iModuleId, piValue );
2717 
2718  return iRetVal;
2719 }
2720 
2721 M5DLL_API int WINAPI PCube_getHMaxCurOvershootTime( int iDeviceId, int iModuleId, long* piValue )
2722 {
2723  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2724  return ERRID_DEV_WRONGDEVICEID;
2725  if( g_apclDevice[iDeviceId] == NULL )
2726  return ERRID_DEV_NOTINITIALIZED;
2727 
2728  int iRetVal = g_apclDevice[iDeviceId]->getHMaxCurOvershootTime( iModuleId, piValue );
2729 
2730  return iRetVal;
2731 }
2732 
2733 M5DLL_API int WINAPI PCube_setMinLogicVoltage( int iDeviceId, int iModuleId, float fValue )
2734 {
2735  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2736  return ERRID_DEV_WRONGDEVICEID;
2737  if( g_apclDevice[iDeviceId] == NULL )
2738  return ERRID_DEV_NOTINITIALIZED;
2739 
2740  int iRetVal = g_apclDevice[iDeviceId]->setMinLogicVoltage( iModuleId, fValue );
2741 
2742  return iRetVal;
2743 }
2744 
2745 M5DLL_API int WINAPI PCube_setMaxLogicVoltage( int iDeviceId, int iModuleId, float fValue )
2746 {
2747  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2748  return ERRID_DEV_WRONGDEVICEID;
2749  if( g_apclDevice[iDeviceId] == NULL )
2750  return ERRID_DEV_NOTINITIALIZED;
2751 
2752  int iRetVal = g_apclDevice[iDeviceId]->setMaxLogicVoltage( iModuleId, fValue );
2753 
2754  return iRetVal;
2755 }
2756 
2757 M5DLL_API int WINAPI PCube_setMinMotorVoltage( int iDeviceId, int iModuleId, float fValue )
2758 {
2759  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2760  return ERRID_DEV_WRONGDEVICEID;
2761  if( g_apclDevice[iDeviceId] == NULL )
2762  return ERRID_DEV_NOTINITIALIZED;
2763 
2764  int iRetVal = g_apclDevice[iDeviceId]->setMinMotorVoltage( iModuleId, fValue );
2765 
2766  return iRetVal;
2767 }
2768 
2769 M5DLL_API int WINAPI PCube_setMaxMotorVoltage( int iDeviceId, int iModuleId, float fValue )
2770 {
2771  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2772  return ERRID_DEV_WRONGDEVICEID;
2773  if( g_apclDevice[iDeviceId] == NULL )
2774  return ERRID_DEV_NOTINITIALIZED;
2775 
2776  int iRetVal = g_apclDevice[iDeviceId]->setMaxMotorVoltage( iModuleId, fValue );
2777 
2778  return iRetVal;
2779 }
2780 
2781 M5DLL_API int WINAPI PCube_setNominalMotorCurrent( int iDeviceId, int iModuleId, float fValue )
2782 {
2783  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2784  return ERRID_DEV_WRONGDEVICEID;
2785  if( g_apclDevice[iDeviceId] == NULL )
2786  return ERRID_DEV_NOTINITIALIZED;
2787 
2788  int iRetVal = g_apclDevice[iDeviceId]->setNominalMotorCurrent( iModuleId, fValue );
2789 
2790  return iRetVal;
2791 }
2792 
2793 M5DLL_API int WINAPI PCube_setMaximumMotorCurrent( int iDeviceId, int iModuleId, float fValue )
2794 {
2795  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2796  return ERRID_DEV_WRONGDEVICEID;
2797  if( g_apclDevice[iDeviceId] == NULL )
2798  return ERRID_DEV_NOTINITIALIZED;
2799 
2800  int iRetVal = g_apclDevice[iDeviceId]->setMaximumMotorCurrent( iModuleId, fValue );
2801 
2802  return iRetVal;
2803 }
2804 
2805 M5DLL_API int WINAPI PCube_setLogicUndershootTime( int iDeviceId, int iModuleId, long iValue )
2806 {
2807  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2808  return ERRID_DEV_WRONGDEVICEID;
2809  if( g_apclDevice[iDeviceId] == NULL )
2810  return ERRID_DEV_NOTINITIALIZED;
2811 
2812  int iRetVal = g_apclDevice[iDeviceId]->setLogicUndershootTime( iModuleId, iValue );
2813 
2814  return iRetVal;
2815 }
2816 
2817 M5DLL_API int WINAPI PCube_setLogicOvershootTime( int iDeviceId, int iModuleId, long iValue )
2818 {
2819  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2820  return ERRID_DEV_WRONGDEVICEID;
2821  if( g_apclDevice[iDeviceId] == NULL )
2822  return ERRID_DEV_NOTINITIALIZED;
2823 
2824  int iRetVal = g_apclDevice[iDeviceId]->setLogicOvershootTime( iModuleId, iValue );
2825 
2826  return iRetVal;
2827 }
2828 
2829 M5DLL_API int WINAPI PCube_setMotorUndershootTime( int iDeviceId, int iModuleId, long iValue )
2830 {
2831  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2832  return ERRID_DEV_WRONGDEVICEID;
2833  if( g_apclDevice[iDeviceId] == NULL )
2834  return ERRID_DEV_NOTINITIALIZED;
2835 
2836  int iRetVal = g_apclDevice[iDeviceId]->setMotorUndershootTime( iModuleId, iValue );
2837 
2838  return iRetVal;
2839 }
2840 
2841 M5DLL_API int WINAPI PCube_setMotorOvershootTime( int iDeviceId, int iModuleId, long iValue )
2842 {
2843  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2844  return ERRID_DEV_WRONGDEVICEID;
2845  if( g_apclDevice[iDeviceId] == NULL )
2846  return ERRID_DEV_NOTINITIALIZED;
2847 
2848  int iRetVal = g_apclDevice[iDeviceId]->setMotorOvershootTime( iModuleId, iValue );
2849 
2850  return iRetVal;
2851 }
2852 
2853 M5DLL_API int WINAPI PCube_setNomCurOvershootTime( int iDeviceId, int iModuleId, long iValue )
2854 {
2855  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2856  return ERRID_DEV_WRONGDEVICEID;
2857  if( g_apclDevice[iDeviceId] == NULL )
2858  return ERRID_DEV_NOTINITIALIZED;
2859 
2860  int iRetVal = g_apclDevice[iDeviceId]->setNomCurOvershootTime( iModuleId, iValue );
2861 
2862  return iRetVal;
2863 }
2864 
2865 M5DLL_API int WINAPI PCube_setHMaxCurOvershootTime( int iDeviceId, int iModuleId, long iValue )
2866 {
2867  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2868  return ERRID_DEV_WRONGDEVICEID;
2869  if( g_apclDevice[iDeviceId] == NULL )
2870  return ERRID_DEV_NOTINITIALIZED;
2871 
2872  int iRetVal = g_apclDevice[iDeviceId]->setHMaxCurOvershootTime( iModuleId, iValue );
2873 
2874  return iRetVal;
2875 }
2876 
2877 M5DLL_API int WINAPI PCube_getKpPWMLimit( int iDeviceId, int iModuleId, long* piValue )
2878 {
2879  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2880  return ERRID_DEV_WRONGDEVICEID;
2881  if( g_apclDevice[iDeviceId] == NULL )
2882  return ERRID_DEV_NOTINITIALIZED;
2883 
2884  int iRetVal = g_apclDevice[iDeviceId]->getKpPWMLimit( iModuleId, piValue );
2885 
2886  return iRetVal;
2887 }
2888 
2889 M5DLL_API int WINAPI PCube_getCurrentLimit( int iDeviceId, int iModuleId, float* pfValue )
2890 {
2891  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2892  return ERRID_DEV_WRONGDEVICEID;
2893  if( g_apclDevice[iDeviceId] == NULL )
2894  return ERRID_DEV_NOTINITIALIZED;
2895 
2896  int iRetVal = g_apclDevice[iDeviceId]->getCurrentLimit( iModuleId, pfValue );
2897 
2898  return iRetVal;
2899 }
2900 
2901 M5DLL_API int WINAPI PCube_getMaxPWMOutput( int iDeviceId, int iModuleId, long* piValue )
2902 {
2903  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2904  return ERRID_DEV_WRONGDEVICEID;
2905  if( g_apclDevice[iDeviceId] == NULL )
2906  return ERRID_DEV_NOTINITIALIZED;
2907 
2908  int iRetVal = g_apclDevice[iDeviceId]->getMaxPWMOutput( iModuleId, piValue );
2909 
2910  return iRetVal;
2911 }
2912 
2913 M5DLL_API int WINAPI PCube_setKpPWMLimit( int iDeviceId, int iModuleId, long iValue )
2914 {
2915  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2916  return ERRID_DEV_WRONGDEVICEID;
2917  if( g_apclDevice[iDeviceId] == NULL )
2918  return ERRID_DEV_NOTINITIALIZED;
2919 
2920  int iRetVal = g_apclDevice[iDeviceId]->setKpPWMLimit( iModuleId, iValue );
2921 
2922  return iRetVal;
2923 }
2924 
2925 M5DLL_API int WINAPI PCube_setCurrentLimit( int iDeviceId, int iModuleId, float fValue )
2926 {
2927  if(0 > iDeviceId || iDeviceId >= g_apclDevice.size())
2928  return ERRID_DEV_WRONGDEVICEID;
2929  if( g_apclDevice[iDeviceId] == NULL )
2930  return ERRID_DEV_NOTINITIALIZED;
2931 
2932  int iRetVal = g_apclDevice[iDeviceId]->setCurrentLimit( iModuleId, fValue );
2933 
2934  return iRetVal;
2935 }
M5DLL_API int WINAPI PCube_getDefHomeOffset(int iDeviceId, int iModuleId, float *pfValue)
Definition: m5apiw32.cpp:772
M5DLL_API int WINAPI PCube_getDataEMS_DIO(int iDeviceId, int iModuleId, int iChannelId, int *pData)
Definition: m5apiw32.cpp:2130
M5DLL_API int WINAPI PCube_setLoadDeltaTime(int iDeviceId, int iModuleId, unsigned short iValue)
Definition: m5apiw32.cpp:2361
M5DLL_API int WINAPI PCube_getMotorSupply(int iDeviceId, int iModuleId, float *pfValue)
Definition: m5apiw32.cpp:2553
M5DLL_API int WINAPI PCube_setInitMP55_IO_fast(int iDeviceId, int iModuleId)
Definition: m5apiw32.cpp:2217
M5DLL_API int WINAPI PCube_resetAll(int iDeviceId)
Definition: m5apiw32.cpp:1828
M5DLL_API int WINAPI PCube_getDataSCHUNK_FTC(int iDeviceId, int iModulId, int iChannelTypeId, float *fVal0, float *fVal1, float *fVal2, float *fVal3, float *fVal4, float *fVal5, short *piState)
Definition: m5apiw32.cpp:2087
M5DLL_API int WINAPI PCube_setLogicUndershootTime(int iDeviceId, int iModuleId, long iValue)
Definition: m5apiw32.cpp:2805
M5DLL_API int WINAPI PCube_moveStepInc(int iDeviceId, int iModuleId, long iPos, unsigned short uiTime)
Definition: m5apiw32.cpp:1744
#define MAX_MODULES
Definition: m5apiw32.h:28
M5DLL_API int WINAPI PCube_getMaxCur(int iDeviceId, int iModuleId, float *pfValue)
Definition: m5apiw32.cpp:1048
void setDebug(bool bFlag)
Definition: Message.cpp:124
M5DLL_API int WINAPI PCube_closeDevices(void)
Definition: m5apiw32.cpp:446
M5DLL_API int WINAPI PCube_getVelInc(int iDeviceId, int iModuleId, long *piValue)
Definition: m5apiw32.cpp:1132
M5DLL_API int WINAPI PCube_getMaxPos(int iDeviceId, int iModuleId, float *pfValue)
Definition: m5apiw32.cpp:1012
M5DLL_API int WINAPI PCube_getKpPWMLimit(int iDeviceId, int iModuleId, long *piValue)
Definition: m5apiw32.cpp:2877
M5DLL_API int WINAPI PCube_waitForRampEnd(int iDeviceId, int iModuleId, unsigned long uiTime)
Definition: m5apiw32.cpp:1924
M5DLL_API int WINAPI PCube_getDefBrakeTimeOut(int iDeviceId, int iModuleId, unsigned short *puiValue)
Definition: m5apiw32.cpp:700
M5DLL_API int WINAPI PCube_getLogicUndershootTime(int iDeviceId, int iModuleId, long *piValue)
Definition: m5apiw32.cpp:2661
M5DLL_API int WINAPI PCube_setMaxCur(int iDeviceId, int iModuleId, float fValue)
Definition: m5apiw32.cpp:1408
M5DLL_API int WINAPI PCube_setKpPWMLimit(int iDeviceId, int iModuleId, long iValue)
Definition: m5apiw32.cpp:2913
#define WINAPI
Definition: m5apiw32.h:42
M5DLL_API int WINAPI PCube_setMaxPos(int iDeviceId, int iModuleId, float fValue)
Definition: m5apiw32.cpp:1372
M5DLL_API int WINAPI PCube_getModuleIdMap(int iDeviceId, int *aiIdMap)
Definition: m5apiw32.cpp:551
M5DLL_API int WINAPI PCube_getVel(int iDeviceId, int iModuleId, float *pfVel)
Definition: m5apiw32.cpp:976
M5DLL_API int WINAPI PCube_getMaxDeltaPos(int iDeviceId, int iModuleId, float *pfValue)
Definition: m5apiw32.cpp:1072
M5DLL_API int WINAPI PCube_setHMaxCurOvershootTime(int iDeviceId, int iModuleId, long iValue)
Definition: m5apiw32.cpp:2865
M5DLL_API int WINAPI PCube_getMaxLogicVoltage(int iDeviceId, int iModuleId, float *pfValue)
Definition: m5apiw32.cpp:2601
M5DLL_API int WINAPI PCube_getDataDLR_FTS(int iDeviceId, float *fVal0, float *fVal1, float *fVal2, float *fVal3, float *fVal4, float *fVal5, long *piState)
Definition: m5apiw32.cpp:2068
M5DLL_API int WINAPI PCube_setDefCANBaudRate(int iDeviceId, int iModuleId, unsigned char uiValue)
Definition: m5apiw32.cpp:2505
#define ERRID_DEV_NOINITSTRING
Definition: m5apiw32.h:207
M5DLL_API int WINAPI PCube_getMaxPosInc(int iDeviceId, int iModuleId, long *piValue)
Definition: m5apiw32.cpp:1168
M5DLL_API int WINAPI PCube_setMaxLoadGradient(int iDeviceId, int iModuleId, long iValue)
Definition: m5apiw32.cpp:2349
M5DLL_API int WINAPI PCube_getModuleSerialNo(int iDeviceId, int iModuleId, unsigned long *puiValue)
Definition: m5apiw32.cpp:604
M5DLL_API int WINAPI PCube_moveCurExtended(int iDeviceId, int iModuleId, float fCur, unsigned long *puiState, unsigned char *pucDio, float *pfPos)
Definition: m5apiw32.cpp:1792
M5DLL_API int WINAPI PCube_getRawTemperature(int iDeviceId, int iModuleId, short *piValue)
Definition: m5apiw32.cpp:2265
M5DLL_API int WINAPI PCube_getDefConfig(int iDeviceId, int iModuleId, unsigned long *puiValue)
Definition: m5apiw32.cpp:616
M5DLL_API int WINAPI PCube_resetModule(int iDeviceId, int iModuleId)
Definition: m5apiw32.cpp:1612
#define ERRID_DEV_WRONGDEVICEID
Definition: m5apiw32.h:221
M5DLL_API int WINAPI PCube_getMaxAcc(int iDeviceId, int iModuleId, float *pfValue)
Definition: m5apiw32.cpp:1036
M5DLL_API int WINAPI PCube_getDefMaxCur(int iDeviceId, int iModuleId, float *pfValue)
Definition: m5apiw32.cpp:844
M5DLL_API int WINAPI PCube_getMaxPWMOutput(int iDeviceId, int iModuleId, long *piValue)
Definition: m5apiw32.cpp:2901
#define ERRID_DEV_OPENINIFILE
Definition: m5apiw32.h:235
M5DLL_API int WINAPI PCube_getDefA0(int iDeviceId, int iModuleId, short *piValue)
Definition: m5apiw32.cpp:736
M5DLL_API int WINAPI PCube_getDefIncPerTurn(int iDeviceId, int iModuleId, unsigned long *puiValue)
Definition: m5apiw32.cpp:712
M5DLL_API int WINAPI PCube_setModuleSerialNo(int iDeviceId, int iModuleId, unsigned long uiValue)
Definition: m5apiw32.cpp:2457
M5DLL_API int WINAPI PCube_setLogicOvershootTime(int iDeviceId, int iModuleId, long iValue)
Definition: m5apiw32.cpp:2817
M5DLL_API int WINAPI PCube_homeModule(int iDeviceId, int iModuleId)
Definition: m5apiw32.cpp:1588
M5DLL_API int WINAPI PCube_getModuleState(int iDeviceId, int iModuleId, unsigned long *puiState)
Definition: m5apiw32.cpp:568
M5DLL_API int WINAPI PCube_setHomeVelInc(int iDeviceId, int iModuleId, long iValue)
Definition: m5apiw32.cpp:1504
M5DLL_API int WINAPI PCube_getMinLogicVoltage(int iDeviceId, int iModuleId, float *pfValue)
Definition: m5apiw32.cpp:2589
M5DLL_API const char *WINAPI PCube_getDeviceName(int iDeviceId)
Definition: m5apiw32.cpp:472
M5DLL_API int WINAPI PCube_setNullSCHUNK_FTC(int iDeviceId, int iModulId, short *piState)
Definition: m5apiw32.cpp:2106
M5DLL_API const char *WINAPI PCube_getDeviceInitString(int iDeviceId)
Definition: m5apiw32.cpp:483
M5DLL_API int WINAPI PCube_setMaxVelInc(int iDeviceId, int iModuleId, long iValue)
Definition: m5apiw32.cpp:1456
M5DLL_API int WINAPI PCube_getNominalMotorCurrent(int iDeviceId, int iModuleId, float *pfValue)
Definition: m5apiw32.cpp:2637
M5DLL_API int WINAPI PCube_moveStep(int iDeviceId, int iModuleId, float fPos, unsigned short uiTime)
Definition: m5apiw32.cpp:1684
M5DLL_API int WINAPI PCube_setDefHomeAcc(int iDeviceId, int iModuleId, float fValue)
Definition: m5apiw32.cpp:2445
M5DLL_API int WINAPI PCube_moveCurInc(int iDeviceId, int iModuleId, long iCur)
Definition: m5apiw32.cpp:1732
M5DLL_API int WINAPI PCube_setMinPos(int iDeviceId, int iModuleId, float fValue)
Definition: m5apiw32.cpp:1360
M5DLL_API int WINAPI PCube_getModuleVersion(int iDeviceId, int iModuleId, unsigned short *puiValue)
Definition: m5apiw32.cpp:592
M5DLL_API int WINAPI PCube_getRawMotorSupply(int iDeviceId, int iModuleId, short *piValue)
Definition: m5apiw32.cpp:2253
M5DLL_API int WINAPI PCube_setMaxLogicVoltage(int iDeviceId, int iModuleId, float fValue)
Definition: m5apiw32.cpp:2745
M5DLL_API int WINAPI PCube_getDefGearRatio(int iDeviceId, int iModuleId, float *pfValue)
Definition: m5apiw32.cpp:664
M5DLL_API int WINAPI PCube_serveWatchdogAll(int iDeviceId)
Definition: m5apiw32.cpp:1852
M5DLL_API int WINAPI PCube_getLoadLimit(int iDeviceId, int iModuleId, long *piValue)
Definition: m5apiw32.cpp:2301
M5DLL_API int WINAPI PCube_getDefMaxVel(int iDeviceId, int iModuleId, float *pfValue)
Definition: m5apiw32.cpp:820
M5DLL_API int WINAPI PCube_setTaraMP55_IO(int iDeviceId, int iModuleId, float fData)
Definition: m5apiw32.cpp:2193
M5DLL_API int WINAPI PCube_moveVelInc(int iDeviceId, int iModuleId, long iVel)
Definition: m5apiw32.cpp:1720
M5DLL_API int WINAPI PCube_waitForRampSteady(int iDeviceId, int iModuleId, unsigned long uiTime)
Definition: m5apiw32.cpp:1948
M5DLL_API int WINAPI PCube_setRampAcc(int iDeviceId, int iModuleId, float fValue)
Definition: m5apiw32.cpp:1540
M5DLL_API int WINAPI PCube_configFromFile(const char *acFileName)
Definition: m5apiw32.cpp:144
M5DLL_API int WINAPI PCube_getDamp(int iDeviceId, int iModuleId, short *piValue)
Definition: m5apiw32.cpp:952
M5DLL_API int WINAPI PCube_setMaxPosInc(int iDeviceId, int iModuleId, long iValue)
Definition: m5apiw32.cpp:1444
M5DLL_API int WINAPI PCube_getModuleCount(int iDeviceId)
Definition: m5apiw32.cpp:541
M5DLL_API int WINAPI PCube_getIPolVel(int iDeviceId, int iModuleId, float *pValue)
Definition: m5apiw32.cpp:1096
#define ERRID_DEV_NOTINITIALIZED
Definition: m5apiw32.h:211
M5DLL_API int WINAPI PCube_setMotorUndershootTime(int iDeviceId, int iModuleId, long iValue)
Definition: m5apiw32.cpp:2829
M5DLL_API int WINAPI PCube_setNominalMotorCurrent(int iDeviceId, int iModuleId, float fValue)
Definition: m5apiw32.cpp:2781
M5DLL_API int WINAPI PCube_getIncRatio(int iDeviceId, int iModuleId, float *pValue)
Definition: m5apiw32.cpp:904
M5DLL_API int WINAPI PCube_setRampVelInc(int iDeviceId, int iModuleId, long iValue)
Definition: m5apiw32.cpp:1528
M5DLL_API int WINAPI PCube_movePosInc(int iDeviceId, int iModuleId, long iPos)
Definition: m5apiw32.cpp:1696
M5DLL_API int WINAPI PCube_getCurInc(int iDeviceId, int iModuleId, short *piValue)
Definition: m5apiw32.cpp:1144
M5DLL_API int g_iM5Debug
Definition: m5apiw32.cpp:34
M5DLL_API int WINAPI PCube_setDefBrakeTimeOut(int iDeviceId, int iModuleId, unsigned short uiValue)
Definition: m5apiw32.cpp:2481
M5DLL_API int WINAPI PCube_waitForHomeEnd(int iDeviceId, int iModuleId, unsigned long uiTime)
Definition: m5apiw32.cpp:1900
M5DLL_API int WINAPI PCube_setHomeOffsetInc(int iDeviceId, int iModuleId, long iValue)
Definition: m5apiw32.cpp:1300
M5DLL_API int WINAPI PCube_getNomCurOvershootTime(int iDeviceId, int iModuleId, long *piValue)
Definition: m5apiw32.cpp:2709
M5DLL_API int WINAPI PCube_closeDevice(int iDeviceId)
Definition: m5apiw32.cpp:427
M5DLL_API int WINAPI PCube_setSyncTime(int iDeviceId, int iModuleId, short iValue)
Definition: m5apiw32.cpp:1564
M5DLL_API int WINAPI PCube_getDeviceIdMap(int *aiIdMap)
Definition: m5apiw32.cpp:528
M5DLL_API int WINAPI PCube_getDefBurnCount(int iDeviceId, int iModuleId, unsigned char *pucValue)
Definition: m5apiw32.cpp:652
M5DLL_API int WINAPI PCube_getCanOpenRawAbsEnc(int iDeviceId, int iModuleId, short *piValue)
Definition: m5apiw32.cpp:2289
M5DLL_API int WINAPI PCube_moveVelExtended(int iDeviceId, int iModuleId, float fCur, unsigned long *puiState, unsigned char *pucDio, float *pfPos)
Definition: m5apiw32.cpp:1780
M5DLL_API int WINAPI PCube_getDefBaudRate(int iDeviceId, int iModuleId, unsigned char *pucValue)
Definition: m5apiw32.cpp:640
M5DLL_API int WINAPI PCube_setMaxVel(int iDeviceId, int iModuleId, float fValue)
Definition: m5apiw32.cpp:1384
M5DLL_API int WINAPI PCube_getDataMP55_IO(int iDeviceId, int iModuleId, float *pfData)
Definition: m5apiw32.cpp:2181
M5DLL_API int WINAPI PCube_getDefRSBaudRate(int iDeviceId, int iModuleId, unsigned char *pucValue)
Definition: m5apiw32.cpp:2397
#define M5DLL_API
Definition: m5apiw32.h:43
M5DLL_API int WINAPI PCube_haltAll(int iDeviceId)
Definition: m5apiw32.cpp:1840
M5DLL_API int WINAPI PCube_getDllVersion()
Definition: m5apiw32.cpp:124
M5DLL_API int WINAPI PCube_setC0(int iDeviceId, int iModuleId, short iValue)
Definition: m5apiw32.cpp:1336
M5DLL_API int WINAPI PCube_setBaudRateAll(int iDeviceId, unsigned char ucValue)
Definition: m5apiw32.cpp:1864
M5DLL_API int WINAPI PCube_getMaxLoadGradient(int iDeviceId, int iModuleId, long *piValue)
Definition: m5apiw32.cpp:2313
M5DLL_API int WINAPI PCube_setMinMotorVoltage(int iDeviceId, int iModuleId, float fValue)
Definition: m5apiw32.cpp:2757
M5DLL_API int WINAPI PCube_haltModule(int iDeviceId, int iModuleId)
Definition: m5apiw32.cpp:1600
M5DLL_API int WINAPI PCube_getModuleType(int iDeviceId, int iModuleId, unsigned char *pucValue)
Definition: m5apiw32.cpp:580
M5DLL_API int WINAPI PCube_homeAll(int iDeviceId)
Definition: m5apiw32.cpp:1816
M5DLL_API int WINAPI PCube_setDefSetup(int iDeviceId, int iModuleId, unsigned long uiValue)
Definition: m5apiw32.cpp:2529
M5DLL_API int WINAPI PCube_setMinLogicVoltage(int iDeviceId, int iModuleId, float fValue)
Definition: m5apiw32.cpp:2733
M5DLL_API int WINAPI PCube_doInternal(int iDeviceId, int iModuleId, void *pBytes)
Definition: m5apiw32.cpp:2032
M5DLL_API int WINAPI PCube_setLoadLimit(int iDeviceId, int iModuleId, long iValue)
Definition: m5apiw32.cpp:2337
M5DLL_API int WINAPI PCube_getDefMinPos(int iDeviceId, int iModuleId, float *pfValue)
Definition: m5apiw32.cpp:796
M5DLL_API int WINAPI PCube_getA0(int iDeviceId, int iModuleId, short *piValue)
Definition: m5apiw32.cpp:928
M5DLL_API int WINAPI PCube_getStateDioPos(int iDeviceId, int iModuleId, unsigned long *puiState, unsigned char *pucDio, float *pfPos)
Definition: m5apiw32.cpp:1228
M5DLL_API int WINAPI PCube_getDefCurRatio(int iDeviceId, int iModuleId, float *pfValue)
Definition: m5apiw32.cpp:688
M5DLL_API int WINAPI PCube_getHomeVelInc(int iDeviceId, int iModuleId, long *piValue)
Definition: m5apiw32.cpp:1252
M5DLL_API int WINAPI PCube_waitForRampEndAll(int iDeviceId, unsigned long uiTime)
Definition: m5apiw32.cpp:1984
void warning(const char *pcWarningMessage,...) const
Definition: Message.cpp:257
M5DLL_API int WINAPI PCube_getMaxVelInc(int iDeviceId, int iModuleId, long *piValue)
Definition: m5apiw32.cpp:1180
M5DLL_API int WINAPI PCube_moveStepExtended(int iDeviceId, int iModuleId, float fPos, unsigned short uiTime, unsigned long *puiState, unsigned char *pucDio, float *pfPos)
Definition: m5apiw32.cpp:1804
static std::vector< CDevice * > g_apclDevice
Definition: m5apiw32.cpp:41
M5DLL_API int WINAPI PCube_moveRamp(int iDeviceId, int iModuleId, float fPos, float fVel, float fAcc)
Definition: m5apiw32.cpp:1648
M5DLL_API int WINAPI PCube_getMinPosInc(int iDeviceId, int iModuleId, long *piValue)
Definition: m5apiw32.cpp:1156
M5DLL_API int WINAPI PCube_getMaxMotorVoltage(int iDeviceId, int iModuleId, float *pfValue)
Definition: m5apiw32.cpp:2625
M5DLL_API int WINAPI PCube_saveParameters(int iDeviceId, int iModuleId)
Definition: m5apiw32.cpp:2373
void setDebugLevel(int iLevel)
Definition: Message.cpp:119
M5DLL_API int WINAPI PCube_xack8Bytes(int iDeviceId, int iModuleId, void *pBytes)
Definition: m5apiw32.cpp:2020
M5DLL_API int WINAPI PCube_setConfig(int iDeviceId, int iModuleId, unsigned long puiValue)
Definition: m5apiw32.cpp:1276
M5DLL_API int WINAPI PCube_getDefSetup(int iDeviceId, int iModuleId, unsigned long *puiValue)
Definition: m5apiw32.cpp:628
M5DLL_API int WINAPI PCube_setMaximumMotorCurrent(int iDeviceId, int iModuleId, float fValue)
Definition: m5apiw32.cpp:2793
M5DLL_API int WINAPI PCube_setCurrentLimit(int iDeviceId, int iModuleId, float fValue)
Definition: m5apiw32.cpp:2925
void setDebugFile(bool bFlag)
Definition: Message.cpp:129
M5DLL_API int WINAPI PCube_setMaxDeltaPosInc(int iDeviceId, int iModuleId, long iValue)
Definition: m5apiw32.cpp:1480
M5DLL_API int WINAPI PCube_setDefLinRatio(int iDeviceId, int iModuleId, float fValue)
Definition: m5apiw32.cpp:2421
M5DLL_API int WINAPI PCube_getRawLogicSupply(int iDeviceId, int iModuleId, short *piValue)
Definition: m5apiw32.cpp:2277
M5DLL_API int WINAPI PCube_setDllDebug(int iDebug, int iDebugLevel, int iDebugFile)
Definition: m5apiw32.cpp:129
M5DLL_API int WINAPI PCube_setNomCurOvershootTime(int iDeviceId, int iModuleId, long iValue)
Definition: m5apiw32.cpp:2853
M5DLL_API int WINAPI PCube_getC0(int iDeviceId, int iModuleId, short *piValue)
Definition: m5apiw32.cpp:940
M5DLL_API int WINAPI PCube_moveRampInc(int iDeviceId, int iModuleId, long iPos, long iVel, long iAcc)
Definition: m5apiw32.cpp:1708
M5DLL_API int WINAPI PCube_setDamp(int iDeviceId, int iModuleId, short iValue)
Definition: m5apiw32.cpp:1348
M5DLL_API int WINAPI PCube_getCur(int iDeviceId, int iModuleId, float *pfCur)
Definition: m5apiw32.cpp:988
M5DLL_API int WINAPI PCube_getDeltaPosInc(int iDeviceId, int iModuleId, long *piValue)
Definition: m5apiw32.cpp:1204
M5DLL_API int WINAPI PCube_openDevice(int *piDeviceId, const char *acInitString)
Definition: m5apiw32.cpp:366
void debug(const int iDebugLevel, const char *pcDebugMessage,...) const
Definition: Message.cpp:332
M5DLL_API int WINAPI PCube_getMaximumMotorCurrent(int iDeviceId, int iModuleId, float *pfValue)
Definition: m5apiw32.cpp:2649
M5DLL_API int WINAPI PCube_getDioData(int iDeviceId, int iModuleId, unsigned long *puiValue)
Definition: m5apiw32.cpp:916
M5DLL_API int WINAPI PCube_getMotorOvershootTime(int iDeviceId, int iModuleId, long *piValue)
Definition: m5apiw32.cpp:2697
M5DLL_API int WINAPI PCube_getDefDioData(int iDeviceId, int iModuleId, unsigned long *puiValue)
Definition: m5apiw32.cpp:724
M5DLL_API int WINAPI PCube_getDefDamp(int iDeviceId, int iModuleId, short *piValue)
Definition: m5apiw32.cpp:760
M5DLL_API int WINAPI PCube_getHomeVel(int iDeviceId, int iModuleId, float *pValue)
Definition: m5apiw32.cpp:1240
Definition: Device.h:28
M5DLL_API const char *WINAPI PCube_getDeviceRevision(int iDeviceId)
Definition: m5apiw32.cpp:461
M5DLL_API int WINAPI PCube_initEMS_IO(int iDeviceId, unsigned char ucType, unsigned long uiSerialNo)
Definition: m5apiw32.cpp:2118
M5DLL_API int WINAPI PCube_setMotorOvershootTime(int iDeviceId, int iModuleId, long iValue)
Definition: m5apiw32.cpp:2841
M5DLL_API int WINAPI PCube_getDeltaPos(int iDeviceId, int iModuleId, float *pfValue)
Definition: m5apiw32.cpp:1060
M5DLL_API int g_iM5DebugFile
Definition: m5apiw32.cpp:33
M5DLL_API int WINAPI PCube_getDefLinearRatio(int iDeviceId, int iModuleId, float *pfValue)
Definition: m5apiw32.cpp:676
M5DLL_API int WINAPI PCube_setDefGearRatio(int iDeviceId, int iModuleId, float fValue)
Definition: m5apiw32.cpp:2409
M5DLL_API int WINAPI PCube_waitForRampDec(int iDeviceId, int iModuleId, unsigned long uiTime)
Definition: m5apiw32.cpp:1936
M5DLL_API int WINAPI PCube_setA0(int iDeviceId, int iModuleId, short iValue)
Definition: m5apiw32.cpp:1324
M5DLL_API int WINAPI PCube_moveRampExtended(int iDeviceId, int iModuleId, float fPos, float fVel, float fAcc, unsigned long *puiState, unsigned char *pucDio, float *pfPos)
Definition: m5apiw32.cpp:1768
M5DLL_API int WINAPI PCube_waitForStartMotionAll(int iDeviceId)
Definition: m5apiw32.cpp:1996
M5DLL_API int WINAPI PCube_setDeviceDebug(int iDeviceId, int iDebug, int iDebugLevel, int iDebugFile)
Definition: m5apiw32.cpp:505
M5DLL_API int WINAPI PCube_getDefC0(int iDeviceId, int iModuleId, short *piValue)
Definition: m5apiw32.cpp:748
M5DLL_API int WINAPI PCube_getLoadDeltaTime(int iDeviceId, int iModuleId, unsigned short *piValue)
Definition: m5apiw32.cpp:2325
int util_searchString(const char *acSectionName, const char *acKeyName, const char *acDefaultString, char *acReturnString, int iSize, const char *acFileName)
M5DLL_API int WINAPI PCube_getMaxDeltaPosInc(int iDeviceId, int iModuleId, long *piValue)
Definition: m5apiw32.cpp:1216
M5DLL_API int WINAPI PCube_getHomeOffsetInc(int iDeviceId, int iModuleId, long *piValue)
Definition: m5apiw32.cpp:892
M5DLL_API int WINAPI PCube_setMaxAcc(int iDeviceId, int iModuleId, float fValue)
Definition: m5apiw32.cpp:1396
M5DLL_API int WINAPI PCube_setDefAddress(int iDeviceId, int iModuleId, unsigned char uiValue)
Definition: m5apiw32.cpp:2493
M5DLL_API int WINAPI PCube_movePosExtended(int iDeviceId, int iModuleId, float fPos, unsigned long *puiState, unsigned char *pucDio, float *pfPos)
Definition: m5apiw32.cpp:1756
M5DLL_API int WINAPI PCube_xmit8Bytes(int iDeviceId, int iModuleId, void *pBytes)
Definition: m5apiw32.cpp:2008
M5DLL_API int WINAPI PCube_getDefMaxPos(int iDeviceId, int iModuleId, float *pfValue)
Definition: m5apiw32.cpp:808
M5DLL_API int WINAPI PCube_setHomeVel(int iDeviceId, int iModuleId, float fValue)
Definition: m5apiw32.cpp:1492
M5DLL_API int WINAPI PCube_movePos(int iDeviceId, int iModuleId, float fPos)
Definition: m5apiw32.cpp:1636
M5DLL_API int WINAPI PCube_getTemperature(int iDeviceId, int iModuleId, float *pfValue)
Definition: m5apiw32.cpp:2565
M5DLL_API int WINAPI PCube_getDefHomeVel(int iDeviceId, int iModuleId, float *pfValue)
Definition: m5apiw32.cpp:784
M5DLL_API int WINAPI PCube_setHomeOffset(int iDeviceId, int iModuleId, float fValue)
Definition: m5apiw32.cpp:1288
M5DLL_API int WINAPI PCube_recalcPIDParams(int iDeviceId, int iModuleId)
Definition: m5apiw32.cpp:1624
M5DLL_API int WINAPI PCube_getDataEMS_AIO(int iDeviceId, int iModuleId, int iChannelId, float *pfData)
Definition: m5apiw32.cpp:2157
M5DLL_API int WINAPI PCube_setDataEMS_AIO(int iDeviceId, int iModuleId, int iChannelId, float fData)
Definition: m5apiw32.cpp:2169
M5DLL_API int WINAPI PCube_getMinMotorVoltage(int iDeviceId, int iModuleId, float *pfValue)
Definition: m5apiw32.cpp:2613
M5DLL_API int WINAPI PCube_setMaxMotorVoltage(int iDeviceId, int iModuleId, float fValue)
Definition: m5apiw32.cpp:2769
M5DLL_API int WINAPI PCube_getStateInternal(int iDeviceId, int iModuleId, unsigned long *pStat)
Definition: m5apiw32.cpp:2044
M5DLL_API int WINAPI PCube_moveVel(int iDeviceId, int iModuleId, float fVel)
Definition: m5apiw32.cpp:1660
#define ERRID_DEV_NODEVICENAME
Definition: m5apiw32.h:208
M5DLL_API int WINAPI PCube_getPos(int iDeviceId, int iModuleId, float *pfPos)
Definition: m5apiw32.cpp:964
M5DLL_API int WINAPI PCube_getPosCountInc(int iDeviceId, int iModuleId, long *piValue)
Definition: m5apiw32.cpp:1108
M5DLL_API int WINAPI PCube_waitForHomeEndAll(int iDeviceId, unsigned long uiTime)
Definition: m5apiw32.cpp:1960
M5DLL_API int WINAPI PCube_waitForMotionEnd(int iDeviceId, int iModuleId, unsigned long uiTime)
Definition: m5apiw32.cpp:1912
M5DLL_API int g_iM5DebugLevel
Definition: m5apiw32.cpp:32
M5DLL_API int WINAPI PCube_getLogicOvershootTime(int iDeviceId, int iModuleId, long *piValue)
Definition: m5apiw32.cpp:2673
CDevice * newDevice(const char *acInitString)
Definition: Device.cpp:4768
M5DLL_API int WINAPI PCube_getDefCANBaudRate(int iDeviceId, int iModuleId, unsigned char *pucValue)
Definition: m5apiw32.cpp:2385
M5DLL_API int WINAPI PCube_waitForMotionEndAll(int iDeviceId, unsigned long uiTime)
Definition: m5apiw32.cpp:1972
M5DLL_API int WINAPI PCube_getMaxVel(int iDeviceId, int iModuleId, float *pfValue)
Definition: m5apiw32.cpp:1024
M5DLL_API int WINAPI PCube_setDefRSBaudRate(int iDeviceId, int iModuleId, unsigned char uiValue)
Definition: m5apiw32.cpp:2517
M5DLL_API int WINAPI PCube_startMotionAll(int iDeviceId)
Definition: m5apiw32.cpp:1876
M5DLL_API int WINAPI PCube_getMotorCurrent(int iDeviceId, int iModuleId, float *pfValue)
Definition: m5apiw32.cpp:2541
M5DLL_API int WINAPI PCube_initDLR_FTS(int iDeviceId)
Definition: m5apiw32.cpp:2056
M5DLL_API int WINAPI PCube_getDeviceCount(void)
Definition: m5apiw32.cpp:518
M5DLL_API int WINAPI PCube_updateModuleIdMap(int iDeviceId)
Definition: m5apiw32.cpp:1576
M5DLL_API int WINAPI PCube_getSyncTime(int iDeviceId, int iModuleId, short *piValue)
Definition: m5apiw32.cpp:1264
M5DLL_API int WINAPI PCube_getHMaxCurOvershootTime(int iDeviceId, int iModuleId, long *piValue)
Definition: m5apiw32.cpp:2721
virtual int init()=0
M5DLL_API int WINAPI PCube_setDeviceName(int iDeviceId, const char *acDeviceName)
Definition: m5apiw32.cpp:494
static std::vector< int > g_aiDeviceRefCount
Definition: m5apiw32.cpp:42
M5DLL_API int WINAPI PCube_getRawMotorCurrent(int iDeviceId, int iModuleId, short *piValue)
Definition: m5apiw32.cpp:2241
M5DLL_API int WINAPI PCube_getSavePos(int iDeviceId, int iModuleId, float *pfValue)
Definition: m5apiw32.cpp:1084
M5DLL_API int WINAPI PCube_getHomeOffset(int iDeviceId, int iModuleId, float *pValue)
Definition: m5apiw32.cpp:880
M5DLL_API int WINAPI PCube_savePosAll(int iDeviceId)
Definition: m5apiw32.cpp:1888
M5DLL_API int WINAPI PCube_getDefMaxAcc(int iDeviceId, int iModuleId, float *pfValue)
Definition: m5apiw32.cpp:832
M5DLL_API int WINAPI PCube_getDataMP55_IO_fast(int iDeviceId, int iModuleId, float *pfData)
Definition: m5apiw32.cpp:2229
M5DLL_API int WINAPI PCube_setMaxDeltaPos(int iDeviceId, int iModuleId, float fValue)
Definition: m5apiw32.cpp:1420
M5DLL_API int WINAPI PCube_setDataEMS_DIO(int iDeviceId, int iModuleId, int iChannelId, int iData)
Definition: m5apiw32.cpp:2144
M5DLL_API int WINAPI PCube_getMaxAccInc(int iDeviceId, int iModuleId, long *piValue)
Definition: m5apiw32.cpp:1192
M5DLL_API int WINAPI PCube_getConfig(int iDeviceId, int iModuleId, unsigned long *puiValue)
Definition: m5apiw32.cpp:868
M5DLL_API int WINAPI PCube_setDefIncPerTurn(int iDeviceId, int iModuleId, unsigned long uiValue)
Definition: m5apiw32.cpp:2469
M5DLL_API int WINAPI PCube_setMinPosInc(int iDeviceId, int iModuleId, long iValue)
Definition: m5apiw32.cpp:1432
M5DLL_API int WINAPI PCube_getDefMaxDeltaPos(int iDeviceId, int iModuleId, float *pfValue)
Definition: m5apiw32.cpp:856
M5DLL_API int WINAPI PCube_moveCur(int iDeviceId, int iModuleId, float fCur)
Definition: m5apiw32.cpp:1672
M5DLL_API int WINAPI PCube_setMaxAccInc(int iDeviceId, int iModuleId, long iValue)
Definition: m5apiw32.cpp:1468
M5DLL_API int WINAPI PCube_getLogicSupply(int iDeviceId, int iModuleId, float *pfValue)
Definition: m5apiw32.cpp:2577
#define M5DLLVERSION
Definition: m5apiw32.h:27
M5DLL_API int WINAPI PCube_getMinPos(int iDeviceId, int iModuleId, float *pfValue)
Definition: m5apiw32.cpp:1000
M5DLL_API int WINAPI PCube_setRampAccInc(int iDeviceId, int iModuleId, long iValue)
Definition: m5apiw32.cpp:1552
M5DLL_API int WINAPI PCube_getCurrentLimit(int iDeviceId, int iModuleId, float *pfValue)
Definition: m5apiw32.cpp:2889
M5DLL_API int WINAPI PCube_getPosInc(int iDeviceId, int iModuleId, long *piValue)
Definition: m5apiw32.cpp:1120
M5DLL_API int WINAPI PCube_setDioData(int iDeviceId, int iModuleId, unsigned long uiValue)
Definition: m5apiw32.cpp:1312
M5DLL_API int WINAPI PCube_setRampVel(int iDeviceId, int iModuleId, float fValue)
Definition: m5apiw32.cpp:1516
M5DLL_API int WINAPI PCube_getDefCurOffset(int iDeviceId, int iModuleId, float *pfValue)
Definition: m5apiw32.cpp:2205
M5DLL_API int WINAPI PCube_setDefCurRatio(int iDeviceId, int iModuleId, float fValue)
Definition: m5apiw32.cpp:2433
M5DLL_API int WINAPI PCube_getMotorUndershootTime(int iDeviceId, int iModuleId, long *piValue)
Definition: m5apiw32.cpp:2685


schunk_libm5api
Author(s): Florian Weisshardt
autogenerated on Mon Nov 25 2019 03:48:19