newportxps 0.3.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2068 @@
1
+ # XPS Python class
2
+ #
3
+ # for XPS-C8 Firmware V2.6.x
4
+ #
5
+ # See Programmer's manual for more information on XPS function calls
6
+ #
7
+ # Modified by Matt Newville: 01-Apr-2010, 26-Oct-2010
8
+ # - replaced tabs with 4 spaces
9
+ # - replaced very frequent occurences of
10
+ # if (XPS.__usedSockets[socketId] == 0): return
11
+ # with "withValidSocket" decorator, whch raises an exception
12
+ # if there is not a valid socket.
13
+ # made many return values "consistent".
14
+
15
+ import sys
16
+ import socket
17
+
18
+ from .utils import bytes2str, str2bytes
19
+
20
+ class XPSException(Exception):
21
+ """XPS Controller Exception"""
22
+ def __init__(self, msg,*args):
23
+ self.msg = msg
24
+ def __str__(self):
25
+ return str(self.msg)
26
+
27
+ class XPS:
28
+ # Defines
29
+ MAX_NB_SOCKETS = 100
30
+
31
+ # Global variables
32
+ __sockets = {}
33
+ __usedSockets = {}
34
+ __nbSockets = 0
35
+
36
+ # Initialization Function
37
+ def __init__ (self):
38
+ XPS.__nbSockets = 0
39
+ for socketId in range(self.MAX_NB_SOCKETS):
40
+ XPS.__usedSockets[socketId] = 0
41
+ self.errorcodes = {}
42
+
43
+ def withValidSocket(fcn):
44
+ """ decorator to ensure that a valid socket is passed as the
45
+ first argument of the decorated function"""
46
+ def wrapper(*args, **kw):
47
+ try:
48
+ sid = args[1]
49
+ if XPS.__usedSockets[sid] == 0:
50
+ raise XPSException('invalid socket at function %s' % fcn.__name__)
51
+ except IndexError:
52
+ raise XPSException('no socket specified for fucntion %s' % fcn.__name__)
53
+ return fcn(*args, **kw)
54
+ wrapper.__doc__ = fcn.__doc__
55
+ wrapper.__name__ = fcn.__name__
56
+ wrapper.__dict__.update(fcn.__dict__)
57
+ return wrapper
58
+
59
+ # Send command and get return
60
+ @withValidSocket
61
+ def __sendAndReceive (self, socketId, command):
62
+ # print("SEND REC ", command, type(command))
63
+ try:
64
+ XPS.__sockets[socketId].send(str2bytes(command))
65
+ ret = bytes2str(XPS.__sockets[socketId].recv(1024))
66
+ while (ret.find(',EndOfAPI') == -1):
67
+ ret += bytes2str(XPS.__sockets[socketId].recv(1024))
68
+ except socket.timeout:
69
+ return [-2, '']
70
+ except socket.error as err: # (errNb, errString):
71
+ print( 'Socket error : ', err.errno, err)
72
+ return [-2, '']
73
+
74
+ for i in range(len(ret)):
75
+ if (ret[i] == ','):
76
+ return [int(ret[0:i]), ret[i+1:-9]]
77
+
78
+ def Send(self, socketId=None, cmd=None, check=False):
79
+ """send and receive command cmd from socketId
80
+ if socketId is not given, self.socketId will be used
81
+ with check=True, an XPSException will be raised on error.
82
+ """
83
+ if socketId is None:
84
+ socketId = self.socketId
85
+ self.socketId = socketId
86
+ err, msg = self.__sendAndReceive(socketId, cmd)
87
+ if err != 0 and check:
88
+ raise XPSException(msg)
89
+ return err, msg
90
+
91
+ # TCP_ConnectToServer
92
+ def TCP_ConnectToServer (self, IP, port, timeOut):
93
+ socketId = 0
94
+ if (XPS.__nbSockets < self.MAX_NB_SOCKETS):
95
+ while (XPS.__usedSockets[socketId] == 1 and socketId < self.MAX_NB_SOCKETS):
96
+ socketId += 1
97
+ self.socketId = socketId
98
+ if (socketId == self.MAX_NB_SOCKETS):
99
+ return -1
100
+ else:
101
+ return -1
102
+
103
+ XPS.__usedSockets[socketId] = 1
104
+ XPS.__nbSockets += 1
105
+ try:
106
+ XPS.__sockets[socketId] = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
107
+ XPS.__sockets[socketId].connect((IP, port))
108
+ XPS.__sockets[socketId].settimeout(timeOut)
109
+ XPS.__sockets[socketId].setblocking(1)
110
+ except socket.error:
111
+ return -1
112
+
113
+ err, ret = self.ErrorListGet(socketId)
114
+ self.errorcodes = {}
115
+ for cline in ret.split(';'):
116
+ if ':' in cline:
117
+ ecode, message = cline.split(':', 1)
118
+ ecode = ecode.replace('Error', '').strip()
119
+ message = message.strip()
120
+ self.errorcodes[ecode] = message
121
+
122
+ return socketId
123
+
124
+ # TCP_SetTimeout
125
+ def TCP_SetTimeout (self, socketId, timeOut):
126
+ if (XPS.__usedSockets[socketId] == 1):
127
+ XPS.__sockets[socketId].settimeout(timeOut)
128
+
129
+ # TCP_CloseSocket
130
+ def TCP_CloseSocket (self, socketId):
131
+ if (socketId >= 0 and socketId < self.MAX_NB_SOCKETS):
132
+ try:
133
+ XPS.__sockets[socketId].close()
134
+ XPS.__usedSockets[socketId] = 0
135
+ XPS.__nbSockets -= 1
136
+ except socket.error:
137
+ pass
138
+
139
+ # GetLibraryVersion
140
+ def GetLibraryVersion (self):
141
+ return ['XPS-C8 Firmware V2.6.x Beta 19']
142
+
143
+ # ControllerMotionKernelTimeLoadGet : Get controller motion kernel time load
144
+ def ControllerMotionKernelTimeLoadGet(self, socketId=None):
145
+ command = 'ControllerMotionKernelTimeLoadGet(double *,double *,double *,double *)'
146
+ error, returnedString = self.Send(socketId=socketId, cmd=command)
147
+ if (error != 0):
148
+ return [error, returnedString]
149
+
150
+ i, j, retList = 0, 0, [error]
151
+ for paramNb in range(4):
152
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
153
+ j += 1
154
+ retList.append(eval(returnedString[i:i+j]))
155
+ i, j = i+j+1, 0
156
+ return retList
157
+
158
+ # ControllerStatusGet : Read controller current status
159
+ def ControllerStatusGet(self, socketId=None):
160
+ error, returnedString = self.Send(socketId=socketId,
161
+ cmd='ControllerStatusGet(int *)', check=True)
162
+ i, j, retList = 0, 0, [error]
163
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
164
+ j += 1
165
+ retList.append(eval(returnedString[i:i+j]))
166
+ return retList
167
+
168
+ # ControllerStatusStringGet : Return the controller status string corresponding to the controller status code
169
+ def ControllerStatusStringGet(self, socketId, ControllerStatusCode):
170
+ command = 'ControllerStatusStringGet(%s, char *)' % str(ControllerStatusCode)
171
+ return self.Send(socketId, command)
172
+
173
+
174
+ # ElapsedTimeGet : Return elapsed time from controller power on
175
+ def ElapsedTimeGet(self, socketId=None):
176
+ command = 'ElapsedTimeGet(double *)'
177
+ [error, returnedString] = self.Send(socketId, command)
178
+ if (error != 0):
179
+ return [error, returnedString]
180
+
181
+ i, j, retList = 0, 0, [error]
182
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
183
+ j += 1
184
+ retList.append(eval(returnedString[i:i+j]))
185
+
186
+ return retList
187
+
188
+
189
+ # ErrorStringGet : Return the error string corresponding to the error code
190
+ def ErrorStringGet(self, socketId, ErrorCode):
191
+ return self.Send(socketId, 'ErrorStringGet(%s, char *)' % str(ErrorCode))
192
+
193
+ # FirmwareVersionGet : Return firmware version
194
+ def FirmwareVersionGet(self, socketId=None):
195
+ return self.Send(socketId, 'FirmwareVersionGet(char *)')
196
+
197
+ # TCLScriptExecute : Execute a TCL script from a TCL file
198
+ def TCLScriptExecute (self, socketId, TCLFileName, TaskName, ParametersList):
199
+ command = 'TCLScriptExecute(' + TCLFileName + ',' + TaskName + ',' + ParametersList + ')'
200
+ return self.Send(socketId, command)
201
+
202
+ # TCLScriptExecuteAndWait : Execute a TCL script from a TCL file and wait the end of execution to return
203
+ def TCLScriptExecuteAndWait (self, socketId, TCLFileName, TaskName, InputParametersList):
204
+ command = 'TCLScriptExecuteAndWait(' + TCLFileName + ',' + TaskName + ',' + InputParametersList + ',char *)'
205
+ return self.Send(socketId, command)
206
+
207
+ # TCLScriptExecuteWithPriority : Execute a TCL script with defined priority
208
+ def TCLScriptExecuteWithPriority (self, socketId, TCLFileName, TaskName, TaskPriorityLevel, ParametersList):
209
+ command = 'TCLScriptExecuteWithPriority(' + TCLFileName + ',' + TaskName + ',' + TaskPriorityLevel + ',' + ParametersList + ')'
210
+ return self.Send(socketId, command)
211
+
212
+ # TCLScriptKill : Kill TCL Task
213
+ def TCLScriptKill (self, socketId, TaskName):
214
+ command = 'TCLScriptKill(' + TaskName + ')'
215
+ return self.Send(socketId, command)
216
+
217
+ # TimerGet : Get a timer
218
+ def TimerGet (self, socketId, TimerName):
219
+ command = 'TimerGet(' + TimerName + ',int *)'
220
+ error, returnedString = self.Send(socketId, command)
221
+ if (error != 0):
222
+ return [error, returnedString]
223
+
224
+ i, j, retList = 0, 0, [error]
225
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
226
+ j += 1
227
+ retList.append(eval(returnedString[i:i+j]))
228
+
229
+ return retList
230
+
231
+ # TimerSet : Set a timer
232
+ def TimerSet (self, socketId, TimerName, FrequencyTicks):
233
+ return self.Send(socketId, 'TimerSet(%s, %s)' % (TimerName, str(FrequencyTicks)))
234
+
235
+ # Reboot : Reboot the controller
236
+ def Reboot (self, socketId):
237
+ return self.Send(socketId, 'Reboot()')
238
+
239
+ # Login : Log in
240
+ def Login (self, socketId, Name, Password):
241
+ return self.Send(socketId, 'Login(%s,%s)' % ( Name, Password) )
242
+
243
+ # CloseAllOtherSockets : Close all socket beside the one used to send this command
244
+ def CloseAllOtherSockets (self, socketId):
245
+ return self.Send(socketId, 'CloseAllOtherSockets()')
246
+
247
+ # HardwareDateAndTimeGet : Return hardware date and time
248
+ def HardwareDateAndTimeGet (self, socketId):
249
+ return self.Send(socketId, 'HardwareDateAndTimeGet(char *)')
250
+
251
+ # HardwareDateAndTimeSet : Set hardware date and time
252
+ def HardwareDateAndTimeSet (self, socketId, DateAndTime):
253
+ return self.Send(socketId, 'HardwareDateAndTimeSet(%s)'% DateAndTime )
254
+
255
+ # EventAdd : ** OBSOLETE ** Add an event
256
+ def EventAdd (self, socketId, PositionerName, EventName, EventParameter, ActionName, ActionParameter1, ActionParameter2, ActionParameter3):
257
+ command = 'EventAdd(' + PositionerName + ',' + EventName + ',' + EventParameter + ',' + ActionName + ',' + ActionParameter1 + ',' + ActionParameter2 + ',' + ActionParameter3 + ')'
258
+ return self.Send(socketId, command)
259
+
260
+ # EventGet : ** OBSOLETE ** Read events and actions list
261
+ def EventGet (self, socketId, PositionerName):
262
+ command = 'EventGet(' + PositionerName + ',char *)'
263
+ return self.Send(socketId, command)
264
+
265
+ # EventRemove : ** OBSOLETE ** Delete an event
266
+ def EventRemove (self, socketId, PositionerName, EventName, EventParameter):
267
+ command = 'EventRemove(' + PositionerName + ',' + EventName + ',' + EventParameter + ')'
268
+ return self.Send(socketId, command)
269
+
270
+ # EventWait : ** OBSOLETE ** Wait an event
271
+ def EventWait (self, socketId, PositionerName, EventName, EventParameter):
272
+ command = 'EventWait(' + PositionerName + ',' + EventName + ',' + EventParameter + ')'
273
+ return self.Send(socketId, command)
274
+
275
+ # EventExtendedConfigurationTriggerSet : Configure one or several events
276
+ def EventExtendedConfigurationTriggerSet (self, socketId, ExtendedEventName, EventParameter1, EventParameter2, EventParameter3, EventParameter4):
277
+ command = 'EventExtendedConfigurationTriggerSet('
278
+ for i in range(len(ExtendedEventName)):
279
+ if (i > 0):
280
+ command += ','
281
+ command += ExtendedEventName[i] + ',' + EventParameter1[i] + ',' + EventParameter2[i] + ',' + EventParameter3[i] + ',' + EventParameter4[i]
282
+ command += ')'
283
+
284
+ return self.Send(socketId, command)
285
+
286
+ # EventExtendedConfigurationTriggerGet : Read the event configuration
287
+ def EventExtendedConfigurationTriggerGet (self, socketId):
288
+ return self.Send(socketId, 'EventExtendedConfigurationTriggerGet(char *)')
289
+
290
+
291
+ # EventExtendedConfigurationActionSet : Configure one or several actions
292
+ def EventExtendedConfigurationActionSet (self, socketId, ExtendedActionName, ActionParameter1, ActionParameter2, ActionParameter3, ActionParameter4):
293
+ command = 'EventExtendedConfigurationActionSet('
294
+ for i in range(len(ExtendedActionName)):
295
+ if (i > 0):
296
+ command += ','
297
+ command += ExtendedActionName[i] + ',' + ActionParameter1[i] + ',' + ActionParameter2[i] + ',' + ActionParameter3[i] + ',' + ActionParameter4[i]
298
+ command += ')'
299
+
300
+ return self.Send(socketId, command)
301
+
302
+
303
+ # EventExtendedConfigurationActionGet : Read the action configuration
304
+ def EventExtendedConfigurationActionGet (self, socketId):
305
+ return self.Send(socketId, 'EventExtendedConfigurationActionGet(char *)')
306
+
307
+ # EventExtendedStart : Launch the last event and action configuration and return an ID
308
+ def EventExtendedStart (self, socketId):
309
+ command = 'EventExtendedStart(int *)'
310
+ error, returnedString = self.Send(socketId, command)
311
+ if (error != 0):
312
+ return [error, returnedString]
313
+
314
+ i, j, retList = 0, 0, [error]
315
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
316
+ j += 1
317
+ retList.append(eval(returnedString[i:i+j]))
318
+ return retList
319
+
320
+ # EventExtendedAllGet : Read all event and action configurations
321
+ def EventExtendedAllGet (self, socketId):
322
+ return self.Send(socketId, 'EventExtendedAllGet(char *)')
323
+
324
+ # EventExtendedGet : Read the event and action configuration defined by ID
325
+ def EventExtendedGet (self, socketId, ID):
326
+ return self.Send(socketId, 'EventExtendedGet(' + str(ID) + ',char *,char *)')
327
+
328
+ # EventExtendedRemove : Remove the event and action configuration defined by ID
329
+ def EventExtendedRemove (self, socketId, ID):
330
+ return self.Send(socketId, 'EventExtendedRemove(' + str(ID) + ')')
331
+
332
+ # EventExtendedWait : Wait events from the last event configuration
333
+ def EventExtendedWait (self, socketId):
334
+ return self.Send(socketId, 'EventExtendedWait()')
335
+
336
+ # GatheringConfigurationGet : Read different mnemonique type
337
+ def GatheringConfigurationGet (self, socketId):
338
+ return self.Send(socketId, 'GatheringConfigurationGet(char *)')
339
+
340
+ # GatheringConfigurationSet : Configuration acquisition
341
+ def GatheringConfigurationSet (self, socketId, Type):
342
+ command = 'GatheringConfigurationSet('
343
+ for i in range(len(Type)):
344
+ if (i > 0):
345
+ command += ','
346
+ command += Type[i]
347
+ command += ')'
348
+ return self.Send(socketId, command)
349
+
350
+ # GatheringCurrentNumberGet : Maximum number of samples and current number during acquisition
351
+ def GatheringCurrentNumberGet (self, socketId):
352
+ command = 'GatheringCurrentNumberGet(int *,int *)'
353
+ error, returnedString = self.Send(socketId, command)
354
+ if (error != 0):
355
+ return [error, returnedString]
356
+
357
+ i, j, retList = 0, 0, [error]
358
+ for paramNb in range(2):
359
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
360
+ j += 1
361
+ retList.append(eval(returnedString[i:i+j]))
362
+ i, j = i+j+1, 0
363
+ return retList
364
+
365
+ # GatheringStopAndSave : Stop acquisition and save data
366
+ def GatheringStopAndSave (self, socketId):
367
+ return self.Send(socketId, 'GatheringStopAndSave()')
368
+
369
+
370
+ # GatheringDataAcquire : Acquire a configured data
371
+ def GatheringDataAcquire (self, socketId):
372
+ return self.Send(socketId, 'GatheringDataAcquire()')
373
+
374
+ # GatheringDataGet : Get a data line from gathering buffer
375
+ def GatheringDataGet (self, socketId, IndexPoint):
376
+ return self.Send(socketId, 'GatheringDataGet(%s, char *)' % str(IndexPoint))
377
+
378
+ # GatheringDataMultipleLinesGet : Get multiple data lines from gathering buffer
379
+ def GatheringDataMultipleLinesGet (self, socketId, IndexPoint, NumberOfLines):
380
+ command = 'GatheringDataMultipleLinesGet(' + str(IndexPoint) + ',' + str(NumberOfLines) + ',char *)'
381
+ return self.Send(socketId, command)
382
+
383
+ # GatheringReset : Empty the gathered data in memory to start new gathering from scratch
384
+ def GatheringReset(self, socketId):
385
+ return self.Send(socketId, 'GatheringReset()')
386
+
387
+ # GatheringRun : Start a new gathering
388
+ def GatheringRun (self, socketId, DataNumber, Divisor):
389
+ command = 'GatheringRun(' + str(DataNumber) + ',' + str(Divisor) + ')'
390
+ return self.Send(socketId, command)
391
+
392
+
393
+ # GatheringRunAppend : Re-start the stopped gathering to add new data
394
+ def GatheringRunAppend (self, socketId):
395
+ return self.Send(socketId, 'GatheringRunAppend()')
396
+
397
+ # GatheringStop : Stop the data gathering (without saving to file)
398
+ def GatheringStop (self, socketId):
399
+ return self.Send(socketId, 'GatheringStop()')
400
+
401
+ # GatheringExternalConfigurationSet : Configuration acquisition
402
+ def GatheringExternalConfigurationSet (self, socketId, Type):
403
+ command = 'GatheringExternalConfigurationSet('
404
+ for i in range(len(Type)):
405
+ if (i > 0):
406
+ command += ','
407
+ command += Type[i]
408
+ command += ')'
409
+
410
+ return self.Send(socketId, command)
411
+
412
+ # GatheringExternalConfigurationGet : Read different mnemonique type
413
+ def GatheringExternalConfigurationGet (self, socketId):
414
+ return self.Send(socketId, 'GatheringExternalConfigurationGet(char *)')
415
+
416
+ # GatheringExternalCurrentNumberGet : Maximum number of samples and current number during acquisition
417
+ def GatheringExternalCurrentNumberGet (self, socketId):
418
+ command = 'GatheringExternalCurrentNumberGet(int *,int *)'
419
+ error, returnedString = self.Send(socketId, command)
420
+ if (error != 0):
421
+ return [error, returnedString]
422
+
423
+ i, j, retList = 0, 0, [error]
424
+ for paramNb in range(2):
425
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
426
+ j += 1
427
+ retList.append(eval(returnedString[i:i+j]))
428
+ i, j = i+j+1, 0
429
+ return retList
430
+
431
+
432
+ # GatheringExternalDataGet : Get a data line from external gathering buffer
433
+ def GatheringExternalDataGet (self, socketId, IndexPoint):
434
+ return self.Send(socketId, 'GatheringExternalDataGet(%s, char *)' % str(IndexPoint))
435
+
436
+ # GatheringExternalStopAndSave : Stop acquisition and save data
437
+ def GatheringExternalStopAndSave (self, socketId):
438
+ return self.Send(socketId, 'GatheringExternalStopAndSave()')
439
+
440
+ # GlobalArrayGet : Get global array value
441
+ def GlobalArrayGet (self, socketId, Number):
442
+ return self.Send(socketId, 'GlobalArrayGet(%s, char *)' % str(Number))
443
+
444
+ # GlobalArraySet : Set global array value
445
+ def GlobalArraySet (self, socketId, Number, ValueString):
446
+ command = 'GlobalArraySet(' + str(Number) + ',' + ValueString + ')'
447
+ return self.Send(socketId, command)
448
+
449
+ # DoubleGlobalArrayGet : Get double global array value
450
+ def DoubleGlobalArrayGet (self, socketId, Number):
451
+ command = 'DoubleGlobalArrayGet(' + str(Number) + ',double *)'
452
+ error, returnedString = self.Send(socketId, command)
453
+ if (error != 0):
454
+ return [error, returnedString]
455
+
456
+ i, j, retList = 0, 0, [error]
457
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
458
+ j += 1
459
+ retList.append(eval(returnedString[i:i+j]))
460
+ return retList
461
+
462
+ # DoubleGlobalArraySet : Set double global array value
463
+ def DoubleGlobalArraySet (self, socketId, Number, DoubleValue):
464
+ command = 'DoubleGlobalArraySet(' + str(Number) + ',' + str(DoubleValue) + ')'
465
+ return self.Send(socketId, command)
466
+
467
+ # GPIOAnalogGet : Read analog input or analog output for one or few input
468
+ def GPIOAnalogGet (self, socketId, GPIOName):
469
+ command = 'GPIOAnalogGet('
470
+ for i in range(len(GPIOName)):
471
+ if (i > 0):
472
+ command += ','
473
+ command += GPIOName[i] + ',' + 'double *'
474
+ command += ')'
475
+
476
+ error, returnedString = self.Send(socketId, command)
477
+ if (error != 0):
478
+ return [error, returnedString]
479
+
480
+ i, j, retList = 0, 0, [error]
481
+ for paramNb in range(len(GPIOName)):
482
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
483
+ j += 1
484
+ retList.append(eval(returnedString[i:i+j]))
485
+ i, j = i+j+1, 0
486
+ return retList
487
+
488
+
489
+ # GPIOAnalogSet : Set analog output for one or few output
490
+ def GPIOAnalogSet (self, socketId, GPIOName, AnalogOutputValue):
491
+ command = 'GPIOAnalogSet('
492
+ for i in range(len(GPIOName)):
493
+ if (i > 0):
494
+ command += ','
495
+ command += GPIOName[i] + ',' + str(AnalogOutputValue[i])
496
+ command += ')'
497
+ return self.Send(socketId, command)
498
+
499
+
500
+ # GPIOAnalogGainGet : Read analog input gain (1, 2, 4 or 8) for one or few input
501
+ def GPIOAnalogGainGet (self, socketId, GPIOName):
502
+ command = 'GPIOAnalogGainGet('
503
+ for i in range(len(GPIOName)):
504
+ if (i > 0):
505
+ command += ','
506
+ command += GPIOName[i] + ',' + 'int *'
507
+ command += ')'
508
+
509
+ error, returnedString = self.Send(socketId, command)
510
+ if (error != 0):
511
+ return [error, returnedString]
512
+
513
+ i, j, retList = 0, 0, [error]
514
+ for paramNb in range(len(GPIOName)):
515
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
516
+ j += 1
517
+ retList.append(eval(returnedString[i:i+j]))
518
+ i, j = i+j+1, 0
519
+ return retList
520
+
521
+
522
+ # GPIOAnalogGainSet : Set analog input gain (1, 2, 4 or 8) for one or few input
523
+ def GPIOAnalogGainSet (self, socketId, GPIOName, AnalogInputGainValue):
524
+ command = 'GPIOAnalogGainSet('
525
+ for i in range(len(GPIOName)):
526
+ if (i > 0):
527
+ command += ','
528
+ command += GPIOName[i] + ',' + str(AnalogInputGainValue[i])
529
+ command += ')'
530
+
531
+ return self.Send(socketId, command)
532
+
533
+ # GPIODigitalGet : Read digital output or digital input
534
+ def GPIODigitalGet (self, socketId, GPIOName):
535
+
536
+ command = 'GPIODigitalGet(' + GPIOName + ',unsigned short *)'
537
+ error, returnedString = self.Send(socketId, command)
538
+ if (error != 0):
539
+ return [error, returnedString]
540
+
541
+ i, j, retList = 0, 0, [error]
542
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
543
+ j += 1
544
+ retList.append(eval(returnedString[i:i+j]))
545
+ return retList
546
+
547
+
548
+ # GPIODigitalSet : Set Digital Output for one or few output TTL
549
+ def GPIODigitalSet (self, socketId, GPIOName, Mask, DigitalOutputValue):
550
+ command = 'GPIODigitalSet(' + GPIOName + ',' + str(Mask) + ',' + str(DigitalOutputValue) + ')'
551
+ return self.Send(socketId, command)
552
+
553
+ # GroupAccelerationSetpointGet : Return setpoint accelerations
554
+ def GroupAccelerationSetpointGet (self, socketId, GroupName, nbElement):
555
+ command = 'GroupAccelerationSetpointGet(' + GroupName + ','
556
+ for i in range(nbElement):
557
+ if (i > 0):
558
+ command += ','
559
+ command += 'double *'
560
+ command += ')'
561
+
562
+ error, returnedString = self.Send(socketId, command)
563
+ if (error != 0):
564
+ return [error, returnedString]
565
+
566
+ i, j, retList = 0, 0, [error]
567
+ for paramNb in range(nbElement):
568
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
569
+ j += 1
570
+ retList.append(eval(returnedString[i:i+j]))
571
+ i, j = i+j+1, 0
572
+ return retList
573
+
574
+ # GroupAnalogTrackingModeEnable : Enable Analog Tracking mode on selected group
575
+ def GroupAnalogTrackingModeEnable (self, socketId, GroupName, Type):
576
+ command = 'GroupAnalogTrackingModeEnable(' + GroupName + ',' + Type + ')'
577
+ return self.Send(socketId, command)
578
+
579
+ # GroupAnalogTrackingModeDisable : Disable Analog Tracking mode on selected group
580
+ def GroupAnalogTrackingModeDisable (self, socketId, GroupName):
581
+ command = 'GroupAnalogTrackingModeDisable(' + GroupName + ')'
582
+ return self.Send(socketId, command)
583
+
584
+ # GroupCorrectorOutputGet : Return corrector outputs
585
+ def GroupCorrectorOutputGet (self, socketId, GroupName, nbElement):
586
+ command = 'GroupCorrectorOutputGet(' + GroupName + ','
587
+ for i in range(nbElement):
588
+ if (i > 0):
589
+ command += ','
590
+ command += 'double *'
591
+ command += ')'
592
+ error, returnedString = self.Send(socketId, command)
593
+ if (error != 0):
594
+ return [error, returnedString]
595
+
596
+ i, j, retList = 0, 0, [error]
597
+ for paramNb in range(nbElement):
598
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
599
+ j += 1
600
+ retList.append(eval(returnedString[i:i+j]))
601
+ i, j = i+j+1, 0
602
+ return retList
603
+
604
+
605
+ # GroupCurrentFollowingErrorGet : Return current following errors
606
+ def GroupCurrentFollowingErrorGet (self, socketId, GroupName, nbElement):
607
+ command = 'GroupCurrentFollowingErrorGet(' + GroupName + ','
608
+ for i in range(nbElement):
609
+ if (i > 0):
610
+ command += ','
611
+ command += 'double *'
612
+ command += ')'
613
+
614
+ error, returnedString = self.Send(socketId, command)
615
+ if (error != 0):
616
+ return [error, returnedString]
617
+
618
+ i, j, retList = 0, 0, [error]
619
+ for paramNb in range(nbElement):
620
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
621
+ j += 1
622
+ retList.append(eval(returnedString[i:i+j]))
623
+ i, j = i+j+1, 0
624
+ return retList
625
+
626
+
627
+ # GroupHomeSearch : Start home search sequence
628
+ def GroupHomeSearch (self, socketId, GroupName):
629
+ return self.Send(socketId, 'GroupHomeSearch(%s)' % GroupName )
630
+
631
+ # GroupHomeSearchAndRelativeMove : Start home search sequence and execute a displacement
632
+ def GroupHomeSearchAndRelativeMove (self, socketId, GroupName, TargetDisplacement):
633
+ command = 'GroupHomeSearchAndRelativeMove(' + GroupName + ','
634
+ for i in range(len(TargetDisplacement)):
635
+ if (i > 0):
636
+ command += ','
637
+ command += str(TargetDisplacement[i])
638
+ command += ')'
639
+ return self.Send(socketId, command)
640
+
641
+ # GroupInitialize : Start the initialization
642
+ def GroupInitialize (self, socketId, GroupName):
643
+ return self.Send(socketId, 'GroupInitialize(%s)' % GroupName)
644
+
645
+ # GroupInitializeWithEncoderCalibration : Start the initialization with encoder calibration
646
+ def GroupInitializeWithEncoderCalibration (self, socketId, GroupName):
647
+ return self.Send(socketId, 'GroupInitializeWithEncoderCalibration(%s)' % GroupName )
648
+
649
+ # GroupJogParametersSet : Modify Jog parameters on selected group and activate the continuous move
650
+ def GroupJogParametersSet (self, socketId, GroupName, Velocity, Acceleration):
651
+ command = 'GroupJogParametersSet(' + GroupName + ','
652
+ for i in range(len(Velocity)):
653
+ if (i > 0):
654
+ command += ','
655
+ command += str(Velocity[i]) + ',' + str(Acceleration[i])
656
+ command += ')'
657
+ return self.Send(socketId, command)
658
+
659
+ # GroupJogParametersGet : Get Jog parameters on selected group
660
+ def GroupJogParametersGet (self, socketId, GroupName, nbElement):
661
+ command = 'GroupJogParametersGet(' + GroupName + ','
662
+ for i in range(nbElement):
663
+ if (i > 0):
664
+ command += ','
665
+ command += 'double *' + ',' + 'double *'
666
+ command += ')'
667
+
668
+ error, returnedString = self.Send(socketId, command)
669
+ if (error != 0):
670
+ return [error, returnedString]
671
+
672
+ i, j, retList = 0, 0, [error]
673
+ for paramNb in range(nbElement*2):
674
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
675
+ j += 1
676
+ retList.append(eval(returnedString[i:i+j]))
677
+ i, j = i+j+1, 0
678
+ return retList
679
+
680
+ # GroupJogCurrentGet : Get Jog current on selected group
681
+ def GroupJogCurrentGet (self, socketId, GroupName, nbElement):
682
+ command = 'GroupJogCurrentGet(' + GroupName + ','
683
+ for i in range(nbElement):
684
+ if (i > 0):
685
+ command += ','
686
+ command += 'double *' + ',' + 'double *'
687
+ command += ')'
688
+
689
+ error, returnedString = self.Send(socketId, command)
690
+ if (error != 0):
691
+ return [error, returnedString]
692
+
693
+ i, j, retList = 0, 0, [error]
694
+ for paramNb in range(nbElement*2):
695
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
696
+ j += 1
697
+ retList.append(eval(returnedString[i:i+j]))
698
+ i, j = i+j+1, 0
699
+
700
+ return retList
701
+
702
+
703
+ # GroupJogModeEnable : Enable Jog mode on selected group
704
+ def GroupJogModeEnable (self, socketId, GroupName):
705
+ return self.Send(socketId, 'GroupJogModeEnable(%s)' % GroupName)
706
+
707
+
708
+ # GroupJogModeDisable : Disable Jog mode on selected group
709
+ def GroupJogModeDisable (self, socketId, GroupName):
710
+ return self.Send(socketId, 'GroupJogModeDisable(%s)' % GroupName)
711
+
712
+ # GroupKill : Kill the group
713
+ def GroupKill (self, socketId, GroupName):
714
+ return self.Send(socketId, 'GroupKill(%s)' % GroupName )
715
+
716
+ # GroupMoveAbort : Abort a move
717
+ def GroupMoveAbort (self, socketId, GroupName):
718
+ return self.Send(socketId, 'GroupMoveAbort(%s)' % GroupName )
719
+
720
+ # GroupMoveAbsolute : Do an absolute move
721
+ def GroupMoveAbsolute (self, socketId, GroupName, TargetPosition):
722
+ command = 'GroupMoveAbsolute(' + GroupName + ','
723
+ for i in range(len(TargetPosition)):
724
+ if (i > 0):
725
+ command += ','
726
+ command += str(TargetPosition[i])
727
+ command += ')'
728
+ return self.Send(socketId, command)
729
+
730
+ # GroupMoveRelative : Do a relative move
731
+ def GroupMoveRelative (self, socketId, GroupName, TargetDisplacement):
732
+ command = 'GroupMoveRelative(' + GroupName + ','
733
+ for i in range(len(TargetDisplacement)):
734
+ if (i > 0):
735
+ command += ','
736
+ command += str(TargetDisplacement[i])
737
+ command += ')'
738
+ return self.Send(socketId, command)
739
+
740
+ # GroupMotionDisable : Set Motion disable on selected group
741
+ def GroupMotionDisable (self, socketId, GroupName):
742
+ return self.Send(socketId, 'GroupMotionDisable(%s)' % GroupName )
743
+
744
+ # GroupMotionEnable : Set Motion enable on selected group
745
+ def GroupMotionEnable (self, socketId, GroupName):
746
+ return self.Send(socketId, 'GroupMotionEnable(%s)' % GroupName)
747
+
748
+
749
+ # GroupPositionCorrectedProfilerGet : Return corrected profiler positions
750
+ def GroupPositionCorrectedProfilerGet (self, socketId, GroupName, PositionX, PositionY):
751
+ command = 'GroupPositionCorrectedProfilerGet(' + GroupName + ',' + str(PositionX) + ',' + str(PositionY) + ',double *,double *)'
752
+ error, returnedString = self.Send(socketId, command)
753
+ if (error != 0):
754
+ return [error, returnedString]
755
+
756
+ i, j, retList = 0, 0, [error]
757
+ for paramNb in range(2):
758
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
759
+ j += 1
760
+ retList.append(eval(returnedString[i:i+j]))
761
+ i, j = i+j+1, 0
762
+ return retList
763
+
764
+
765
+ # GroupPositionCurrentGet : Return current positions
766
+ def GroupPositionCurrentGet (self, socketId, GroupName, nbElement):
767
+ command = 'GroupPositionCurrentGet(' + GroupName + ','
768
+ for i in range(nbElement):
769
+ if (i > 0):
770
+ command += ','
771
+ command += 'double *'
772
+ command += ')'
773
+
774
+ error, returnedString = self.Send(socketId, command)
775
+ if (error != 0):
776
+ return [error, returnedString]
777
+
778
+ i, j, retList = 0, 0, [error]
779
+ for paramNb in range(nbElement):
780
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
781
+ j += 1
782
+ retList.append(eval(returnedString[i:i+j]))
783
+ i, j = i+j+1, 0
784
+ return retList
785
+
786
+ # GroupPositionPCORawEncoderGet : Return PCO raw encoder positions
787
+ def GroupPositionPCORawEncoderGet (self, socketId, GroupName, PositionX, PositionY):
788
+ command = 'GroupPositionPCORawEncoderGet(' + GroupName + ',' + str(PositionX) + ',' + str(PositionY) + ',double *,double *)'
789
+ error, returnedString = self.Send(socketId, command)
790
+ if (error != 0):
791
+ return [error, returnedString]
792
+
793
+ i, j, retList = 0, 0, [error]
794
+ for paramNb in range(2):
795
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
796
+ j += 1
797
+ retList.append(eval(returnedString[i:i+j]))
798
+ i, j = i+j+1, 0
799
+ return retList
800
+
801
+ # GroupPositionSetpointGet : Return setpoint positions
802
+ def GroupPositionSetpointGet (self, socketId, GroupName, nbElement):
803
+ command = 'GroupPositionSetpointGet(' + GroupName + ','
804
+ for i in range(nbElement):
805
+ if (i > 0):
806
+ command += ','
807
+ command += 'double *'
808
+ command += ')'
809
+
810
+ error, returnedString = self.Send(socketId, command)
811
+ if (error != 0):
812
+ return [error, returnedString]
813
+
814
+ i, j, retList = 0, 0, [error]
815
+ for paramNb in range(nbElement):
816
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
817
+ j += 1
818
+ retList.append(eval(returnedString[i:i+j]))
819
+ i, j = i+j+1, 0
820
+ return retList
821
+
822
+
823
+ # GroupPositionTargetGet : Return target positions
824
+ def GroupPositionTargetGet (self, socketId, GroupName, nbElement):
825
+ command = 'GroupPositionTargetGet(' + GroupName + ','
826
+ for i in range(nbElement):
827
+ if (i > 0):
828
+ command += ','
829
+ command += 'double *'
830
+ command += ')'
831
+
832
+ error, returnedString = self.Send(socketId, command)
833
+ if (error != 0):
834
+ return [error, returnedString]
835
+
836
+ i, j, retList = 0, 0, [error]
837
+ for paramNb in range(nbElement):
838
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
839
+ j += 1
840
+ retList.append(eval(returnedString[i:i+j]))
841
+ i, j = i+j+1, 0
842
+ return retList
843
+
844
+
845
+ # GroupReferencingActionExecute : Execute an action in referencing mode
846
+ def GroupReferencingActionExecute (self, socketId, PositionerName, ReferencingAction, ReferencingSensor, ReferencingParameter):
847
+ command = 'GroupReferencingActionExecute(' + PositionerName + ',' + ReferencingAction + ',' + ReferencingSensor + ',' + str(ReferencingParameter) + ')'
848
+ return self.Send(socketId, command)
849
+
850
+ # GroupReferencingStart : Enter referencing mode
851
+ def GroupReferencingStart (self, socketId, GroupName):
852
+ return self.Send(socketId, 'GroupReferencingStart(%s)' % GroupName)
853
+
854
+ # GroupReferencingStop : Exit referencing mode
855
+ def GroupReferencingStop (self, socketId, GroupName):
856
+ return self.Send(socketId, 'GroupReferencingStop(%s)' % GroupName)
857
+
858
+ # GroupStatusGet : Return group status
859
+ def GroupStatusGet (self, socketId, GroupName):
860
+ command = 'GroupStatusGet(' + GroupName + ',int *)'
861
+ error, returnedString = self.Send(socketId, command)
862
+ if (error != 0):
863
+ return [error, returnedString]
864
+
865
+ i, j, retList = 0, 0, [error]
866
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
867
+ j += 1
868
+ retList.append(eval(returnedString[i:i+j]))
869
+ return retList
870
+
871
+
872
+ # GroupStatusStringGet : Return the group status string corresponding to the group status code
873
+ def GroupStatusStringGet (self, socketId, GroupStatusCode):
874
+ return self.Send(socketId, 'GroupStatusStringGet(%s, char*)' % str(GroupStatusCode))
875
+
876
+ # GroupVelocityCurrentGet : Return current velocities
877
+ def GroupVelocityCurrentGet (self, socketId, GroupName, nbElement):
878
+ command = 'GroupVelocityCurrentGet(' + GroupName + ','
879
+ for i in range(nbElement):
880
+ if (i > 0):
881
+ command += ','
882
+ command += 'double *'
883
+ command += ')'
884
+
885
+ error, returnedString = self.Send(socketId, command)
886
+ if (error != 0):
887
+ return [error, returnedString]
888
+
889
+ i, j, retList = 0, 0, [error]
890
+ for paramNb in range(nbElement):
891
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
892
+ j += 1
893
+ retList.append(eval(returnedString[i:i+j]))
894
+ i, j = i+j+1, 0
895
+ return retList
896
+
897
+
898
+ # KillAll : Put all groups in 'Not initialized' state
899
+ def KillAll (self, socketId):
900
+ return self.Send(socketId, 'KillAll()')
901
+
902
+ # PositionerAnalogTrackingPositionParametersGet : Read dynamic parameters for one axe of a group for a future analog tracking position
903
+ def PositionerAnalogTrackingPositionParametersGet (self, socketId, PositionerName):
904
+ command = 'PositionerAnalogTrackingPositionParametersGet(' + PositionerName + ',char *,double *,double *,double *,double *)'
905
+ error, returnedString = self.Send(socketId, command)
906
+ if (error != 0):
907
+ return [error, returnedString]
908
+
909
+ i, j, retList = 0, 0, [error]
910
+ for paramNb in range(4):
911
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
912
+ j += 1
913
+ retList.append(eval(returnedString[i:i+j]))
914
+ i, j = i+j+1, 0
915
+ return retList
916
+
917
+ # PositionerAnalogTrackingPositionParametersSet : Update dynamic parameters for one axe of a group for a future analog tracking position
918
+ def PositionerAnalogTrackingPositionParametersSet (self, socketId, PositionerName, GPIOName, Offset, Scale, Velocity, Acceleration):
919
+ command = 'PositionerAnalogTrackingPositionParametersSet(' + PositionerName + ',' + GPIOName + ',' + str(Offset) + ',' + str(Scale) + ',' + str(Velocity) + ',' + str(Acceleration) + ')'
920
+ return self.Send(socketId, command)
921
+
922
+ # PositionerAnalogTrackingVelocityParametersGet : Read dynamic parameters for one axe of a group for a future analog tracking velocity
923
+ def PositionerAnalogTrackingVelocityParametersGet (self, socketId, PositionerName):
924
+ command = 'PositionerAnalogTrackingVelocityParametersGet(' + PositionerName + ',char *,double *,double *,double *,int *,double *,double *)'
925
+ error, returnedString = self.Send(socketId, command)
926
+ if (error != 0):
927
+ return [error, returnedString]
928
+
929
+ i, j, retList = 0, 0, [error]
930
+ for paramNb in range(6):
931
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
932
+ j += 1
933
+ retList.append(eval(returnedString[i:i+j]))
934
+ i, j = i+j+1, 0
935
+ return retList
936
+
937
+ # PositionerAnalogTrackingVelocityParametersSet : Update dynamic parameters for one axe of a group for a future analog tracking velocity
938
+ def PositionerAnalogTrackingVelocityParametersSet (self, socketId, PositionerName, GPIOName, Offset, Scale, DeadBandThreshold, Order, Velocity, Acceleration):
939
+ command = 'PositionerAnalogTrackingVelocityParametersSet(' + PositionerName + ',' + GPIOName + ',' + str(Offset) + ',' + str(Scale) + ',' + str(DeadBandThreshold) + ',' + str(Order) + ',' + str(Velocity) + ',' + str(Acceleration) + ')'
940
+ return self.Send(socketId, command)
941
+
942
+ # PositionerBacklashGet : Read backlash value and status
943
+ def PositionerBacklashGet (self, socketId, PositionerName):
944
+ command = 'PositionerBacklashGet(' + PositionerName + ',double *,char *)'
945
+ error, returnedString = self.Send(socketId, command)
946
+ if (error != 0):
947
+ return [error, returnedString]
948
+
949
+ i, j, retList = 0, 0, [error]
950
+ for paramNb in range(2):
951
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
952
+ j += 1
953
+ retList.append(eval(returnedString[i:i+j]))
954
+ i, j = i+j+1, 0
955
+ return retList
956
+
957
+ # PositionerBacklashSet : Set backlash value
958
+ def PositionerBacklashSet (self, socketId, PositionerName, BacklashValue):
959
+ command = 'PositionerBacklashSet(' + PositionerName + ',' + str(BacklashValue) + ')'
960
+ return self.Send(socketId, command)
961
+
962
+ # PositionerBacklashEnable : Enable the backlash
963
+ def PositionerBacklashEnable (self, socketId, PositionerName):
964
+ return self.Send(socketId, 'PositionerBacklashEnable(%s)' % PositionerName)
965
+
966
+ # PositionerBacklashDisable : Disable the backlash
967
+ def PositionerBacklashDisable (self, socketId, PositionerName):
968
+ return self.Send(socketId, 'PositionerBacklashDisable(%s)' % PositionerName)
969
+
970
+ # PositionerCorrectorNotchFiltersSet : Update filters parameters
971
+ def PositionerCorrectorNotchFiltersSet (self, socketId, PositionerName, NotchFrequency1, NotchBandwith1, NotchGain1, NotchFrequency2, NotchBandwith2, NotchGain2):
972
+ command = 'PositionerCorrectorNotchFiltersSet(' + PositionerName + ',' + str(NotchFrequency1) + ',' + str(NotchBandwith1) + ',' + str(NotchGain1) + ',' + str(NotchFrequency2) + ',' + str(NotchBandwith2) + ',' + str(NotchGain2) + ')'
973
+ return self.Send(socketId, command)
974
+
975
+ # PositionerCorrectorNotchFiltersGet : Read filters parameters
976
+ def PositionerCorrectorNotchFiltersGet (self, socketId, PositionerName):
977
+ command = 'PositionerCorrectorNotchFiltersGet(' + PositionerName + ',double *,double *,double *,double *,double *,double *)'
978
+ error, returnedString = self.Send(socketId, command)
979
+ if (error != 0):
980
+ return [error, returnedString]
981
+
982
+ i, j, retList = 0, 0, [error]
983
+ for paramNb in range(6):
984
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
985
+ j += 1
986
+ retList.append(eval(returnedString[i:i+j]))
987
+ i, j = i+j+1, 0
988
+ return retList
989
+
990
+ # PositionerCorrectorPIDFFAccelerationSet : Update corrector parameters
991
+ def PositionerCorrectorPIDFFAccelerationSet (self, socketId, PositionerName, ClosedLoopStatus, KP, KI, KD, KS, IntegrationTime,
992
+ DerivativeFilterCutOffFrequency, GKP, GKI, GKD, KForm, FeedForwardGainAcceleration):
993
+ command = 'PositionerCorrectorPIDFFAccelerationSet(' + PositionerName + ',' + str(ClosedLoopStatus) + ',' + \
994
+ str(KP) + ',' + str(KI) + ',' + str(KD) + ',' + str(KS) + ',' + str(IntegrationTime) + ',' +\
995
+ str(DerivativeFilterCutOffFrequency) + ',' + str(GKP) + ',' + str(GKI) + ',' + str(GKD) + ',' + \
996
+ str(KForm) + ',' + str(FeedForwardGainAcceleration) + ')'
997
+ return self.Send(socketId, command)
998
+
999
+ # PositionerCorrectorPIDFFAccelerationGet : Read corrector parameters
1000
+ def PositionerCorrectorPIDFFAccelerationGet (self, socketId, PositionerName):
1001
+ command = 'PositionerCorrectorPIDFFAccelerationGet(' + PositionerName + ',bool *,double *,double *,double *,double *,double *,double *,double *,double *,double *,double *,double *)'
1002
+ error, returnedString = self.Send(socketId, command)
1003
+ if (error != 0):
1004
+ return [error, returnedString]
1005
+
1006
+ i, j, retList = 0, 0, [error]
1007
+ for paramNb in range(12):
1008
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1009
+ j += 1
1010
+ retList.append(eval(returnedString[i:i+j]))
1011
+ i, j = i+j+1, 0
1012
+ return retList
1013
+
1014
+
1015
+ # PositionerCorrectorPIDFFVelocitySet : Update corrector parameters
1016
+ def PositionerCorrectorPIDFFVelocitySet (self, socketId, PositionerName, ClosedLoopStatus, KP, KI, KD, KS, IntegrationTime, DerivativeFilterCutOffFrequency, GKP, GKI, GKD, KForm, FeedForwardGainVelocity):
1017
+
1018
+ command = 'PositionerCorrectorPIDFFVelocitySet(' + PositionerName + ',' + str(ClosedLoopStatus) + ',' + str(KP) + ',' + str(KI) + ',' + str(KD) + ',' + str(KS) + ',' + str(IntegrationTime) + ',' + str(DerivativeFilterCutOffFrequency) + ',' + str(GKP) + ',' + str(GKI) + ',' + str(GKD) + ',' + str(KForm) + ',' + str(FeedForwardGainVelocity) + ')'
1019
+ return self.Send(socketId, command)
1020
+
1021
+
1022
+ # PositionerCorrectorPIDFFVelocityGet : Read corrector parameters
1023
+ def PositionerCorrectorPIDFFVelocityGet (self, socketId, PositionerName):
1024
+ command = 'PositionerCorrectorPIDFFVelocityGet(' + PositionerName + ',bool *,double *,double *,double *,double *,double *,double *,double *,double *,double *,double *,double *)'
1025
+ error, returnedString = self.Send(socketId, command)
1026
+ if (error != 0):
1027
+ return [error, returnedString]
1028
+
1029
+ i, j, retList = 0, 0, [error]
1030
+ for paramNb in range(12):
1031
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1032
+ j += 1
1033
+ retList.append(eval(returnedString[i:i+j]))
1034
+ i, j = i+j+1, 0
1035
+ return retList
1036
+
1037
+ # PositionerCorrectorPIDDualFFVoltageSet : Update corrector parameters
1038
+ def PositionerCorrectorPIDDualFFVoltageSet (self, socketId, PositionerName, ClosedLoopStatus, KP, KI, KD, KS, IntegrationTime, DerivativeFilterCutOffFrequency, GKP, GKI, GKD, KForm, FeedForwardGainVelocity, FeedForwardGainAcceleration, Friction):
1039
+
1040
+ command = 'PositionerCorrectorPIDDualFFVoltageSet(' + PositionerName + ',' + str(ClosedLoopStatus) + ',' + str(KP) + ',' + str(KI) + ',' + str(KD) + ',' + str(KS) + ',' + str(IntegrationTime) + ',' + str(DerivativeFilterCutOffFrequency) + ',' + str(GKP) + ',' + str(GKI) + ',' + str(GKD) + ',' + str(KForm) + ',' + str(FeedForwardGainVelocity) + ',' + str(FeedForwardGainAcceleration) + ',' + str(Friction) + ')'
1041
+ return self.Send(socketId, command)
1042
+
1043
+
1044
+ # PositionerCorrectorPIDDualFFVoltageGet : Read corrector parameters
1045
+ def PositionerCorrectorPIDDualFFVoltageGet (self, socketId, PositionerName):
1046
+ command = 'PositionerCorrectorPIDDualFFVoltageGet(' + PositionerName + ',bool *,double *,double *,double *,double *,double *,double *,double *,double *,double *,double *,double *,double *,double *)'
1047
+ error, returnedString = self.Send(socketId, command)
1048
+ if (error != 0):
1049
+ return [error, returnedString]
1050
+
1051
+ i, j, retList = 0, 0, [error]
1052
+ for paramNb in range(14):
1053
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1054
+ j += 1
1055
+ retList.append(eval(returnedString[i:i+j]))
1056
+ i, j = i+j+1, 0
1057
+ return retList
1058
+
1059
+ # PositionerCorrectorPIPositionSet : Update corrector parameters
1060
+ def PositionerCorrectorPIPositionSet (self, socketId, PositionerName, ClosedLoopStatus, KP, KI, IntegrationTime):
1061
+ command = 'PositionerCorrectorPIPositionSet(' + PositionerName + ',' + str(ClosedLoopStatus) + ',' + str(KP) + ',' + str(KI) + ',' + str(IntegrationTime) + ')'
1062
+ return self.Send(socketId, command)
1063
+
1064
+ # PositionerCorrectorPIPositionGet : Read corrector parameters
1065
+ def PositionerCorrectorPIPositionGet (self, socketId, PositionerName):
1066
+ command = 'PositionerCorrectorPIPositionGet(' + PositionerName + ',bool *,double *,double *,double *)'
1067
+ error, returnedString = self.Send(socketId, command)
1068
+ if (error != 0):
1069
+ return [error, returnedString]
1070
+
1071
+ i, j, retList = 0, 0, [error]
1072
+ for paramNb in range(4):
1073
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1074
+ j += 1
1075
+ retList.append(eval(returnedString[i:i+j]))
1076
+ i, j = i+j+1, 0
1077
+ return retList
1078
+
1079
+ # PositionerCorrectorTypeGet : Read corrector type
1080
+ def PositionerCorrectorTypeGet (self, socketId, PositionerName):
1081
+ return self.Send(socketId, 'PositionerCorrectorTypeGet(%s, char *)' % PositionerName)
1082
+
1083
+ # PositionerCurrentVelocityAccelerationFiltersGet : Get current velocity and acceleration cutoff frequencies
1084
+ def PositionerCurrentVelocityAccelerationFiltersGet (self, socketId, PositionerName):
1085
+ command = 'PositionerCurrentVelocityAccelerationFiltersGet(' + PositionerName + ',double *,double *)'
1086
+ error, returnedString = self.Send(socketId, command)
1087
+ if (error != 0):
1088
+ return [error, returnedString]
1089
+
1090
+ i, j, retList = 0, 0, [error]
1091
+ for paramNb in range(2):
1092
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1093
+ j += 1
1094
+ retList.append(eval(returnedString[i:i+j]))
1095
+ i, j = i+j+1, 0
1096
+ return retList
1097
+
1098
+ # PositionerCurrentVelocityAccelerationFiltersSet : Set current velocity and acceleration cutoff frequencies
1099
+ def PositionerCurrentVelocityAccelerationFiltersSet (self, socketId, PositionerName, CurrentVelocityCutOffFrequency, CurrentAccelerationCutOffFrequency):
1100
+ command = 'PositionerCurrentVelocityAccelerationFiltersSet(' + PositionerName + ',' + str(CurrentVelocityCutOffFrequency) + ',' + str(CurrentAccelerationCutOffFrequency) + ')'
1101
+ return self.Send(socketId, command)
1102
+
1103
+ # PositionerDriverFiltersGet : Get driver filters parameters
1104
+ def PositionerDriverFiltersGet (self, socketId, PositionerName):
1105
+ command = 'PositionerDriverFiltersGet(' + PositionerName + ',double *,double *,double *,double *,double *)'
1106
+ error, returnedString = self.Send(socketId, command)
1107
+ if (error != 0):
1108
+ return [error, returnedString]
1109
+
1110
+ i, j, retList = 0, 0, [error]
1111
+ for paramNb in range(5):
1112
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1113
+ j += 1
1114
+ retList.append(eval(returnedString[i:i+j]))
1115
+ i, j = i+j+1, 0
1116
+ return retList
1117
+
1118
+ # PositionerDriverFiltersSet : Set driver filters parameters
1119
+ def PositionerDriverFiltersSet (self, socketId, PositionerName, KI, NotchFrequency, NotchBandwidth, NotchGain, LowpassFrequency):
1120
+ command = 'PositionerDriverFiltersSet(' + PositionerName + ',' + str(KI) + ',' + str(NotchFrequency) + ',' + str(NotchBandwidth) + ',' + str(NotchGain) + ',' + str(LowpassFrequency) + ')'
1121
+ return self.Send(socketId, command)
1122
+
1123
+ # PositionerDriverPositionOffsetsGet : Get driver stage and gage position offset
1124
+ def PositionerDriverPositionOffsetsGet (self, socketId, PositionerName):
1125
+ command = 'PositionerDriverPositionOffsetsGet(' + PositionerName + ',double *,double *)'
1126
+ error, returnedString = self.Send(socketId, command)
1127
+ if (error != 0):
1128
+ return [error, returnedString]
1129
+
1130
+ i, j, retList = 0, 0, [error]
1131
+ for paramNb in range(2):
1132
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1133
+ j += 1
1134
+ retList.append(eval(returnedString[i:i+j]))
1135
+ i, j = i+j+1, 0
1136
+ return retList
1137
+
1138
+ # PositionerDriverStatusGet : Read positioner driver status
1139
+ def PositionerDriverStatusGet (self, socketId, PositionerName):
1140
+ command = 'PositionerDriverStatusGet(' + PositionerName + ',int *)'
1141
+ error, returnedString = self.Send(socketId, command)
1142
+ if (error != 0):
1143
+ return [error, returnedString]
1144
+
1145
+ i, j, retList = 0, 0, [error]
1146
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1147
+ j += 1
1148
+ retList.append(eval(returnedString[i:i+j]))
1149
+ return retList
1150
+
1151
+
1152
+ # PositionerDriverStatusStringGet : Return the positioner driver status string corresponding to the positioner error code
1153
+ def PositionerDriverStatusStringGet (self, socketId, PositionerDriverStatus):
1154
+ command = 'PositionerDriverStatusStringGet(' + str(PositionerDriverStatus) + ',char *)'
1155
+ return self.Send(socketId, command)
1156
+
1157
+ # PositionerEncoderAmplitudeValuesGet : Read analog interpolated encoder amplitude values
1158
+ def PositionerEncoderAmplitudeValuesGet (self, socketId, PositionerName):
1159
+ command = 'PositionerEncoderAmplitudeValuesGet(' + PositionerName + ',double *,double *,double *,double *)'
1160
+ error, returnedString = self.Send(socketId, command)
1161
+ if (error != 0):
1162
+ return [error, returnedString]
1163
+
1164
+ i, j, retList = 0, 0, [error]
1165
+ for paramNb in range(4):
1166
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1167
+ j += 1
1168
+ retList.append(eval(returnedString[i:i+j]))
1169
+ i, j = i+j+1, 0
1170
+ return retList
1171
+
1172
+ # PositionerEncoderCalibrationParametersGet : Read analog interpolated encoder calibration parameters
1173
+ def PositionerEncoderCalibrationParametersGet (self, socketId, PositionerName):
1174
+ command = 'PositionerEncoderCalibrationParametersGet(' + PositionerName + ',double *,double *,double *,double *)'
1175
+ error, returnedString = self.Send(socketId, command)
1176
+ if (error != 0):
1177
+ return [error, returnedString]
1178
+
1179
+ i, j, retList = 0, 0, [error]
1180
+ for paramNb in range(4):
1181
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1182
+ j += 1
1183
+ retList.append(eval(returnedString[i:i+j]))
1184
+ i, j = i+j+1, 0
1185
+ return retList
1186
+
1187
+ # PositionerErrorGet : Read and clear positioner error code
1188
+ def PositionerErrorGet (self, socketId, PositionerName):
1189
+ command = 'PositionerErrorGet(' + PositionerName + ',int *)'
1190
+ error, returnedString = self.Send(socketId, command)
1191
+ if (error != 0):
1192
+ return [error, returnedString]
1193
+
1194
+ i, j, retList = 0, 0, [error]
1195
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1196
+ j += 1
1197
+ retList.append(eval(returnedString[i:i+j]))
1198
+ return retList
1199
+
1200
+ # PositionerErrorRead : Read only positioner error code without clear it
1201
+ def PositionerErrorRead (self, socketId, PositionerName):
1202
+ command = 'PositionerErrorRead(' + PositionerName + ',int *)'
1203
+ error, returnedString = self.Send(socketId, command)
1204
+ if (error != 0):
1205
+ return [error, returnedString]
1206
+
1207
+ i, j, retList = 0, 0, [error]
1208
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1209
+ j += 1
1210
+ retList.append(eval(returnedString[i:i+j]))
1211
+ return retList
1212
+
1213
+ # PositionerErrorStringGet : Return the positioner status string corresponding to the positioner error code
1214
+ def PositionerErrorStringGet (self, socketId, PositionerErrorCode):
1215
+ return self.Send(socketId, 'PositionerErrorStringGet(%s, char *)' % str(PositionerErrorCode))
1216
+
1217
+ # PositionerExcitationSignalGet : Read disturbing signal parameters
1218
+ def PositionerExcitationSignalGet (self, socketId, PositionerName):
1219
+ command = 'PositionerExcitationSignalGet(' + PositionerName + ',int *,double *,double *,double *)'
1220
+ error, returnedString = self.Send(socketId, command)
1221
+ if (error != 0):
1222
+ return [error, returnedString]
1223
+
1224
+ i, j, retList = 0, 0, [error]
1225
+ for paramNb in range(4):
1226
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1227
+ j += 1
1228
+ retList.append(eval(returnedString[i:i+j]))
1229
+ i, j = i+j+1, 0
1230
+ return retList
1231
+
1232
+ # PositionerExcitationSignalSet : Update disturbing signal parameters
1233
+ def PositionerExcitationSignalSet (self, socketId, PositionerName, Mode, Frequency, Amplitude, Time):
1234
+ command = 'PositionerExcitationSignalSet(' + PositionerName + ',' + str(Mode) + ',' + str(Frequency) + ',' + str(Amplitude) + ',' + str(Time) + ')'
1235
+ return self.Send(socketId, command)
1236
+
1237
+ # PositionerExternalLatchPositionGet : Read external latch position
1238
+ def PositionerExternalLatchPositionGet (self, socketId, PositionerName):
1239
+ command = 'PositionerExternalLatchPositionGet(' + PositionerName + ',double *)'
1240
+ error, returnedString = self.Send(socketId, command)
1241
+ if (error != 0):
1242
+ return [error, returnedString]
1243
+
1244
+ i, j, retList = 0, 0, [error]
1245
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1246
+ j += 1
1247
+ retList.append(eval(returnedString[i:i+j]))
1248
+ return retList
1249
+
1250
+ # PositionerHardwareStatusGet : Read positioner hardware status
1251
+ def PositionerHardwareStatusGet (self, socketId, PositionerName):
1252
+ command = 'PositionerHardwareStatusGet(' + PositionerName + ',int *)'
1253
+ error, returnedString = self.Send(socketId, command)
1254
+ if (error != 0):
1255
+ return [error, returnedString]
1256
+
1257
+ i, j, retList = 0, 0, [error]
1258
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1259
+ j += 1
1260
+ retList.append(eval(returnedString[i:i+j]))
1261
+ return retList
1262
+
1263
+ # PositionerHardwareStatusStringGet : Return the positioner hardware status string corresponding to the positioner error code
1264
+ def PositionerHardwareStatusStringGet (self, socketId, PositionerHardwareStatus):
1265
+ return self.Send(socketId, 'PositionerHardwareStatusStringGet(%s, char *)' % str(PositionerHardwareStatus))
1266
+
1267
+ # PositionerHardInterpolatorFactorGet : Get hard interpolator parameters
1268
+ def PositionerHardInterpolatorFactorGet (self, socketId, PositionerName):
1269
+ command = 'PositionerHardInterpolatorFactorGet(' + PositionerName + ',int *)'
1270
+ error, returnedString = self.Send(socketId, command)
1271
+ if (error != 0):
1272
+ return [error, returnedString]
1273
+
1274
+ i, j, retList = 0, 0, [error]
1275
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1276
+ j += 1
1277
+ retList.append(eval(returnedString[i:i+j]))
1278
+ return retList
1279
+
1280
+ # PositionerHardInterpolatorFactorSet : Set hard interpolator parameters
1281
+ def PositionerHardInterpolatorFactorSet (self, socketId, PositionerName, InterpolationFactor):
1282
+ command = 'PositionerHardInterpolatorFactorSet(' + PositionerName + ',' + str(InterpolationFactor) + ')'
1283
+ return self.Send(socketId, command)
1284
+
1285
+ # PositionerMaximumVelocityAndAccelerationGet : Return maximum velocity and acceleration of the positioner
1286
+ def PositionerMaximumVelocityAndAccelerationGet (self, socketId, PositionerName):
1287
+ command = 'PositionerMaximumVelocityAndAccelerationGet(' + PositionerName + ',double *,double *)'
1288
+ error, returnedString = self.Send(socketId, command)
1289
+ if (error != 0):
1290
+ return [error, returnedString]
1291
+
1292
+ i, j, retList = 0, 0, [error]
1293
+ for paramNb in range(2):
1294
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1295
+ j += 1
1296
+ retList.append(eval(returnedString[i:i+j]))
1297
+ i, j = i+j+1, 0
1298
+ return retList
1299
+
1300
+ # PositionerMotionDoneGet : Read motion done parameters
1301
+ def PositionerMotionDoneGet (self, socketId, PositionerName):
1302
+ command = 'PositionerMotionDoneGet(' + PositionerName + ',double *,double *,double *,double *,double *)'
1303
+ error, returnedString = self.Send(socketId, command)
1304
+ if (error != 0):
1305
+ return [error, returnedString]
1306
+
1307
+ i, j, retList = 0, 0, [error]
1308
+ for paramNb in range(5):
1309
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1310
+ j += 1
1311
+ retList.append(eval(returnedString[i:i+j]))
1312
+ i, j = i+j+1, 0
1313
+ return retList
1314
+
1315
+ # PositionerMotionDoneSet : Update motion done parameters
1316
+ def PositionerMotionDoneSet (self, socketId, PositionerName, PositionWindow, VelocityWindow, CheckingTime, MeanPeriod, TimeOut):
1317
+ command = 'PositionerMotionDoneSet(' + PositionerName + ',' + str(PositionWindow) + ',' + str(VelocityWindow) + ',' + str(CheckingTime) + ',' + str(MeanPeriod) + ',' + str(TimeOut) + ')'
1318
+ return self.Send(socketId, command)
1319
+
1320
+ # PositionerPositionCompareAquadBAlwaysEnable : Enable AquadB signal in always mode
1321
+ def PositionerPositionCompareAquadBAlwaysEnable (self, socketId, PositionerName):
1322
+ command = 'PositionerPositionCompareAquadBAlwaysEnable(' + PositionerName + ')'
1323
+ return self.Send(socketId, command)
1324
+
1325
+ # PositionerPositionCompareAquadBWindowedGet : Read position compare AquadB windowed parameters
1326
+ def PositionerPositionCompareAquadBWindowedGet (self, socketId, PositionerName):
1327
+ command = 'PositionerPositionCompareAquadBWindowedGet(' + PositionerName + ',double *,double *,bool *)'
1328
+ error, returnedString = self.Send(socketId, command)
1329
+ if (error != 0):
1330
+ return [error, returnedString]
1331
+
1332
+ i, j, retList = 0, 0, [error]
1333
+ for paramNb in range(3):
1334
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1335
+ j += 1
1336
+ retList.append(eval(returnedString[i:i+j]))
1337
+ i, j = i+j+1, 0
1338
+ return retList
1339
+
1340
+ # PositionerPositionCompareAquadBWindowedSet : Set position compare AquadB windowed parameters
1341
+ def PositionerPositionCompareAquadBWindowedSet (self, socketId, PositionerName, MinimumPosition, MaximumPosition):
1342
+ command = 'PositionerPositionCompareAquadBWindowedSet(' + PositionerName + ',' + str(MinimumPosition) + ',' + str(MaximumPosition) + ')'
1343
+ return self.Send(socketId, command)
1344
+
1345
+ # PositionerPositionCompareAquadBPrescalerSet: Sets PCO AquadB interpolation factor.
1346
+ def PositionerPositionCompareAquadBPrescalerSet(self, socketId, PositionerName, PCOInterpolationFactor):
1347
+ command = 'PositionerPositionCompareAquadBPrescalerSet(' + PositionerName + ',' + str(
1348
+ PCOInterpolationFactor) + ')'
1349
+ return self.Send(socketId, command)
1350
+
1351
+ # PositionerPositionCompareAquadBPrescalerGet : Gets PCO AquadB interpolation factor.
1352
+ def PositionerPositionCompareAquadBPrescalerGet(self, socketId, PositionerName):
1353
+ command = 'PositionerPositionCompareAquadBPrescalerGet(' + PositionerName + ',double *)'
1354
+ error, returnedString = self.Send(socketId, command)
1355
+ if (error != 0):
1356
+ return [error, returnedString]
1357
+
1358
+ # PositionerPositionCompareGet : Read position compare parameters
1359
+ def PositionerPositionCompareGet (self, socketId, PositionerName):
1360
+ command = 'PositionerPositionCompareGet(' + PositionerName + ',double *,double *,double *,bool *)'
1361
+ error, returnedString = self.Send(socketId, command)
1362
+ if (error != 0):
1363
+ return [error, returnedString]
1364
+
1365
+ i, j, retList = 0, 0, [error]
1366
+ for paramNb in range(4):
1367
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1368
+ j += 1
1369
+ retList.append(eval(returnedString[i:i+j]))
1370
+ i, j = i+j+1, 0
1371
+ return retList
1372
+
1373
+ # PositionerPositionCompareSet : Set position compare parameters
1374
+ def PositionerPositionCompareSet (self, socketId, PositionerName, MinimumPosition, MaximumPosition, PositionStep):
1375
+ command = 'PositionerPositionCompareSet(' + PositionerName + ',' + str(MinimumPosition) + ',' + str(MaximumPosition) + ',' + str(PositionStep) + ')'
1376
+ return self.Send(socketId, command)
1377
+
1378
+ # PositionerPositionCompareEnable : Enable position compare
1379
+ def PositionerPositionCompareEnable (self, socketId, PositionerName):
1380
+ command = 'PositionerPositionCompareEnable(' + PositionerName + ')'
1381
+ return self.Send(socketId, command)
1382
+
1383
+ # PositionerPositionCompareDisable : Disable position compare
1384
+ def PositionerPositionCompareDisable (self, socketId, PositionerName):
1385
+ command = 'PositionerPositionCompareDisable(' + PositionerName + ')'
1386
+ return self.Send(socketId, command)
1387
+
1388
+ # PositionerPositionComparePulseParametersGet : Get position compare PCO pulse parameters
1389
+ def PositionerPositionComparePulseParametersGet (self, socketId, PositionerName):
1390
+ command = 'PositionerPositionComparePulseParametersGet(' + PositionerName + ',double *,double *)'
1391
+ error, returnedString = self.Send(socketId, command)
1392
+ if (error != 0):
1393
+ return [error, returnedString]
1394
+
1395
+ i, j, retList = 0, 0, [error]
1396
+ for paramNb in range(2):
1397
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1398
+ j += 1
1399
+ retList.append(eval(returnedString[i:i+j]))
1400
+ i, j = i+j+1, 0
1401
+ return retList
1402
+
1403
+ # PositionerPositionComparePulseParametersSet : Set position compare PCO pulse parameters
1404
+ def PositionerPositionComparePulseParametersSet (self, socketId, PositionerName, PCOPulseWidth, EncoderSettlingTime):
1405
+ command = 'PositionerPositionComparePulseParametersSet(' + PositionerName + ',' + str(PCOPulseWidth) + ',' + str(EncoderSettlingTime) + ')'
1406
+ return self.Send(socketId, command)
1407
+
1408
+ # PositionerRawEncoderPositionGet : Get the raw encoder position
1409
+ def PositionerRawEncoderPositionGet (self, socketId, PositionerName, UserEncoderPosition):
1410
+ command = 'PositionerRawEncoderPositionGet(' + PositionerName + ',' + str(UserEncoderPosition) + ',double *)'
1411
+ error, returnedString = self.Send(socketId, command)
1412
+ if (error != 0):
1413
+ return [error, returnedString]
1414
+
1415
+ i, j, retList = 0, 0, [error]
1416
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1417
+ j += 1
1418
+ retList.append(eval(returnedString[i:i+j]))
1419
+ return retList
1420
+
1421
+ # PositionersEncoderIndexDifferenceGet : Return the difference between index of primary axis and secondary axis (only after homesearch)
1422
+ def PositionersEncoderIndexDifferenceGet (self, socketId, PositionerName):
1423
+ command = 'PositionersEncoderIndexDifferenceGet(' + PositionerName + ',double *)'
1424
+ error, returnedString = self.Send(socketId, command)
1425
+ if (error != 0):
1426
+ return [error, returnedString]
1427
+
1428
+ i, j, retList = 0, 0, [error]
1429
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1430
+ j += 1
1431
+ retList.append(eval(returnedString[i:i+j]))
1432
+ return retList
1433
+
1434
+ # PositionerSGammaExactVelocityAjustedDisplacementGet : Return adjusted displacement to get exact velocity
1435
+ def PositionerSGammaExactVelocityAjustedDisplacementGet (self, socketId, PositionerName, DesiredDisplacement):
1436
+ command = 'PositionerSGammaExactVelocityAjustedDisplacementGet(' + PositionerName + ',' + str(DesiredDisplacement) + ',double *)'
1437
+ error, returnedString = self.Send(socketId, command)
1438
+ if (error != 0):
1439
+ return [error, returnedString]
1440
+
1441
+ i, j, retList = 0, 0, [error]
1442
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1443
+ j += 1
1444
+ retList.append(eval(returnedString[i:i+j]))
1445
+ return retList
1446
+
1447
+ # PositionerSGammaParametersGet : Read dynamic parameters for one axe of a group for a future displacement
1448
+ def PositionerSGammaParametersGet (self, socketId, PositionerName):
1449
+ command = 'PositionerSGammaParametersGet(' + PositionerName + ',double *,double *,double *,double *)'
1450
+ error, returnedString = self.Send(socketId, command)
1451
+ if (error != 0):
1452
+ return [error, returnedString]
1453
+
1454
+ i, j, retList = 0, 0, [error]
1455
+ for paramNb in range(4):
1456
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1457
+ j += 1
1458
+ retList.append(eval(returnedString[i:i+j]))
1459
+ i, j = i+j+1, 0
1460
+ return retList
1461
+
1462
+ # PositionerSGammaParametersSet : Update dynamic parameters for one axe of a group for a future displacement
1463
+ def PositionerSGammaParametersSet (self, socketId, PositionerName, Velocity, Acceleration, MinimumTjerkTime, MaximumTjerkTime):
1464
+ command = 'PositionerSGammaParametersSet(' + PositionerName + ',' + str(Velocity) + ',' + str(Acceleration) + ',' + str(MinimumTjerkTime) + ',' + str(MaximumTjerkTime) + ')'
1465
+ return self.Send(socketId, command)
1466
+
1467
+ # PositionerSGammaPreviousMotionTimesGet : Read SettingTime and SettlingTime
1468
+ def PositionerSGammaPreviousMotionTimesGet (self, socketId, PositionerName):
1469
+ command = 'PositionerSGammaPreviousMotionTimesGet(' + PositionerName + ',double *,double *)'
1470
+ error, returnedString = self.Send(socketId, command)
1471
+ if (error != 0):
1472
+ return [error, returnedString]
1473
+
1474
+ i, j, retList = 0, 0, [error]
1475
+ for paramNb in range(2):
1476
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1477
+ j += 1
1478
+ retList.append(eval(returnedString[i:i+j]))
1479
+ i, j = i+j+1, 0
1480
+ return retList
1481
+
1482
+ # PositionerStageParameterGet : Return the stage parameter
1483
+ def PositionerStageParameterGet (self, socketId, PositionerName, ParameterName):
1484
+ command = 'PositionerStageParameterGet(' + PositionerName + ',' + ParameterName + ',char *)'
1485
+ return self.Send(socketId, command)
1486
+
1487
+ # PositionerStageParameterSet : Save the stage parameter
1488
+ def PositionerStageParameterSet (self, socketId, PositionerName, ParameterName, ParameterValue):
1489
+ command = 'PositionerStageParameterSet(' + PositionerName + ',' + ParameterName + ',' + ParameterValue + ')'
1490
+ return self.Send(socketId, command)
1491
+
1492
+ # PositionerTimeFlasherGet : Read time flasher parameters
1493
+ def PositionerTimeFlasherGet (self, socketId, PositionerName):
1494
+ command = 'PositionerTimeFlasherGet(' + PositionerName + ',double *,double *,double *,bool *)'
1495
+ error, returnedString = self.Send(socketId, command)
1496
+ if (error != 0):
1497
+ return [error, returnedString]
1498
+
1499
+ i, j, retList = 0, 0, [error]
1500
+ for paramNb in range(4):
1501
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1502
+ j += 1
1503
+ retList.append(eval(returnedString[i:i+j]))
1504
+ i, j = i+j+1, 0
1505
+ return retList
1506
+
1507
+ # PositionerTimeFlasherSet : Set time flasher parameters
1508
+ def PositionerTimeFlasherSet (self, socketId, PositionerName, MinimumPosition, MaximumPosition, TimeInterval):
1509
+ command = 'PositionerTimeFlasherSet(' + PositionerName + ',' + str(MinimumPosition) + ',' + str(MaximumPosition) + ',' + str(TimeInterval) + ')'
1510
+ return self.Send(socketId, command)
1511
+
1512
+ # PositionerTimeFlasherEnable : Enable time flasher
1513
+ def PositionerTimeFlasherEnable (self, socketId, PositionerName):
1514
+ return self.Send(socketId, 'PositionerTimeFlasherEnable(%s)' % PositionerName )
1515
+
1516
+ # PositionerTimeFlasherDisable : Disable time flasher
1517
+ def PositionerTimeFlasherDisable (self, socketId, PositionerName):
1518
+ return self.Send(socketId, 'PositionerTimeFlasherDisable(%s)' % PositionerName)
1519
+
1520
+ # PositionerUserTravelLimitsGet : Read UserMinimumTarget and UserMaximumTarget
1521
+ def PositionerUserTravelLimitsGet (self, socketId, PositionerName):
1522
+ command = 'PositionerUserTravelLimitsGet(' + PositionerName + ',double *,double *)'
1523
+ error, returnedString = self.Send(socketId, command)
1524
+ if (error != 0):
1525
+ return [error, returnedString]
1526
+
1527
+ i, j, retList = 0, 0, [error]
1528
+ for paramNb in range(2):
1529
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1530
+ j += 1
1531
+ retList.append(eval(returnedString[i:i+j]))
1532
+ i, j = i+j+1, 0
1533
+ return retList
1534
+
1535
+
1536
+ # PositionerUserTravelLimitsSet : Update UserMinimumTarget and UserMaximumTarget
1537
+ def PositionerUserTravelLimitsSet (self, socketId, PositionerName, UserMinimumTarget, UserMaximumTarget):
1538
+ command = 'PositionerUserTravelLimitsSet(' + PositionerName + ',' + str(UserMinimumTarget) + ',' + str(UserMaximumTarget) + ')'
1539
+ return self.Send(socketId, command)
1540
+
1541
+ # PositionerDACOffsetGet : Get DAC offsets
1542
+ def PositionerDACOffsetGet (self, socketId, PositionerName):
1543
+ command = 'PositionerDACOffsetGet(' + PositionerName + ',short *,short *)'
1544
+ error, returnedString = self.Send(socketId, command)
1545
+ if (error != 0):
1546
+ return [error, returnedString]
1547
+
1548
+ i, j, retList = 0, 0, [error]
1549
+ for paramNb in range(2):
1550
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1551
+ j += 1
1552
+ retList.append(eval(returnedString[i:i+j]))
1553
+ i, j = i+j+1, 0
1554
+ return retList
1555
+
1556
+ # PositionerDACOffsetSet : Set DAC offsets
1557
+ def PositionerDACOffsetSet (self, socketId, PositionerName, DACOffset1, DACOffset2):
1558
+ command = 'PositionerDACOffsetSet(' + PositionerName + ',' + str(DACOffset1) + ',' + str(DACOffset2) + ')'
1559
+ return self.Send(socketId, command)
1560
+
1561
+ # PositionerDACOffsetDualGet : Get dual DAC offsets
1562
+ def PositionerDACOffsetDualGet (self, socketId, PositionerName):
1563
+ command = 'PositionerDACOffsetDualGet(' + PositionerName + ',short *,short *,short *,short *)'
1564
+ error, returnedString = self.Send(socketId, command)
1565
+ if (error != 0):
1566
+ return [error, returnedString]
1567
+
1568
+ i, j, retList = 0, 0, [error]
1569
+ for paramNb in range(4):
1570
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1571
+ j += 1
1572
+ retList.append(eval(returnedString[i:i+j]))
1573
+ i, j = i+j+1, 0
1574
+ return retList
1575
+
1576
+
1577
+ # PositionerDACOffsetDualSet : Set dual DAC offsets
1578
+ def PositionerDACOffsetDualSet (self, socketId, PositionerName, PrimaryDACOffset1, PrimaryDACOffset2, SecondaryDACOffset1, SecondaryDACOffset2):
1579
+ command = 'PositionerDACOffsetDualSet(' + PositionerName + ',' + str(PrimaryDACOffset1) + ',' + str(PrimaryDACOffset2) + ',' + str(SecondaryDACOffset1) + ',' + str(SecondaryDACOffset2) + ')'
1580
+ return self.Send(socketId, command)
1581
+
1582
+ # PositionerCorrectorAutoTuning : Astrom&Hagglund based auto-tuning
1583
+ def PositionerCorrectorAutoTuning (self, socketId, PositionerName, TuningMode):
1584
+ command = 'PositionerCorrectorAutoTuning(' + PositionerName + ',' + str(TuningMode) + ',double *,double *,double *)'
1585
+ return self.Send(socketId, command)
1586
+ if (error != 0):
1587
+ return [error, returnedString]
1588
+
1589
+ i, j, retList = 0, 0, [error]
1590
+ for paramNb in range(3):
1591
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1592
+ j += 1
1593
+ retList.append(eval(returnedString[i:i+j]))
1594
+ i, j = i+j+1, 0
1595
+ return retList
1596
+
1597
+ # PositionerAccelerationAutoScaling : Astrom&Hagglund based auto-scaling
1598
+ def PositionerAccelerationAutoScaling (self, socketId, PositionerName):
1599
+ command = 'PositionerAccelerationAutoScaling(' + PositionerName + ',double *)'
1600
+ error, returnedString = self.Send(socketId, command)
1601
+ if (error != 0):
1602
+ return [error, returnedString]
1603
+
1604
+ i, j, retList = 0, 0, [error]
1605
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1606
+ j += 1
1607
+ retList.append(eval(returnedString[i:i+j]))
1608
+ return retList
1609
+
1610
+ # MultipleAxesPVTVerification : Multiple axes PVT trajectory verification
1611
+ def MultipleAxesPVTVerification (self, socketId, GroupName, TrajectoryFileName):
1612
+ command = 'MultipleAxesPVTVerification(' + GroupName + ',' + TrajectoryFileName + ')'
1613
+ return self.Send(socketId, command)
1614
+
1615
+ # MultipleAxesPTVerification : Multiple axes PT trajectory verification
1616
+ def MultipleAxesPTVerification (self, socketId, GroupName, TrajectoryFileName):
1617
+ command = 'MultipleAxesPTVerification(' + GroupName + ',' + TrajectoryFileName + ')'
1618
+ return self.Send(socketId, command)
1619
+
1620
+ # MultipleAxesPVTVerificationResultGet : Multiple axes PVT trajectory verification result get
1621
+ def MultipleAxesPVTVerificationResultGet (self, socketId, PositionerName):
1622
+ command = 'MultipleAxesPVTVerificationResultGet(' + PositionerName + ',char *,double *,double *,double *,double *)'
1623
+ error, returnedString = self.Send(socketId, command)
1624
+ if (error != 0):
1625
+ return [error, returnedString]
1626
+
1627
+ i, j, retList = 0, 0, [error]
1628
+ for paramNb in range(4):
1629
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1630
+ j += 1
1631
+ retList.append(eval(returnedString[i:i+j]))
1632
+ i, j = i+j+1, 0
1633
+ return retList
1634
+
1635
+ # MultipleAxesPVTExecution : Multiple axes PVT trajectory execution
1636
+ def MultipleAxesPVTExecution (self, socketId, GroupName, TrajectoryFileName, ExecutionNumber):
1637
+ command = 'MultipleAxesPVTExecution(' + GroupName + ',' + TrajectoryFileName + ',' + str(ExecutionNumber) + ')'
1638
+ return self.Send(socketId, command)
1639
+
1640
+ # MultipleAxesPTExecution : Multiple axes PT trajectory execution
1641
+ def MultipleAxesPTExecution (self, socketId, GroupName, TrajectoryFileName, ExecutionNumber):
1642
+ command = 'MultipleAxesPTExecution(' + GroupName + ',' + TrajectoryFileName + ',' + str(ExecutionNumber) + ')'
1643
+ return self.Send(socketId, command)
1644
+
1645
+ # MultipleAxesPVTParametersGet : Multiple axes PVT trajectory get parameters
1646
+ def MultipleAxesPVTParametersGet (self, socketId, GroupName):
1647
+ command = 'MultipleAxesPVTParametersGet(' + GroupName + ',char *,int *)'
1648
+ error, returnedString = self.Send(socketId, command)
1649
+ if (error != 0):
1650
+ return [error, returnedString]
1651
+
1652
+ i, j, retList = 0, 0, [error]
1653
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1654
+ j += 1
1655
+ retList.append(eval(returnedString[i:i+j]))
1656
+ return retList
1657
+
1658
+ # MultipleAxesPVTPulseOutputSet : Configure pulse output on trajectory
1659
+ def MultipleAxesPVTPulseOutputSet (self, socketId, GroupName, StartElement, EndElement, TimeInterval):
1660
+ command = 'MultipleAxesPVTPulseOutputSet(' + GroupName + ',' + str(StartElement) + ',' + str(EndElement) + ',' + str(TimeInterval) + ')'
1661
+ return self.Send(socketId, command)
1662
+
1663
+ # MultipleAxesPVTPulseOutputGet : Get pulse output on trajectory configuration
1664
+ def MultipleAxesPVTPulseOutputGet (self, socketId, GroupName):
1665
+ command = 'MultipleAxesPVTPulseOutputGet(' + GroupName + ',int *,int *,double *)'
1666
+ error, returnedString = self.Send(socketId, command)
1667
+ if (error != 0):
1668
+ return [error, returnedString]
1669
+
1670
+ i, j, retList = 0, 0, [error]
1671
+ for paramNb in range(3):
1672
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1673
+ j += 1
1674
+ retList.append(eval(returnedString[i:i+j]))
1675
+ i, j = i+j+1, 0
1676
+ return retList
1677
+
1678
+ # SingleAxisSlaveModeEnable : Enable the slave mode
1679
+ def SingleAxisSlaveModeEnable (self, socketId, GroupName):
1680
+ return self.Send(socketId, 'SingleAxisSlaveModeEnable(%s)' % GroupName)
1681
+
1682
+ # SingleAxisSlaveModeDisable : Disable the slave mode
1683
+ def SingleAxisSlaveModeDisable (self, socketId, GroupName):
1684
+ return self.Send(socketId, 'SingleAxisSlaveModeDisable(%s)' % GroupName)
1685
+
1686
+ # SingleAxisSlaveParametersSet : Set slave parameters
1687
+ def SingleAxisSlaveParametersSet (self, socketId, GroupName, PositionerName, Ratio):
1688
+ command = 'SingleAxisSlaveParametersSet(' + GroupName + ',' + PositionerName + ',' + str(Ratio) + ')'
1689
+ return self.Send(socketId, command)
1690
+
1691
+ # SingleAxisSlaveParametersGet : Get slave parameters
1692
+ def SingleAxisSlaveParametersGet (self, socketId, GroupName):
1693
+ command = 'SingleAxisSlaveParametersGet(' + GroupName + ',char *,double *)'
1694
+ error, returnedString = self.Send(socketId, command)
1695
+ if (error != 0):
1696
+ return [error, returnedString]
1697
+
1698
+ i, j, retList = 0, 0, [error]
1699
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1700
+ j += 1
1701
+ retList.append(eval(returnedString[i:i+j]))
1702
+ return retList
1703
+
1704
+ # SpindleSlaveModeEnable : Enable the slave mode
1705
+ def SpindleSlaveModeEnable (self, socketId, GroupName):
1706
+ return self.Send(socketId, 'SpindleSlaveModeEnable(%s)' % GroupName)
1707
+
1708
+ # SpindleSlaveModeDisable : Disable the slave mode
1709
+ def SpindleSlaveModeDisable (self, socketId, GroupName):
1710
+ return self.Send(socketId, 'SpindleSlaveModeDisable(%s)' % GroupName)
1711
+
1712
+ # SpindleSlaveParametersSet : Set slave parameters
1713
+ def SpindleSlaveParametersSet (self, socketId, GroupName, PositionerName, Ratio):
1714
+ command = 'SpindleSlaveParametersSet(' + GroupName + ',' + PositionerName + ',' + str(Ratio) + ')'
1715
+ return self.Send(socketId, command)
1716
+
1717
+ # SpindleSlaveParametersGet : Get slave parameters
1718
+ def SpindleSlaveParametersGet (self, socketId, GroupName):
1719
+ command = 'SpindleSlaveParametersGet(' + GroupName + ',char *,double *)'
1720
+ error, returnedString = self.Send(socketId, command)
1721
+ if (error != 0):
1722
+ return [error, returnedString]
1723
+
1724
+ i, j, retList = 0, 0, [error]
1725
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1726
+ j += 1
1727
+ retList.append(eval(returnedString[i:i+j]))
1728
+ return retList
1729
+
1730
+ # GroupSpinParametersSet : Modify Spin parameters on selected group and activate the continuous move
1731
+ def GroupSpinParametersSet (self, socketId, GroupName, Velocity, Acceleration):
1732
+ command = 'GroupSpinParametersSet(' + GroupName + ',' + str(Velocity) + ',' + str(Acceleration) + ')'
1733
+ return self.Send(socketId, command)
1734
+
1735
+ # GroupSpinParametersGet : Get Spin parameters on selected group
1736
+ def GroupSpinParametersGet (self, socketId, GroupName):
1737
+ command = 'GroupSpinParametersGet(' + GroupName + ',double *,double *)'
1738
+ error, returnedString = self.Send(socketId, command)
1739
+ if (error != 0):
1740
+ return [error, returnedString]
1741
+
1742
+ i, j, retList = 0, 0, [error]
1743
+ for paramNb in range(2):
1744
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1745
+ j += 1
1746
+ retList.append(eval(returnedString[i:i+j]))
1747
+ i, j = i+j+1, 0
1748
+ return retList
1749
+
1750
+
1751
+ # GroupSpinCurrentGet : Get Spin current on selected group
1752
+ def GroupSpinCurrentGet (self, socketId, GroupName):
1753
+ command = 'GroupSpinCurrentGet(' + GroupName + ',double *,double *)'
1754
+ error, returnedString = self.Send(socketId, command)
1755
+ if (error != 0):
1756
+ return [error, returnedString]
1757
+
1758
+ i, j, retList = 0, 0, [error]
1759
+ for paramNb in range(2):
1760
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1761
+ j += 1
1762
+ retList.append(eval(returnedString[i:i+j]))
1763
+ i, j = i+j+1, 0
1764
+ return retList
1765
+
1766
+ # GroupSpinModeStop : Stop Spin mode on selected group with specified acceleration
1767
+ def GroupSpinModeStop (self, socketId, GroupName, Acceleration):
1768
+ command = 'GroupSpinModeStop(' + GroupName + ',' + str(Acceleration) + ')'
1769
+ return self.Send(socketId, command)
1770
+
1771
+ # XYLineArcVerification : XY trajectory verification
1772
+ def XYLineArcVerification (self, socketId, GroupName, TrajectoryFileName):
1773
+ command = 'XYLineArcVerification(' + GroupName + ',' + TrajectoryFileName + ')'
1774
+ return self.Send(socketId, command)
1775
+
1776
+ # XYLineArcVerificationResultGet : XY trajectory verification result get
1777
+ def XYLineArcVerificationResultGet (self, socketId, PositionerName):
1778
+ command = 'XYLineArcVerificationResultGet(' + PositionerName + ',char *,double *,double *,double *,double *)'
1779
+ error, returnedString = self.Send(socketId, command)
1780
+ if (error != 0):
1781
+ return [error, returnedString]
1782
+
1783
+ i, j, retList = 0, 0, [error]
1784
+ for paramNb in range(4):
1785
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1786
+ j += 1
1787
+ retList.append(eval(returnedString[i:i+j]))
1788
+ i, j = i+j+1, 0
1789
+ return retList
1790
+
1791
+ # XYLineArcExecution : XY trajectory execution
1792
+ def XYLineArcExecution (self, socketId, GroupName, TrajectoryFileName, Velocity, Acceleration, ExecutionNumber):
1793
+ command = 'XYLineArcExecution(' + GroupName + ',' + TrajectoryFileName + ',' + str(Velocity) + ',' + str(Acceleration) + ',' + str(ExecutionNumber) + ')'
1794
+ return self.Send(socketId, command)
1795
+
1796
+
1797
+ # XYLineArcParametersGet : XY trajectory get parameters
1798
+ def XYLineArcParametersGet (self, socketId, GroupName):
1799
+ command = 'XYLineArcParametersGet(' + GroupName + ',char *,double *,double *,int *)'
1800
+ error, returnedString = self.Send(socketId, command)
1801
+ if (error != 0):
1802
+ return [error, returnedString]
1803
+
1804
+ i, j, retList = 0, 0, [error]
1805
+ for paramNb in range(3):
1806
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1807
+ j += 1
1808
+ retList.append(eval(returnedString[i:i+j]))
1809
+ i, j = i+j+1, 0
1810
+ return retList
1811
+
1812
+ # XYLineArcPulseOutputSet : Configure pulse output on trajectory
1813
+ def XYLineArcPulseOutputSet (self, socketId, GroupName, StartLength, EndLength, PathLengthInterval):
1814
+ command = 'XYLineArcPulseOutputSet(' + GroupName + ',' + str(StartLength) + ',' + str(EndLength) + ',' + str(PathLengthInterval) + ')'
1815
+ return self.Send(socketId, command)
1816
+
1817
+ # XYLineArcPulseOutputGet : Get pulse output on trajectory configuration
1818
+ def XYLineArcPulseOutputGet (self, socketId, GroupName):
1819
+ command = 'XYLineArcPulseOutputGet(' + GroupName + ',double *,double *,double *)'
1820
+ error, returnedString = self.Send(socketId, command)
1821
+ if (error != 0):
1822
+ return [error, returnedString]
1823
+
1824
+ i, j, retList = 0, 0, [error]
1825
+ for paramNb in range(3):
1826
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1827
+ j += 1
1828
+ retList.append(eval(returnedString[i:i+j]))
1829
+ i, j = i+j+1, 0
1830
+ return retList
1831
+
1832
+ # XYZGroupPositionCorrectedProfilerGet : Return corrected profiler positions
1833
+ def XYZGroupPositionCorrectedProfilerGet (self, socketId, GroupName, PositionX, PositionY, PositionZ):
1834
+ command = 'XYZGroupPositionCorrectedProfilerGet(' + GroupName + ',' + str(PositionX) + ',' + str(PositionY) + ',' + str(PositionZ) + ',double *,double *,double *)'
1835
+ error, returnedString = self.Send(socketId, command)
1836
+ if (error != 0):
1837
+ return [error, returnedString]
1838
+
1839
+ i, j, retList = 0, 0, [error]
1840
+ for paramNb in range(3):
1841
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1842
+ j += 1
1843
+ retList.append(eval(returnedString[i:i+j]))
1844
+ i, j = i+j+1, 0
1845
+ return retList
1846
+
1847
+ # XYZSplineVerification : XYZ trajectory verifivation
1848
+ def XYZSplineVerification (self, socketId, GroupName, TrajectoryFileName):
1849
+ command = 'XYZSplineVerification(' + GroupName + ',' + TrajectoryFileName + ')'
1850
+ return self.Send(socketId, command)
1851
+
1852
+ # XYZSplineVerificationResultGet : XYZ trajectory verification result get
1853
+ def XYZSplineVerificationResultGet (self, socketId, PositionerName):
1854
+ command = 'XYZSplineVerificationResultGet(' + PositionerName + ',char *,double *,double *,double *,double *)'
1855
+ error, returnedString = self.Send(socketId, command)
1856
+ if (error != 0):
1857
+ return [error, returnedString]
1858
+
1859
+ i, j, retList = 0, 0, [error]
1860
+ for paramNb in range(4):
1861
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1862
+ j += 1
1863
+ retList.append(eval(returnedString[i:i+j]))
1864
+ i, j = i+j+1, 0
1865
+ return retList
1866
+
1867
+ # XYZSplineExecution : XYZ trajectory execution
1868
+ def XYZSplineExecution (self, socketId, GroupName, TrajectoryFileName, Velocity, Acceleration):
1869
+ command = 'XYZSplineExecution(' + GroupName + ',' + TrajectoryFileName + ',' + str(Velocity) + ',' + str(Acceleration) + ')'
1870
+ return self.Send(socketId, command)
1871
+
1872
+ # XYZSplineParametersGet : XYZ trajectory get parameters
1873
+ def XYZSplineParametersGet (self, socketId, GroupName):
1874
+ command = 'XYZSplineParametersGet(' + GroupName + ',char *,double *,double *,int *)'
1875
+ error, returnedString = self.Send(socketId, command)
1876
+ if (error != 0):
1877
+ return [error, returnedString]
1878
+
1879
+ i, j, retList = 0, 0, [error]
1880
+ for paramNb in range(3):
1881
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1882
+ j += 1
1883
+ retList.append(eval(returnedString[i:i+j]))
1884
+ i, j = i+j+1, 0
1885
+ return retList
1886
+
1887
+ # OptionalModuleExecute : Execute an optional module
1888
+ def OptionalModuleExecute (self, socketId, ModuleFileName, TaskName):
1889
+ return self.Send(socketId, 'OptionalModuleExecute(%s, %s)' % (ModuleFileName, TaskName))
1890
+
1891
+ # OptionalModuleKill : Kill an optional module
1892
+ def OptionalModuleKill (self, socketId, TaskName):
1893
+ return self.Send(socketId, 'OptionalModuleKill(%s)' % TaskName )
1894
+
1895
+ # EEPROMCIESet : Set CIE EEPROM reference string
1896
+ def EEPROMCIESet (self, socketId, CardNumber, ReferenceString):
1897
+ return self.Send(socketId, 'EEPROMCIESet(%s, %s)' % (str(CardNumber), ReferenceString))
1898
+
1899
+ # EEPROMDACOffsetCIESet : Set CIE DAC offsets
1900
+ def EEPROMDACOffsetCIESet (self, socketId, PlugNumber, DAC1Offset, DAC2Offset):
1901
+ command = 'EEPROMDACOffsetCIESet(' + str(PlugNumber) + ',' + str(DAC1Offset) + ',' + str(DAC2Offset) + ')'
1902
+ return self.Send(socketId, command)
1903
+
1904
+ # EEPROMDriverSet : Set Driver EEPROM reference string
1905
+ def EEPROMDriverSet (self, socketId, PlugNumber, ReferenceString):
1906
+ return self.Send(socketId, 'EEPROMDriverSet(%s, %s)' % (str(PlugNumber), ReferenceString))
1907
+
1908
+ # EEPROMINTSet : Set INT EEPROM reference string
1909
+ def EEPROMINTSet (self, socketId, CardNumber, ReferenceString):
1910
+ return self.Send(socketId, 'EEPROMINTSet(%s, %s)' % (str(CardNumber), ReferenceString))
1911
+
1912
+ # CPUCoreAndBoardSupplyVoltagesGet : Get power informations
1913
+ def CPUCoreAndBoardSupplyVoltagesGet (self, socketId):
1914
+ command = 'CPUCoreAndBoardSupplyVoltagesGet(double *,double *,double *,double *,double *,double *,double *,double *)'
1915
+ error, returnedString = self.Send(socketId, command)
1916
+ if (error != 0):
1917
+ return [error, returnedString]
1918
+
1919
+ i, j, retList = 0, 0, [error]
1920
+ for paramNb in range(8):
1921
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1922
+ j += 1
1923
+ retList.append(eval(returnedString[i:i+j]))
1924
+ i, j = i+j+1, 0
1925
+ return retList
1926
+
1927
+ # CPUTemperatureAndFanSpeedGet : Get CPU temperature and fan speed
1928
+ def CPUTemperatureAndFanSpeedGet (self, socketId):
1929
+ command = 'CPUTemperatureAndFanSpeedGet(double *,double *)'
1930
+ error, returnedString = self.Send(socketId, command)
1931
+ if (error != 0):
1932
+ return [error, returnedString]
1933
+
1934
+ i, j, retList = 0, 0, [error]
1935
+ for paramNb in range(2):
1936
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
1937
+ j += 1
1938
+ retList.append(eval(returnedString[i:i+j]))
1939
+ i, j = i+j+1, 0
1940
+ return retList
1941
+
1942
+ # ActionListGet : Action list
1943
+ def ActionListGet (self, socketId):
1944
+ return self.Send(socketId, 'ActionListGet(char *)')
1945
+
1946
+ # ActionExtendedListGet : Action extended list
1947
+ def ActionExtendedListGet (self, socketId):
1948
+ return self.Send(socketId, 'ActionExtendedListGet(char *)')
1949
+
1950
+ # APIExtendedListGet : API method list
1951
+ def APIExtendedListGet (self, socketId):
1952
+ return self.Send(socketId, 'APIExtendedListGet(char *)')
1953
+
1954
+ # APIListGet : API method list without extended API
1955
+ def APIListGet (self, socketId):
1956
+ return self.Send(socketId, 'APIListGet(char *)')
1957
+
1958
+ # ControllerStatusListGet : Controller status list
1959
+ def ControllerStatusListGet (self, socketId):
1960
+ return self.Send(socketId, 'ControllerStatusListGet(char *)')
1961
+
1962
+ # ErrorListGet : Error list
1963
+ def ErrorListGet (self, socketId):
1964
+ return self.Send(socketId, 'ErrorListGet(char *)')
1965
+
1966
+ # EventListGet : General event list
1967
+ def EventListGet (self, socketId):
1968
+ return self.Send(socketId, 'EventListGet(char *)')
1969
+
1970
+ # GatheringListGet : Gathering type list
1971
+ def GatheringListGet (self, socketId):
1972
+ return self.Send(socketId,'GatheringListGet(char *)')
1973
+
1974
+ # GatheringExtendedListGet : Gathering type extended list
1975
+ def GatheringExtendedListGet (self, socketId):
1976
+ return self.Send(socketId, 'GatheringExtendedListGet(char *)')
1977
+
1978
+ # GatheringExternalListGet : External Gathering type list
1979
+ def GatheringExternalListGet (self, socketId):
1980
+ return self.Send(socketId, 'GatheringExternalListGet(char *)')
1981
+
1982
+ # GroupStatusListGet : Group status list
1983
+ def GroupStatusListGet (self, socketId):
1984
+ return self.Send(socketId, 'GroupStatusListGet(char *)')
1985
+
1986
+ # HardwareInternalListGet : Internal hardware list
1987
+ def HardwareInternalListGet (self, socketId):
1988
+ return self.Send(socketId, 'HardwareInternalListGet(char *)')
1989
+
1990
+ # HardwareDriverAndStageGet : Smart hardware
1991
+ def HardwareDriverAndStageGet (self, socketId, PlugNumber):
1992
+ return self.Send(socketId, 'HardwareDriverAndStageGet(%s, char *, char *)' % str(PlugNumber))
1993
+
1994
+ # ObjectsListGet : Group name and positioner name
1995
+ def ObjectsListGet (self, socketId):
1996
+ return self.Send(socketId, 'ObjectsListGet(char *)')
1997
+
1998
+ # PositionerErrorListGet : Positioner error list
1999
+ def PositionerErrorListGet (self, socketId):
2000
+ return self.Send(socketId, 'PositionerErrorListGet(char *)')
2001
+
2002
+ # PositionerHardwareStatusListGet : Positioner hardware status list
2003
+ def PositionerHardwareStatusListGet (self, socketId):
2004
+ return self.Send(socketId, 'PositionerHardwareStatusListGet(char *)')
2005
+
2006
+ # PositionerDriverStatusListGet : Positioner driver status list
2007
+ def PositionerDriverStatusListGet (self, socketId):
2008
+ return self.Send(socketId, 'PositionerDriverStatusListGet(char *)')
2009
+
2010
+ # ReferencingActionListGet : Get referencing action list
2011
+ def ReferencingActionListGet (self, socketId):
2012
+ return self.Send(socketId, 'ReferencingActionListGet(char *)')
2013
+
2014
+ # ReferencingSensorListGet : Get referencing sensor list
2015
+ def ReferencingSensorListGet (self, socketId):
2016
+ return self.Send(socketId, 'ReferencingSensorListGet(char *)')
2017
+
2018
+ # GatheringUserDatasGet : Return user data values
2019
+ def GatheringUserDatasGet (self, socketId):
2020
+ command = 'GatheringUserDatasGet(double *,double *,double *,double *,double *,double *,double *,double *)'
2021
+ error, returnedString = self.Send(socketId, command)
2022
+ if (error != 0):
2023
+ return [error, returnedString]
2024
+
2025
+ i, j, retList = 0, 0, [error]
2026
+ for paramNb in range(8):
2027
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
2028
+ j += 1
2029
+ retList.append(eval(returnedString[i:i+j]))
2030
+ i, j = i+j+1, 0
2031
+ return retList
2032
+
2033
+ # ControllerMotionKernelPeriodMinMaxGet : Get controller motion kernel min/max periods
2034
+ def ControllerMotionKernelPeriodMinMaxGet (self, socketId):
2035
+ command = 'ControllerMotionKernelPeriodMinMaxGet(double *,double *,double *,double *,double *,double *)'
2036
+ error, returnedString = self.Send(socketId, command)
2037
+ if (error != 0):
2038
+ return [error, returnedString]
2039
+
2040
+ i, j, retList = 0, 0, [error]
2041
+ for paramNb in range(6):
2042
+ while ((i+j) < len(returnedString) and returnedString[i+j] != ','):
2043
+ j += 1
2044
+ retList.append(eval(returnedString[i:i+j]))
2045
+ i, j = i+j+1, 0
2046
+ return retList
2047
+
2048
+ # ControllerMotionKernelPeriodMinMaxReset : Reset controller motion kernel min/max periods
2049
+ def ControllerMotionKernelPeriodMinMaxReset (self, socketId):
2050
+ return self.Send(socketId, 'ControllerMotionKernelPeriodMinMaxReset()')
2051
+
2052
+ # SocketsStatusGet : Get sockets current status
2053
+ def SocketsStatusGet (self, socketId):
2054
+ return self.Send(socketId, 'SocketsStatusGet(char *)')
2055
+
2056
+ # TestTCP : Test TCP/IP transfert
2057
+ def TestTCP (self, socketId, InputString):
2058
+ return self.Send(socketId, 'TestTCP(%s, char *)' % InputString)
2059
+
2060
+ # ========== Only for XPS-D ==========
2061
+
2062
+ # CleanCoreDumpFolder : Remove core file in /Admin/Public/CoreDump folder
2063
+ def CleanCoreDumpFolder (self, socketId):
2064
+ return self.Send(socketId, 'CleanCoreDumpFolder()')
2065
+
2066
+ # CleanTmpFolder : Clean the tmp folder
2067
+ def CleanTmpFolder(self, socketId):
2068
+ return self.Send(socketId, 'CleanTmpFolder()')