Startup
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
name=PO2DV-NCS-LS
|
||||||
|
description=Optis 2 Linear Slide in test office setup
|
||||||
|
#tests=Collimator Tests
|
||||||
|
tests=Linear Slide Tests
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
name=PO2DV-NCS-VHQ1
|
||||||
|
description=Optis 2 Linear Slide in test office setup
|
||||||
|
tests=PS Tests
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
name=PO2TC-NCS-RS
|
||||||
|
description=RS& Range Shifter
|
||||||
|
tests=Range Shifter Tests
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
name=PROF02&DMAF1
|
||||||
|
description=Collimators
|
||||||
|
tests=Collimator Tests pro
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
name=PO2DV-NCS-VHQ1
|
||||||
|
description=Optis 2 Linear Slide in test office setup
|
||||||
|
tests=PS Tests
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
name=PO2TC-NCS-FIXL
|
||||||
|
description=FIXL& Fixation Light
|
||||||
|
tests=Display Tests
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
name=PO2TC-NCS-MWD
|
||||||
|
description=MWD& Modulator Wheel Display
|
||||||
|
tests=Display Tests
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
name=PO2TC-NCS-SC21
|
||||||
|
description=SC21& Scatter Foil 2.1
|
||||||
|
tests=Linear Slide Tests
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
name=PO2TC-NCS-SC22
|
||||||
|
description=SC21& Scatter Foil 2.2
|
||||||
|
tests=Linear Slide Tests
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
name=PO2TC-NCS-SC23
|
||||||
|
description=SC23& Scatter Foil 2.3
|
||||||
|
tests=Linear Slide Tests
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Tue Oct 03 13&56&43 CEST 2017
|
||||||
|
name=bx84
|
||||||
|
tests=sad
|
||||||
|
description=simulation device in playground
|
||||||
|
parameters=delay&".2"&"delay between 2 steps";bla&"234"&"bla bla";setVal&"11"&"value to set";expectedVal&"18.1"&"expected returned value";mask&"2"&"bit mask";
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Fri Oct 13 10:59:28 CEST 2017
|
||||||
|
name=bx84_2
|
||||||
|
tests=sad
|
||||||
|
parameters=a&IQCOM,$GNT3,1,DIA\:22&23;delay&.2&delay between 2 steps;bla&234&bla bla;setVal&21&value to set;expectedVal&18.1&expected returned value;mask&2&bit mask;
|
||||||
|
description=simulation device in playground
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#Tue Mar 20 13:51:16 CET 2018
|
||||||
|
name=oldDev1
|
||||||
|
tests=Old struct tests
|
||||||
|
description=o
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#Tue Mar 20 13:51:21 CET 2018
|
||||||
|
name=oldDev2
|
||||||
|
tests=Old struct tests
|
||||||
|
description=o
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Wed Oct 18 15:07:43 CEST 2017
|
||||||
|
name=AMA1
|
||||||
|
tests=RPS Tests Interlocklilmits
|
||||||
|
parameters=ilkInExpectedValS&"0x91DD"&"[hex] Interlock Input expected value for small values of magnet";magnetCh&"AMA1\:SOL\:1"&"Magnet epics channel";ilkInCh&"J102025\:REG\:R\:6"&"Interlock Input epics channel";ilkInExpectedValIni&"0x1DDD"&"[hex] Interlock Input expected initial value";ilkOutExpectedValL&"0x0000"&"[hex] Interlock Output expected value for large values of magnet";magnetEndVal&"50000"&"[int] magnet final value for scan sequence";ilkOutCh&"J102025\:REG\:R\:3"&"Interlock Output epics channel";ilkOutExpectedValIni&"0x0000"&"[hex] Interlock Output expected initial value";ilkOutExpectedValS&"0x000C"&"[hex] Interlock Output expected value for small values of magnet";magnetInitVal&"0"&"[int] magnet initial value for scan sequence";setGetDelay&"1"&"[s] delay between set and get";mode&"2,IQCOM,$GNT2,1,DIA"&"operating mode";
|
||||||
|
description=Ablenkungsmagnet AMA1
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Wed Oct 18 10:54:16 CEST 2017
|
||||||
|
name=Gantry1
|
||||||
|
tests=RPS Tests Betriebsmode
|
||||||
|
description=rps section till Gantry 1
|
||||||
|
parameters=mode&"2,IQCOM,$GNT1,1,DIA"&"betriebsmode";expectedVal14&"0x0040"&"[hex] Expected value for channels 1-4";expectedVal58&"0x0000"&"[hex] Expected value for channels 5-8";
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Wed Oct 18 10:54:16 CEST 2017
|
||||||
|
name=Gantry2
|
||||||
|
tests=RPS Tests Betriebsmode
|
||||||
|
description=rps section till Gantry 2
|
||||||
|
parameters=mode&"2,IQCOM,$GNT2,1,DIA"&"betriebsmode";expectedVal14&"0x0000"&"[hex] Expected value for channels 1-4";expectedVal58&"0x0004"&"[hex] Expected value for channels 5-8";
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Wed Oct 18 10:54:16 CEST 2017
|
||||||
|
name=Gantry3
|
||||||
|
tests=RPS Tests Betriebsmode
|
||||||
|
description=rps section till Gantry 3
|
||||||
|
parameters=mode&"2,IQCOM,$GNT3,1,DIA"&"betriebsmode";expectedVal14&"0x0400"&"[hex] Expected value for channels 1-4";expectedVal58&"0x0000"&"[hex] Expected value for channels 5-8";
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Wed Oct 18 10:54:16 CEST 2017
|
||||||
|
name=Optis
|
||||||
|
tests=RPS Tests Betriebsmode
|
||||||
|
description=rps section till Optis
|
||||||
|
parameters=mode&"2,IQCOM,$OPT,1,DIA"&"betriebsmode";expectedVal14&"0x4000"&"[hex] Expected value for channels 1-4";expectedVal58&"0x0000"&"[hex] Expected value for channels 5-8";
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Wed Oct 18 10:54:16 CEST 2017
|
||||||
|
name=PIF
|
||||||
|
tests=RPS Tests Betriebsmode
|
||||||
|
description=rps section till PIF
|
||||||
|
parameters=mode&"2,IQCOM,$PIF,1,DIA"&"betriebsmode";expectedVal14&"0x0400"&"[hex] Expected value for channels 1-4";expectedVal58&"0x0000"&"[hex] Expected value for channels 5-8";
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Fri Oct 20 13:57:25 CEST 2017
|
||||||
|
name=XMA0310
|
||||||
|
tests=RPS Tests Diagnostic
|
||||||
|
parameters=rpsAttribute&"REG\:R\:5"&"RPS EPICS attribute";rpsModule&"J101030"&"RPS module EPICS channel name";expectedValue2&"0x0010"&"[hex] expected value 2";expectedValue1&"0x00D0"&"[hex] expected value 1";
|
||||||
|
description=Diagnostic module
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Fri Oct 20 13:58:05 CEST 2017
|
||||||
|
name=XMA0311
|
||||||
|
tests=RPS Tests Diagnostic
|
||||||
|
parameters=rpsAttribute&"REG\:R\:5"&"RPS EPICS attribute";rpsModule&"J101030"&"RPS module EPICS channel name";expectedValue2&"0x0001"&"[hex] expected value 2";expectedValue1&"0x000D"&"[hex] expected value 1";
|
||||||
|
description=Diagnostic module
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Fri Oct 20 13:58:37 CEST 2017
|
||||||
|
name=XMA0410
|
||||||
|
tests=RPS Tests Diagnostic
|
||||||
|
parameters=rpsAttribute&"REG\:R\:7"&"RPS EPICS attribute";rpsModule&"J101046"&"RPS module EPICS channel name";expectedValue2&"0x0010"&"[hex] expected value 2";expectedValue1&"0x00D0"&"[hex] expected value 1";
|
||||||
|
description=Diagnostic module
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Fri Oct 20 13:53:14 CEST 2017
|
||||||
|
name=XMA1115
|
||||||
|
tests=RPS Tests Diagnostic
|
||||||
|
parameters=rpsAttribute&"REG\:R\:4"&"RPS EPICS attribute";rpsModule&"J102007"&"RPS module EPICS channel name";expectedValue2&"0x0100"&"[hex] expected value 2";expectedValue1&"0x0D00"&"[hex] expected value 1";
|
||||||
|
description=Diagnostic module
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Fri Oct 20 13:41:43 CEST 2017
|
||||||
|
name=XMA1116
|
||||||
|
tests=RPS Tests Diagnostic
|
||||||
|
parameters=rpsAttribute&"REG\:R\:4"&"RPS EPICS attribute";rpsModule&"J102007"&"RPS module EPICS channel name";expectedValue2&"0x0010"&"[hex] expected value 2";expectedValue1&"0x00D0"&"[hex] expected value 1";
|
||||||
|
description=Diagnostic module
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Fri Oct 20 13:53:44 CEST 2017
|
||||||
|
name=XMA1117
|
||||||
|
tests=RPS Tests Diagnostic
|
||||||
|
parameters=rpsAttribute&"REG\:R\:4"&"RPS EPICS attribute";rpsModule&"J102007"&"RPS module EPICS channel name";expectedValue2&"0x1000"&"[hex] expected value 2";expectedValue1&"0xD000"&"[hex] expected value 1";
|
||||||
|
description=Diagnostic module
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Fri Oct 20 13:40:33 CEST 2017
|
||||||
|
name=XMA1118
|
||||||
|
tests=RPS Tests Diagnostic
|
||||||
|
parameters=rpsAttribute&"REG\:R\:7"&"RPS EPICS attribute";rpsModule&"J102025"&"RPS module EPICS channel name";expectedValue2&"0x0010"&"[hex] expected value 2";expectedValue1&"0x00D0"&"[hex] expected value 1";
|
||||||
|
description=Diagnostic module
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Fri Oct 20 13:41:13 CEST 2017
|
||||||
|
name=XMA1119
|
||||||
|
tests=RPS Tests Diagnostic
|
||||||
|
parameters=rpsAttribute&"REG\:R\:4"&"RPS EPICS attribute";rpsModule&"J102007"&"RPS module EPICS channel name";expectedValue2&"0x0001"&"[hex] expected value 2";expectedValue1&"0x000D"&"[hex] expected value 1";
|
||||||
|
description=Diagnostic module
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Fri Oct 20 14:02:17 CEST 2017
|
||||||
|
name=XMB0510
|
||||||
|
tests=RPS Tests Diagnostic
|
||||||
|
parameters=rpsAttribute&"REG\:R\:5"&"RPS EPICS attribute";rpsModule&"J108053"&"RPS module EPICS channel name";expectedValue2&"0x0100"&"[hex] expected value 2";expectedValue1&"0x0D00"&"[hex] expected value 1";
|
||||||
|
description=Diagnostic module
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Fri Oct 20 14:00:49 CEST 2017
|
||||||
|
name=XMC0610
|
||||||
|
tests=RPS Tests Diagnostic
|
||||||
|
parameters=rpsAttribute&"REG\:R\:5"&"RPS EPICS attribute";rpsModule&"J110060"&"RPS module EPICS channel name";expectedValue2&"0x0100"&"[hex] expected value 2";expectedValue1&"0x0D00"&"[hex] expected value 1";
|
||||||
|
description=Diagnostic module
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Fri Oct 20 14:01:23 CEST 2017
|
||||||
|
name=XMC2010
|
||||||
|
tests=RPS Tests Diagnostic
|
||||||
|
parameters=rpsAttribute&"REG\:R\:5"&"RPS EPICS attribute";rpsModule&"J117065"&"RPS module EPICS channel name";expectedValue2&"0x0010"&"[hex] expected value 2";expectedValue1&"0x00D0"&"[hex] expected value 1";
|
||||||
|
description=Diagnostic module
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Fri Oct 20 14:01:52 CEST 2017
|
||||||
|
name=XMC2011
|
||||||
|
tests=RPS Tests Diagnostic
|
||||||
|
parameters=rpsAttribute&"REG\:R\:5"&"RPS EPICS attribute";rpsModule&"J117065"&"RPS module EPICS channel name";expectedValue2&"0x0100"&"[hex] expected value 2";expectedValue1&"0x0D00"&"[hex] expected value 1";
|
||||||
|
description=Diagnostic module
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Fri Oct 20 13:59:03 CEST 2017
|
||||||
|
name=XMD0710
|
||||||
|
tests=RPS Tests Diagnostic
|
||||||
|
parameters=rpsAttribute&"REG\:R\:5"&"RPS EPICS attribute";rpsModule&"J124081"&"RPS module EPICS channel name";expectedValue2&"0x0010"&"[hex] expected value 2";expectedValue1&"0x00D0"&"[hex] expected value 1";
|
||||||
|
description=Diagnostic module
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Fri Oct 20 13:59:41 CEST 2017
|
||||||
|
name=XMD0711
|
||||||
|
tests=RPS Tests Diagnostic
|
||||||
|
parameters=rpsAttribute&"REG\:R\:5"&"RPS EPICS attribute";rpsModule&"J124081"&"RPS module EPICS channel name";expectedValue2&"0x0100"&"[hex] expected value 2";expectedValue1&"0x0D00"&"[hex] expected value 1";
|
||||||
|
description=Diagnostic module
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Fri Oct 20 14:00:11 CEST 2017
|
||||||
|
name=XMD0717
|
||||||
|
tests=RPS Tests Diagnostic
|
||||||
|
parameters=rpsAttribute&"REG\:R\:4"&"RPS EPICS attribute";rpsModule&"J124092"&"RPS module EPICS channel name";expectedValue2&"0x0001"&"[hex] expected value 2";expectedValue1&"0x000D"&"[hex] expected value 1";
|
||||||
|
description=Diagnostic module
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Fri Oct 20 13:54:46 CEST 2017
|
||||||
|
name=XME1310
|
||||||
|
tests=RPS Tests Diagnostic
|
||||||
|
parameters=rpsAttribute&"REG\:R\:6"&"RPS EPICS attribute";rpsModule&"J112009"&"RPS module EPICS channel name";expectedValue2&"0x0001"&"[hex] expected value 2";expectedValue1&"0x000D"&"[hex] expected value 1";
|
||||||
|
description=Diagnostic module
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Fri Oct 20 13:55:53 CEST 2017
|
||||||
|
name=XME1311
|
||||||
|
tests=RPS Tests Diagnostic
|
||||||
|
parameters=rpsAttribute&"REG\:R\:4"&"RPS EPICS attribute";rpsModule&"J112023"&"RPS module EPICS channel name";expectedValue2&"0x0100"&"[hex] expected value 2";expectedValue1&"0x0D00"&"[hex] expected value 1";
|
||||||
|
description=Diagnostic module
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Fri Oct 20 13:56:25 CEST 2017
|
||||||
|
name=XME1410
|
||||||
|
tests=RPS Tests Diagnostic
|
||||||
|
parameters=rpsAttribute&"REG\:R\:5"&"RPS EPICS attribute";rpsModule&"J112023"&"RPS module EPICS channel name";expectedValue2&"0x0001"&"[hex] expected value 2";expectedValue1&"0x000D"&"[hex] expected value 1";
|
||||||
|
description=Diagnostic module
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Fri Oct 20 13:56:53 CEST 2017
|
||||||
|
name=XME1411
|
||||||
|
tests=RPS Tests Diagnostic
|
||||||
|
parameters=rpsAttribute&"REG\:R\:5"&"RPS EPICS attribute";rpsModule&"J112023"&"RPS module EPICS channel name";expectedValue2&"0x0010"&"[hex] expected value 2";expectedValue1&"0x00D0"&"[hex] expected value 1";
|
||||||
|
description=Diagnostic module
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Wed Oct 18 10:54:10 CEST 2017
|
||||||
|
name=bis-BMA1
|
||||||
|
tests=RPS Tests Betriebsmode
|
||||||
|
parameters=mode&"2,IQCOM,$BMA1,1,DIAG"&"operating mode";expectedVal14&"0x0000"&"[hex] Expected value for channels 1-4";expectedVal58&"0x0000"&"[hex] Expected value for channels 5-8";
|
||||||
|
description=rps section till BMA1
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Wed Oct 18 10:54:10 CEST 2017
|
||||||
|
name=bis-BMC1
|
||||||
|
tests=RPS Tests Betriebsmode
|
||||||
|
parameters=mode&"2,IQCOM,$BMC1,1,DIAG"&"operating mode";expectedVal14&"0x0000"&"[hex] Expected value for channels 1-4";expectedVal58&"0x0000"&"[hex] Expected value for channels 5-8";
|
||||||
|
description=rps section till BMC1
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Wed Oct 18 10:54:16 CEST 2017
|
||||||
|
name=bis-BMD1
|
||||||
|
tests=RPS Tests Betriebsmode
|
||||||
|
description=rps section till BMD1
|
||||||
|
parameters=mode&"2,IQCOM,$BMD1,1,DIA"&"betriebsmode";expectedVal14&"0x0000"&"[hex] Expected value for channels 1-4";expectedVal58&"0x0000"&"[hex] Expected value for channels 5-8";
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Wed Oct 18 10:54:16 CEST 2017
|
||||||
|
name=bis-BME1
|
||||||
|
tests=RPS Tests Betriebsmode
|
||||||
|
description=rps section till BME1
|
||||||
|
parameters=mode&"2,IQCOM,$BME1,1,DIA"&"betriebsmode";expectedVal14&"0x0000"&"[hex] Expected value for channels 1-4";expectedVal58&"0x0000"&"[hex] Expected value for channels 5-8";
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#Tue Mar 20 09:48:39 CET 2018
|
||||||
|
name=newbx84
|
||||||
|
tests=New Structure Tests
|
||||||
|
parameters=par1&"1"&"override param 1";par3&"p3"&"device specific param";
|
||||||
|
description=bx84 device for new testing list structure
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#Tue Mar 20 13:51:16 CET 2018
|
||||||
|
name=oldDev1
|
||||||
|
tests=Olt struct tests
|
||||||
|
description=o
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#Tue Mar 20 13:51:21 CET 2018
|
||||||
|
name=oldDev2
|
||||||
|
tests=Olt struct tests
|
||||||
|
description=o
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#Tue Mar 20 13:40:52 CET 2018
|
||||||
|
name=new bx84 2
|
||||||
|
parameters=
|
||||||
|
description=bla
|
||||||
+15
@@ -0,0 +1,15 @@
|
|||||||
|
<html>
|
||||||
|
<!-- Copyright (c) 2015 Paul Scherrer Institute. All rights reserved. -->
|
||||||
|
<body>
|
||||||
|
<h2>Description</h2>
|
||||||
|
bla
|
||||||
|
<h2>Parameters</h2>
|
||||||
|
<table>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
<h2>Contact</h2>
|
||||||
|
<a href="https://intranet.psi.ch/search/#?t=phonebook&q=boccioli_m">Marco Boccioli</a> <br/>
|
||||||
|
Tel. 3078
|
||||||
|
</html>
|
||||||
|
</body>
|
||||||
|
|
||||||
+174
@@ -0,0 +1,174 @@
|
|||||||
|
# Test name: new bx84 2
|
||||||
|
# bla
|
||||||
|
# Copyright (c) 2015 Paul Scherrer Institute. All rights reserved.
|
||||||
|
|
||||||
|
###### Init - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
global sys, inspect, os, traceback
|
||||||
|
import sys, inspect, os, traceback
|
||||||
|
|
||||||
|
|
||||||
|
def startTest(testName, DEVICE, params):
|
||||||
|
"""
|
||||||
|
Main method running the test
|
||||||
|
"""
|
||||||
|
# by default, assume the test failed:
|
||||||
|
ret = 'Test failed'
|
||||||
|
status = False
|
||||||
|
# put the whole custom code under try/catch.
|
||||||
|
try:
|
||||||
|
# get the path of this script:
|
||||||
|
testPath = inspect.getfile(inspect.currentframe())
|
||||||
|
# init the testing tool class:
|
||||||
|
test = TestingTool(testName, testPath, DEVICE, params)
|
||||||
|
|
||||||
|
################ END OF Init #####################
|
||||||
|
######### WRITE YOUR CODE HERE BELOW #############
|
||||||
|
|
||||||
|
"""
|
||||||
|
All the code in this section # WRITE YOUR CODE HERE BELOW # is just an example and can be modified/deleted.
|
||||||
|
It must be indented to the same level as this comment.
|
||||||
|
-----------------------------------
|
||||||
|
GETTING INPUTS:
|
||||||
|
-----------------------------------
|
||||||
|
If needed, the following methods are available:
|
||||||
|
|
||||||
|
test.getPath() string, path of this test file
|
||||||
|
test.getName() string, name of this test
|
||||||
|
test.getDeviceName() string, device for which the test must run (typically it is the beginning of a process variable name)
|
||||||
|
test.getPlotName() string, name to be given to the plot when using setPlotTitle(). Example: scan.setPlotTitle(test.getPlotName())
|
||||||
|
-----------------------------------
|
||||||
|
GETTING TEST PARAMETERS:
|
||||||
|
-----------------------------------
|
||||||
|
if you need to get parameters for the test, use:
|
||||||
|
|
||||||
|
myParamValue = test.getParam('myParamName')
|
||||||
|
|
||||||
|
the calls to getParam are added to the code automatically, one per parameter, when creating the new test.
|
||||||
|
NOTE: Casting may be necessary.
|
||||||
|
See the test config for the list of parameters specific to the test.
|
||||||
|
-----------------------------------
|
||||||
|
SETTING OUTPUTS:
|
||||||
|
-----------------------------------
|
||||||
|
When the test has ended (error or success), this method must be called in order to return to pshell:
|
||||||
|
|
||||||
|
test.sendFeedback(ret,success)
|
||||||
|
|
||||||
|
ret string, a text summarizing the result of the test.
|
||||||
|
success bool, True = test successful. False = test failed.
|
||||||
|
-----------------------------------
|
||||||
|
LOG INFO:
|
||||||
|
-----------------------------------
|
||||||
|
when some information must be shown on the log on pshell, use the following line:
|
||||||
|
test.log('text to log')
|
||||||
|
"""
|
||||||
|
|
||||||
|
########## Example (can be removed) ######
|
||||||
|
|
||||||
|
# print the list of parameters passed. If any error, stop and send feedback.
|
||||||
|
test.log("Example - Test name: " + test.getName())
|
||||||
|
test.log("Example - Device name: " + test.getDeviceName() )
|
||||||
|
try:
|
||||||
|
test.log("Running test with the following parameters:")
|
||||||
|
test.printParams()
|
||||||
|
# If present, use the parameters here below for your test script.
|
||||||
|
# These parameters were automatically generated: you might need to change the casting.
|
||||||
|
|
||||||
|
except:
|
||||||
|
import traceback
|
||||||
|
# test failed, write the report into the variables ret and success and send feedback:
|
||||||
|
ret = 'Could not retrieve testing parameters - ' + traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
return
|
||||||
|
|
||||||
|
# loop to read channels for a while and plot the channels values.
|
||||||
|
# initialise plot tab with 2 plots: pass here the axis names:
|
||||||
|
scan = ManualScan(['sample'], ['Status (MSTA)', 'Position (VAL)'])
|
||||||
|
# set plot name(tab title):
|
||||||
|
scan.setPlotTitle(test.getPlotName())
|
||||||
|
# start plots. See further below how to add points to the plots (scan):
|
||||||
|
scan.start()
|
||||||
|
|
||||||
|
# inject a sinus into the plot, as example
|
||||||
|
from math import sin
|
||||||
|
motor_msta = 0
|
||||||
|
# take 100 samples of a sinus and a jigsaw plot them:
|
||||||
|
for sample in range(0, 100):
|
||||||
|
readback1 = sample #the x axis.
|
||||||
|
sleep(0.1) # settling time.
|
||||||
|
# get value (it is translated to a caget):
|
||||||
|
motor_msta = motor_msta + +1
|
||||||
|
if motor_msta > 50:
|
||||||
|
motor_msta = 0
|
||||||
|
# get value:
|
||||||
|
motor_val = sin(float(sample)/10.0)*10.0-10.0
|
||||||
|
# add values to plot:
|
||||||
|
scan.append([readback1], [readback1], [motor_msta, motor_val])
|
||||||
|
|
||||||
|
# now try with data from real device: this part will most probably fail: correct the PV names with existing ones.
|
||||||
|
try:
|
||||||
|
# set up connection to channels. "type" of data can be "d" (= double), "l" (= long).
|
||||||
|
pv_motor_msta = Channel(test.getDeviceName() + ':IST:2' , type='d')
|
||||||
|
pv_motor_val = Channel(test.getDeviceName() + ':IST:1' , type='d')
|
||||||
|
pv_motor_com = Channel(test.getDeviceName() + ':COM:2' , type='d')
|
||||||
|
except:
|
||||||
|
import traceback
|
||||||
|
# prepare return information: return text:
|
||||||
|
ret = 'Unable to create channel - ' + traceback.format_exc()
|
||||||
|
# prepare return information: return success:
|
||||||
|
success = False
|
||||||
|
# send return information:
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
return
|
||||||
|
# send a command to a channel (it is translated to a caput): uncomment this line below to try it
|
||||||
|
#pv_motor_com.put(1.0, timeout=None) # optionally, a timeout can be given.
|
||||||
|
# take 100 samples of the channels and plot them:
|
||||||
|
for sample in range(0, 100):
|
||||||
|
readback1 = sample #the x axis.
|
||||||
|
sleep(0.1) # settling time.
|
||||||
|
# get value (it is translated to a caget):
|
||||||
|
motor_msta = pv_motor_msta.get()
|
||||||
|
# get value:
|
||||||
|
motor_val = pv_motor_val.get()
|
||||||
|
# add values to plot:
|
||||||
|
scan.append([readback1], [readback1], [motor_msta, motor_val])
|
||||||
|
|
||||||
|
# Closing channels: all channels that were opened with Channel() must be closed before exit:
|
||||||
|
pv_motor_msta.close()
|
||||||
|
pv_motor_val.close()
|
||||||
|
pv_motor_com.close()
|
||||||
|
|
||||||
|
# IMPORTANT: if the test was successful, write the report into the variables ret and success.
|
||||||
|
# for example, write the following:
|
||||||
|
ret = "Example - Test successful, here some detail: ..."
|
||||||
|
success = True
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
# once the test is finished, no need to do anything. The code below yours will do the rest.
|
||||||
|
################ End of Example ##########
|
||||||
|
|
||||||
|
################ END OF YOUR CODE ################
|
||||||
|
###### Final - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
|
||||||
|
# just in case the feedback was forgotten.
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
except (KeyboardInterrupt):
|
||||||
|
# user stop error handler.
|
||||||
|
import traceback
|
||||||
|
ret = 'Test stopped by user.'
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
except:
|
||||||
|
# generic error handler.
|
||||||
|
import traceback
|
||||||
|
ret = traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
|
||||||
|
|
||||||
|
# launch the test.
|
||||||
|
startTest(test, device, parameters)
|
||||||
|
|
||||||
|
################ END OF Final ####################
|
||||||
|
#### IF NEEDED, ADD YOUR FUNCTIONS HERE BELOW ####
|
||||||
|
# Indent to end left
|
||||||
|
# def yourCustomFunction:
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
#Tue Mar 20 09:47:18 CET 2018
|
||||||
|
name=new structure monitor
|
||||||
|
parameters=par1&"1"&"param 1";par2&"p2"&"param 2";
|
||||||
|
description=Buld new tests with new testing list structure
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
<html>
|
||||||
|
<!-- Copyright (c) 2015 Paul Scherrer Institute. All rights reserved. -->
|
||||||
|
<body>
|
||||||
|
<h2>Description</h2>
|
||||||
|
Buld new tests with new testing list structure
|
||||||
|
<h2>Parameters</h2>
|
||||||
|
<table>
|
||||||
|
<tr><td><code>par1 </code></td><td>param 1</td></tr>
|
||||||
|
<tr><td><code>par2 </code></td><td>param 2</td></tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
<h2>Contact</h2>
|
||||||
|
<a href="https://intranet.psi.ch/search/#?t=phonebook&q=boccioli_m">Marco Boccioli</a> <br/>
|
||||||
|
Tel. 3078
|
||||||
|
</html>
|
||||||
|
</body>
|
||||||
|
|
||||||
+174
@@ -0,0 +1,174 @@
|
|||||||
|
# Test name: new structure monitor
|
||||||
|
# Buld new tests with new testing list structure
|
||||||
|
# Copyright (c) 2015 Paul Scherrer Institute. All rights reserved.
|
||||||
|
|
||||||
|
###### Init - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
global sys, inspect, os, traceback
|
||||||
|
import sys, inspect, os, traceback
|
||||||
|
|
||||||
|
|
||||||
|
def startTest(testName, DEVICE, params):
|
||||||
|
"""
|
||||||
|
Main method running the test
|
||||||
|
"""
|
||||||
|
# by default, assume the test failed:
|
||||||
|
ret = 'Test failed'
|
||||||
|
status = False
|
||||||
|
# put the whole custom code under try/catch.
|
||||||
|
try:
|
||||||
|
# get the path of this script:
|
||||||
|
testPath = inspect.getfile(inspect.currentframe())
|
||||||
|
# init the testing tool class:
|
||||||
|
test = TestingTool(testName, testPath, DEVICE, params)
|
||||||
|
|
||||||
|
################ END OF Init #####################
|
||||||
|
######### WRITE YOUR CODE HERE BELOW #############
|
||||||
|
|
||||||
|
"""
|
||||||
|
All the code in this section # WRITE YOUR CODE HERE BELOW # is just an example and can be modified/deleted.
|
||||||
|
It must be indented to the same level as this comment.
|
||||||
|
-----------------------------------
|
||||||
|
GETTING INPUTS:
|
||||||
|
-----------------------------------
|
||||||
|
If needed, the following methods are available:
|
||||||
|
|
||||||
|
test.getPath() string, path of this test file
|
||||||
|
test.getName() string, name of this test
|
||||||
|
test.getDeviceName() string, device for which the test must run (typically it is the beginning of a process variable name)
|
||||||
|
test.getPlotName() string, name to be given to the plot when using setPlotTitle(). Example: scan.setPlotTitle(test.getPlotName())
|
||||||
|
-----------------------------------
|
||||||
|
GETTING TEST PARAMETERS:
|
||||||
|
-----------------------------------
|
||||||
|
if you need to get parameters for the test, use:
|
||||||
|
|
||||||
|
myParamValue = test.getParam('myParamName')
|
||||||
|
|
||||||
|
the calls to getParam are added to the code automatically, one per parameter, when creating the new test.
|
||||||
|
NOTE: Casting may be necessary.
|
||||||
|
See the test config for the list of parameters specific to the test.
|
||||||
|
-----------------------------------
|
||||||
|
SETTING OUTPUTS:
|
||||||
|
-----------------------------------
|
||||||
|
When the test has ended (error or success), this method must be called in order to return to pshell:
|
||||||
|
|
||||||
|
test.sendFeedback(ret,success)
|
||||||
|
|
||||||
|
ret string, a text summarizing the result of the test.
|
||||||
|
success bool, True = test successful. False = test failed.
|
||||||
|
-----------------------------------
|
||||||
|
LOG INFO:
|
||||||
|
-----------------------------------
|
||||||
|
when some information must be shown on the log on pshell, use the following line:
|
||||||
|
test.log('text to log')
|
||||||
|
"""
|
||||||
|
|
||||||
|
########## Example (can be removed) ######
|
||||||
|
|
||||||
|
# print the list of parameters passed. If any error, stop and send feedback.
|
||||||
|
test.log("Example - Test name: " + test.getName())
|
||||||
|
test.log("Example - Device name: " + test.getDeviceName() )
|
||||||
|
try:
|
||||||
|
test.log("Running test with the following parameters:")
|
||||||
|
test.printParams()
|
||||||
|
# If present, use the parameters here below for your test script.
|
||||||
|
# These parameters were automatically generated: you might need to change the casting.
|
||||||
|
par1 = float(test.getParam('par1')) ; par2 = float(test.getParam('par2')) ;
|
||||||
|
except:
|
||||||
|
import traceback
|
||||||
|
# test failed, write the report into the variables ret and success and send feedback:
|
||||||
|
ret = 'Could not retrieve testing parameters - ' + traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
return
|
||||||
|
|
||||||
|
# loop to read channels for a while and plot the channels values.
|
||||||
|
# initialise plot tab with 2 plots: pass here the axis names:
|
||||||
|
scan = ManualScan(['sample'], ['Status (MSTA)', 'Position (VAL)'])
|
||||||
|
# set plot name(tab title):
|
||||||
|
scan.setPlotTitle(test.getPlotName())
|
||||||
|
# start plots. See further below how to add points to the plots (scan):
|
||||||
|
scan.start()
|
||||||
|
|
||||||
|
# inject a sinus into the plot, as example
|
||||||
|
from math import sin
|
||||||
|
motor_msta = 0
|
||||||
|
# take 100 samples of a sinus and a jigsaw plot them:
|
||||||
|
for sample in range(0, 100):
|
||||||
|
readback1 = sample #the x axis.
|
||||||
|
sleep(0.1) # settling time.
|
||||||
|
# get value (it is translated to a caget):
|
||||||
|
motor_msta = motor_msta + +1
|
||||||
|
if motor_msta > 50:
|
||||||
|
motor_msta = 0
|
||||||
|
# get value:
|
||||||
|
motor_val = sin(float(sample)/10.0)*10.0-10.0
|
||||||
|
# add values to plot:
|
||||||
|
scan.append([readback1], [readback1], [motor_msta, motor_val])
|
||||||
|
|
||||||
|
# now try with data from real device: this part will most probably fail: correct the PV names with existing ones.
|
||||||
|
try:
|
||||||
|
# set up connection to channels. "type" of data can be "d" (= double), "l" (= long).
|
||||||
|
pv_motor_msta = Channel(test.getDeviceName() + ':IST:2' , type='d')
|
||||||
|
pv_motor_val = Channel(test.getDeviceName() + ':IST:1' , type='d')
|
||||||
|
pv_motor_com = Channel(test.getDeviceName() + ':COM:2' , type='d')
|
||||||
|
except:
|
||||||
|
import traceback
|
||||||
|
# prepare return information: return text:
|
||||||
|
ret = 'Unable to create channel - ' + traceback.format_exc()
|
||||||
|
# prepare return information: return success:
|
||||||
|
success = False
|
||||||
|
# send return information:
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
return
|
||||||
|
# send a command to a channel (it is translated to a caput): uncomment this line below to try it
|
||||||
|
#pv_motor_com.put(1.0, timeout=None) # optionally, a timeout can be given.
|
||||||
|
# take 100 samples of the channels and plot them:
|
||||||
|
for sample in range(0, 100):
|
||||||
|
readback1 = sample #the x axis.
|
||||||
|
sleep(0.1) # settling time.
|
||||||
|
# get value (it is translated to a caget):
|
||||||
|
motor_msta = pv_motor_msta.get()
|
||||||
|
# get value:
|
||||||
|
motor_val = pv_motor_val.get()
|
||||||
|
# add values to plot:
|
||||||
|
scan.append([readback1], [readback1], [motor_msta, motor_val])
|
||||||
|
|
||||||
|
# Closing channels: all channels that were opened with Channel() must be closed before exit:
|
||||||
|
pv_motor_msta.close()
|
||||||
|
pv_motor_val.close()
|
||||||
|
pv_motor_com.close()
|
||||||
|
|
||||||
|
# IMPORTANT: if the test was successful, write the report into the variables ret and success.
|
||||||
|
# for example, write the following:
|
||||||
|
ret = "Example - Test successful, here some detail: ..."
|
||||||
|
success = True
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
# once the test is finished, no need to do anything. The code below yours will do the rest.
|
||||||
|
################ End of Example ##########
|
||||||
|
|
||||||
|
################ END OF YOUR CODE ################
|
||||||
|
###### Final - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
|
||||||
|
# just in case the feedback was forgotten.
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
except (KeyboardInterrupt):
|
||||||
|
# user stop error handler.
|
||||||
|
import traceback
|
||||||
|
ret = 'Test stopped by user.'
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
except:
|
||||||
|
# generic error handler.
|
||||||
|
import traceback
|
||||||
|
ret = traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
|
||||||
|
|
||||||
|
# launch the test.
|
||||||
|
startTest(test, device, parameters)
|
||||||
|
|
||||||
|
################ END OF Final ####################
|
||||||
|
#### IF NEEDED, ADD YOUR FUNCTIONS HERE BELOW ####
|
||||||
|
# Indent to end left
|
||||||
|
# def yourCustomFunction:
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#Tue Mar 20 13:50:42 CET 2018
|
||||||
|
name=oldtest
|
||||||
|
parameters=examplePar1\:2\:This is the parameter n.1 with unit [unit];examplePar2\:4.5\:This is the parameter n.2 with unit [unit];
|
||||||
|
description=o
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<html>
|
||||||
|
<!-- Copyright (c) 2015 Paul Scherrer Institute. All rights reserved. -->
|
||||||
|
<body>
|
||||||
|
<h2>Description</h2>
|
||||||
|
o
|
||||||
|
<h2>Parameters</h2>
|
||||||
|
<table>
|
||||||
|
<tr><td><code>examplePar1 </code></td><td>This is the parameter n.1 with unit [unit]</td></tr>
|
||||||
|
<tr><td><code>examplePar2 </code></td><td>This is the parameter n.2 with unit [unit]</td></tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
<h2>Contact</h2>
|
||||||
|
<a href="https://intranet.psi.ch/search/#?t=phonebook&q=boccioli_m">Marco Boccioli</a> <br/>
|
||||||
|
Tel. 3078
|
||||||
|
</html>
|
||||||
|
</body>
|
||||||
|
|
||||||
@@ -0,0 +1,174 @@
|
|||||||
|
# Test name: oldtest
|
||||||
|
# o
|
||||||
|
# Copyright (c) 2015 Paul Scherrer Institute. All rights reserved.
|
||||||
|
|
||||||
|
###### Init - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
global sys, inspect, os, traceback
|
||||||
|
import sys, inspect, os, traceback
|
||||||
|
|
||||||
|
|
||||||
|
def startTest(testName, DEVICE, params):
|
||||||
|
"""
|
||||||
|
Main method running the test
|
||||||
|
"""
|
||||||
|
# by default, assume the test failed:
|
||||||
|
ret = 'Test failed'
|
||||||
|
status = False
|
||||||
|
# put the whole custom code under try/catch.
|
||||||
|
try:
|
||||||
|
# get the path of this script:
|
||||||
|
testPath = inspect.getfile(inspect.currentframe())
|
||||||
|
# init the testing tool class:
|
||||||
|
test = TestingTool(testName, testPath, DEVICE, params)
|
||||||
|
|
||||||
|
################ END OF Init #####################
|
||||||
|
######### WRITE YOUR CODE HERE BELOW #############
|
||||||
|
|
||||||
|
"""
|
||||||
|
All the code in this section # WRITE YOUR CODE HERE BELOW # is just an example and can be modified/deleted.
|
||||||
|
It must be indented to the same level as this comment.
|
||||||
|
-----------------------------------
|
||||||
|
GETTING INPUTS:
|
||||||
|
-----------------------------------
|
||||||
|
If needed, the following methods are available:
|
||||||
|
|
||||||
|
test.getPath() string, path of this test file
|
||||||
|
test.getName() string, name of this test
|
||||||
|
test.getDeviceName() string, device for which the test must run (typically it is the beginning of a process variable name)
|
||||||
|
test.getPlotName() string, name to be given to the plot when using setPlotTitle(). Example: scan.setPlotTitle(test.getPlotName())
|
||||||
|
-----------------------------------
|
||||||
|
GETTING TEST PARAMETERS:
|
||||||
|
-----------------------------------
|
||||||
|
if you need to get parameters for the test, use:
|
||||||
|
|
||||||
|
myParamValue = test.getParam('myParamName')
|
||||||
|
|
||||||
|
the calls to getParam are added to the code automatically, one per parameter, when creating the new test.
|
||||||
|
NOTE: Casting may be necessary.
|
||||||
|
See the test config for the list of parameters specific to the test.
|
||||||
|
-----------------------------------
|
||||||
|
SETTING OUTPUTS:
|
||||||
|
-----------------------------------
|
||||||
|
When the test has ended (error or success), this method must be called in order to return to pshell:
|
||||||
|
|
||||||
|
test.sendFeedback(ret,success)
|
||||||
|
|
||||||
|
ret string, a text summarizing the result of the test.
|
||||||
|
success bool, True = test successful. False = test failed.
|
||||||
|
-----------------------------------
|
||||||
|
LOG INFO:
|
||||||
|
-----------------------------------
|
||||||
|
when some information must be shown on the log on pshell, use the following line:
|
||||||
|
test.log('text to log')
|
||||||
|
"""
|
||||||
|
|
||||||
|
########## Example (can be removed) ######
|
||||||
|
|
||||||
|
# print the list of parameters passed. If any error, stop and send feedback.
|
||||||
|
test.log("Example - Test name: " + test.getName())
|
||||||
|
test.log("Example - Device name: " + test.getDeviceName() )
|
||||||
|
try:
|
||||||
|
test.log("Running test with the following parameters:")
|
||||||
|
test.printParams()
|
||||||
|
# If present, use the parameters here below for your test script.
|
||||||
|
# These parameters were automatically generated: you might need to change the casting.
|
||||||
|
examplePar1 = float(test.getParam('examplePar1')) ; examplePar2 = float(test.getParam('examplePar2')) ;
|
||||||
|
except:
|
||||||
|
import traceback
|
||||||
|
# test failed, write the report into the variables ret and success and send feedback:
|
||||||
|
ret = 'Could not retrieve testing parameters - ' + traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
return
|
||||||
|
|
||||||
|
# loop to read channels for a while and plot the channels values.
|
||||||
|
# initialise plot tab with 2 plots: pass here the axis names:
|
||||||
|
scan = ManualScan(['sample'], ['Status (MSTA)', 'Position (VAL)'])
|
||||||
|
# set plot name(tab title):
|
||||||
|
scan.setPlotTitle(test.getPlotName())
|
||||||
|
# start plots. See further below how to add points to the plots (scan):
|
||||||
|
scan.start()
|
||||||
|
|
||||||
|
# inject a sinus into the plot, as example
|
||||||
|
from math import sin
|
||||||
|
motor_msta = 0
|
||||||
|
# take 100 samples of a sinus and a jigsaw plot them:
|
||||||
|
for sample in range(0, 100):
|
||||||
|
readback1 = sample #the x axis.
|
||||||
|
sleep(0.1) # settling time.
|
||||||
|
# get value (it is translated to a caget):
|
||||||
|
motor_msta = motor_msta + +1
|
||||||
|
if motor_msta > 50:
|
||||||
|
motor_msta = 0
|
||||||
|
# get value:
|
||||||
|
motor_val = sin(float(sample)/10.0)*10.0-10.0
|
||||||
|
# add values to plot:
|
||||||
|
scan.append([readback1], [readback1], [motor_msta, motor_val])
|
||||||
|
|
||||||
|
# now try with data from real device: this part will most probably fail: correct the PV names with existing ones.
|
||||||
|
try:
|
||||||
|
# set up connection to channels. "type" of data can be "d" (= double), "l" (= long).
|
||||||
|
pv_motor_msta = Channel(test.getDeviceName() + ':IST:2' , type='d')
|
||||||
|
pv_motor_val = Channel(test.getDeviceName() + ':IST:1' , type='d')
|
||||||
|
pv_motor_com = Channel(test.getDeviceName() + ':COM:2' , type='d')
|
||||||
|
except:
|
||||||
|
import traceback
|
||||||
|
# prepare return information: return text:
|
||||||
|
ret = 'Unable to create channel - ' + traceback.format_exc()
|
||||||
|
# prepare return information: return success:
|
||||||
|
success = False
|
||||||
|
# send return information:
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
return
|
||||||
|
# send a command to a channel (it is translated to a caput): uncomment this line below to try it
|
||||||
|
#pv_motor_com.put(1.0, timeout=None) # optionally, a timeout can be given.
|
||||||
|
# take 100 samples of the channels and plot them:
|
||||||
|
for sample in range(0, 100):
|
||||||
|
readback1 = sample #the x axis.
|
||||||
|
sleep(0.1) # settling time.
|
||||||
|
# get value (it is translated to a caget):
|
||||||
|
motor_msta = pv_motor_msta.get()
|
||||||
|
# get value:
|
||||||
|
motor_val = pv_motor_val.get()
|
||||||
|
# add values to plot:
|
||||||
|
scan.append([readback1], [readback1], [motor_msta, motor_val])
|
||||||
|
|
||||||
|
# Closing channels: all channels that were opened with Channel() must be closed before exit:
|
||||||
|
pv_motor_msta.close()
|
||||||
|
pv_motor_val.close()
|
||||||
|
pv_motor_com.close()
|
||||||
|
|
||||||
|
# IMPORTANT: if the test was successful, write the report into the variables ret and success.
|
||||||
|
# for example, write the following:
|
||||||
|
ret = "Example - Test successful, here some detail: ..."
|
||||||
|
success = True
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
# once the test is finished, no need to do anything. The code below yours will do the rest.
|
||||||
|
################ End of Example ##########
|
||||||
|
|
||||||
|
################ END OF YOUR CODE ################
|
||||||
|
###### Final - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
|
||||||
|
# just in case the feedback was forgotten.
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
except (KeyboardInterrupt):
|
||||||
|
# user stop error handler.
|
||||||
|
import traceback
|
||||||
|
ret = 'Test stopped by user.'
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
except:
|
||||||
|
# generic error handler.
|
||||||
|
import traceback
|
||||||
|
ret = traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
|
||||||
|
|
||||||
|
# launch the test.
|
||||||
|
startTest(test, device, parameters)
|
||||||
|
|
||||||
|
################ END OF Final ####################
|
||||||
|
#### IF NEEDED, ADD YOUR FUNCTIONS HERE BELOW ####
|
||||||
|
# Indent to end left
|
||||||
|
# def yourCustomFunction:
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#Tue Mar 20 13:50:48 CET 2018
|
||||||
|
name=oldtest2
|
||||||
|
parameters=examplePar1\:2\:This is the parameter n.1 with unit [unit];examplePar2\:4.5\:This is the parameter n.2 with unit [unit];
|
||||||
|
description=o
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<html>
|
||||||
|
<!-- Copyright (c) 2015 Paul Scherrer Institute. All rights reserved. -->
|
||||||
|
<body>
|
||||||
|
<h2>Description</h2>
|
||||||
|
o
|
||||||
|
<h2>Parameters</h2>
|
||||||
|
<table>
|
||||||
|
<tr><td><code>examplePar1 </code></td><td>This is the parameter n.1 with unit [unit]</td></tr>
|
||||||
|
<tr><td><code>examplePar2 </code></td><td>This is the parameter n.2 with unit [unit]</td></tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
<h2>Contact</h2>
|
||||||
|
<a href="https://intranet.psi.ch/search/#?t=phonebook&q=boccioli_m">Marco Boccioli</a> <br/>
|
||||||
|
Tel. 3078
|
||||||
|
</html>
|
||||||
|
</body>
|
||||||
|
|
||||||
@@ -0,0 +1,174 @@
|
|||||||
|
# Test name: oldtest2
|
||||||
|
# o
|
||||||
|
# Copyright (c) 2015 Paul Scherrer Institute. All rights reserved.
|
||||||
|
|
||||||
|
###### Init - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
global sys, inspect, os, traceback
|
||||||
|
import sys, inspect, os, traceback
|
||||||
|
|
||||||
|
|
||||||
|
def startTest(testName, DEVICE, params):
|
||||||
|
"""
|
||||||
|
Main method running the test
|
||||||
|
"""
|
||||||
|
# by default, assume the test failed:
|
||||||
|
ret = 'Test failed'
|
||||||
|
status = False
|
||||||
|
# put the whole custom code under try/catch.
|
||||||
|
try:
|
||||||
|
# get the path of this script:
|
||||||
|
testPath = inspect.getfile(inspect.currentframe())
|
||||||
|
# init the testing tool class:
|
||||||
|
test = TestingTool(testName, testPath, DEVICE, params)
|
||||||
|
|
||||||
|
################ END OF Init #####################
|
||||||
|
######### WRITE YOUR CODE HERE BELOW #############
|
||||||
|
|
||||||
|
"""
|
||||||
|
All the code in this section # WRITE YOUR CODE HERE BELOW # is just an example and can be modified/deleted.
|
||||||
|
It must be indented to the same level as this comment.
|
||||||
|
-----------------------------------
|
||||||
|
GETTING INPUTS:
|
||||||
|
-----------------------------------
|
||||||
|
If needed, the following methods are available:
|
||||||
|
|
||||||
|
test.getPath() string, path of this test file
|
||||||
|
test.getName() string, name of this test
|
||||||
|
test.getDeviceName() string, device for which the test must run (typically it is the beginning of a process variable name)
|
||||||
|
test.getPlotName() string, name to be given to the plot when using setPlotTitle(). Example: scan.setPlotTitle(test.getPlotName())
|
||||||
|
-----------------------------------
|
||||||
|
GETTING TEST PARAMETERS:
|
||||||
|
-----------------------------------
|
||||||
|
if you need to get parameters for the test, use:
|
||||||
|
|
||||||
|
myParamValue = test.getParam('myParamName')
|
||||||
|
|
||||||
|
the calls to getParam are added to the code automatically, one per parameter, when creating the new test.
|
||||||
|
NOTE: Casting may be necessary.
|
||||||
|
See the test config for the list of parameters specific to the test.
|
||||||
|
-----------------------------------
|
||||||
|
SETTING OUTPUTS:
|
||||||
|
-----------------------------------
|
||||||
|
When the test has ended (error or success), this method must be called in order to return to pshell:
|
||||||
|
|
||||||
|
test.sendFeedback(ret,success)
|
||||||
|
|
||||||
|
ret string, a text summarizing the result of the test.
|
||||||
|
success bool, True = test successful. False = test failed.
|
||||||
|
-----------------------------------
|
||||||
|
LOG INFO:
|
||||||
|
-----------------------------------
|
||||||
|
when some information must be shown on the log on pshell, use the following line:
|
||||||
|
test.log('text to log')
|
||||||
|
"""
|
||||||
|
|
||||||
|
########## Example (can be removed) ######
|
||||||
|
|
||||||
|
# print the list of parameters passed. If any error, stop and send feedback.
|
||||||
|
test.log("Example - Test name: " + test.getName())
|
||||||
|
test.log("Example - Device name: " + test.getDeviceName() )
|
||||||
|
try:
|
||||||
|
test.log("Running test with the following parameters:")
|
||||||
|
test.printParams()
|
||||||
|
# If present, use the parameters here below for your test script.
|
||||||
|
# These parameters were automatically generated: you might need to change the casting.
|
||||||
|
examplePar1 = float(test.getParam('examplePar1')) ; examplePar2 = float(test.getParam('examplePar2')) ;
|
||||||
|
except:
|
||||||
|
import traceback
|
||||||
|
# test failed, write the report into the variables ret and success and send feedback:
|
||||||
|
ret = 'Could not retrieve testing parameters - ' + traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
return
|
||||||
|
|
||||||
|
# loop to read channels for a while and plot the channels values.
|
||||||
|
# initialise plot tab with 2 plots: pass here the axis names:
|
||||||
|
scan = ManualScan(['sample'], ['Status (MSTA)', 'Position (VAL)'])
|
||||||
|
# set plot name(tab title):
|
||||||
|
scan.setPlotTitle(test.getPlotName())
|
||||||
|
# start plots. See further below how to add points to the plots (scan):
|
||||||
|
scan.start()
|
||||||
|
|
||||||
|
# inject a sinus into the plot, as example
|
||||||
|
from math import sin
|
||||||
|
motor_msta = 0
|
||||||
|
# take 100 samples of a sinus and a jigsaw plot them:
|
||||||
|
for sample in range(0, 100):
|
||||||
|
readback1 = sample #the x axis.
|
||||||
|
sleep(0.1) # settling time.
|
||||||
|
# get value (it is translated to a caget):
|
||||||
|
motor_msta = motor_msta + +1
|
||||||
|
if motor_msta > 50:
|
||||||
|
motor_msta = 0
|
||||||
|
# get value:
|
||||||
|
motor_val = sin(float(sample)/10.0)*10.0-10.0
|
||||||
|
# add values to plot:
|
||||||
|
scan.append([readback1], [readback1], [motor_msta, motor_val])
|
||||||
|
|
||||||
|
# now try with data from real device: this part will most probably fail: correct the PV names with existing ones.
|
||||||
|
try:
|
||||||
|
# set up connection to channels. "type" of data can be "d" (= double), "l" (= long).
|
||||||
|
pv_motor_msta = Channel(test.getDeviceName() + ':IST:2' , type='d')
|
||||||
|
pv_motor_val = Channel(test.getDeviceName() + ':IST:1' , type='d')
|
||||||
|
pv_motor_com = Channel(test.getDeviceName() + ':COM:2' , type='d')
|
||||||
|
except:
|
||||||
|
import traceback
|
||||||
|
# prepare return information: return text:
|
||||||
|
ret = 'Unable to create channel - ' + traceback.format_exc()
|
||||||
|
# prepare return information: return success:
|
||||||
|
success = False
|
||||||
|
# send return information:
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
return
|
||||||
|
# send a command to a channel (it is translated to a caput): uncomment this line below to try it
|
||||||
|
#pv_motor_com.put(1.0, timeout=None) # optionally, a timeout can be given.
|
||||||
|
# take 100 samples of the channels and plot them:
|
||||||
|
for sample in range(0, 100):
|
||||||
|
readback1 = sample #the x axis.
|
||||||
|
sleep(0.1) # settling time.
|
||||||
|
# get value (it is translated to a caget):
|
||||||
|
motor_msta = pv_motor_msta.get()
|
||||||
|
# get value:
|
||||||
|
motor_val = pv_motor_val.get()
|
||||||
|
# add values to plot:
|
||||||
|
scan.append([readback1], [readback1], [motor_msta, motor_val])
|
||||||
|
|
||||||
|
# Closing channels: all channels that were opened with Channel() must be closed before exit:
|
||||||
|
pv_motor_msta.close()
|
||||||
|
pv_motor_val.close()
|
||||||
|
pv_motor_com.close()
|
||||||
|
|
||||||
|
# IMPORTANT: if the test was successful, write the report into the variables ret and success.
|
||||||
|
# for example, write the following:
|
||||||
|
ret = "Example - Test successful, here some detail: ..."
|
||||||
|
success = True
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
# once the test is finished, no need to do anything. The code below yours will do the rest.
|
||||||
|
################ End of Example ##########
|
||||||
|
|
||||||
|
################ END OF YOUR CODE ################
|
||||||
|
###### Final - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
|
||||||
|
# just in case the feedback was forgotten.
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
except (KeyboardInterrupt):
|
||||||
|
# user stop error handler.
|
||||||
|
import traceback
|
||||||
|
ret = 'Test stopped by user.'
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
except:
|
||||||
|
# generic error handler.
|
||||||
|
import traceback
|
||||||
|
ret = traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
|
||||||
|
|
||||||
|
# launch the test.
|
||||||
|
startTest(test, device, parameters)
|
||||||
|
|
||||||
|
################ END OF Final ####################
|
||||||
|
#### IF NEEDED, ADD YOUR FUNCTIONS HERE BELOW ####
|
||||||
|
# Indent to end left
|
||||||
|
# def yourCustomFunction:
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
#Mon Oct 16 14:28:18 CEST 2017
|
||||||
|
name=Betriebsmode
|
||||||
|
description=Verify that the different RPS Modes give correct Outputs on the RPS modules
|
||||||
|
parameters=mode&"2,IQCOM,$BMA1,1,DIA"&"vla";rpsCh14&"J102003:REG:R:3"&"rps channel 1-4";rpsCh58&"J102003:REG:R:34"&"rps channel 5-8";expectedVal14&"0x0000"&"[hex] Expected value for channels 1-4";expectedVal58&"0x0000"&"[hex] Expected value for channels 5-8";setGetDelay&"1"&"[s] delay between set and get";
|
||||||
+171
@@ -0,0 +1,171 @@
|
|||||||
|
# Test name: Betriebsmode (old caRPSTest test #1)
|
||||||
|
# betriebsmode
|
||||||
|
# Copyright (c) 2015 Paul Scherrer Institute. All rights reserved.
|
||||||
|
|
||||||
|
###### Init - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
global sys, inspect, os, traceback
|
||||||
|
import sys, inspect, os, traceback
|
||||||
|
|
||||||
|
|
||||||
|
def startTest(testName, DEVICE, params):
|
||||||
|
"""
|
||||||
|
Main method running the test
|
||||||
|
"""
|
||||||
|
# by default, assume the test failed:
|
||||||
|
ret = 'Test failed'
|
||||||
|
status = False
|
||||||
|
# put the whole custom code under try/catch.
|
||||||
|
try:
|
||||||
|
# get the path of this script:
|
||||||
|
testPath = inspect.getfile(inspect.currentframe())
|
||||||
|
# init the testing tool class:
|
||||||
|
test = TestingTool(testName, testPath, DEVICE, params)
|
||||||
|
|
||||||
|
################ END OF Init #####################
|
||||||
|
######### WRITE YOUR CODE HERE BELOW #############
|
||||||
|
|
||||||
|
"""
|
||||||
|
All the code in this section # WRITE YOUR CODE HERE BELOW # is just an example and can be modified/deleted.
|
||||||
|
It must be indented to the same level as this comment.
|
||||||
|
-----------------------------------
|
||||||
|
GETTING INPUTS:
|
||||||
|
-----------------------------------
|
||||||
|
If needed, the following methods are available:
|
||||||
|
|
||||||
|
test.getPath() string, path of this test file
|
||||||
|
test.getName() string, name of this test
|
||||||
|
test.getDeviceName() string, device for which the test must run (typically it is the beginning of a process variable name)
|
||||||
|
test.getPlotName() string, name to be given to the plot when using setPlotTitle(). Example: scan.setPlotTitle(test.getPlotName())
|
||||||
|
-----------------------------------
|
||||||
|
GETTING TEST PARAMETERS:
|
||||||
|
-----------------------------------
|
||||||
|
if you need to get parameters for the test, use:
|
||||||
|
|
||||||
|
myParamValue = test.getParam('myParamName')
|
||||||
|
|
||||||
|
the calls to getParam are added to the code automatically, one per parameter, when creating the new test.
|
||||||
|
NOTE: Casting may be necessary.
|
||||||
|
See the test config for the list of parameters specific to the test.
|
||||||
|
-----------------------------------
|
||||||
|
SETTING OUTPUTS:
|
||||||
|
-----------------------------------
|
||||||
|
When the test has ended (error or success), this method must be called in order to return to pshell:
|
||||||
|
|
||||||
|
test.sendFeedback(ret,success)
|
||||||
|
|
||||||
|
ret string, a text summarizing the result of the test.
|
||||||
|
success bool, True = test successful. False = test failed.
|
||||||
|
-----------------------------------
|
||||||
|
LOG INFO:
|
||||||
|
-----------------------------------
|
||||||
|
when some information must be shown on the log on pshell, use the following line:
|
||||||
|
test.log('text to log')
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
# print the list of parameters passed. If any error, stop and send feedback.
|
||||||
|
test.log("Test " + test.getName() + " for " + test.getDeviceName() )
|
||||||
|
try:
|
||||||
|
test.log("Running test with the following parameters:")
|
||||||
|
test.printParams()
|
||||||
|
# fetch paramenters
|
||||||
|
rpsChName14 = (test.getParam('rpsCh14'))
|
||||||
|
rpsChName58 = (test.getParam('rpsCh58'))
|
||||||
|
expectedVal14 = (test.getParam('expectedVal14'))
|
||||||
|
expectedVal58 = (test.getParam('expectedVal58'))
|
||||||
|
mode = (test.getParam('mode'))
|
||||||
|
setGetDelay = float(test.getParam('setGetDelay')) ;
|
||||||
|
except:
|
||||||
|
import traceback
|
||||||
|
# test failed, write the report into the variables ret and success and send feedback:
|
||||||
|
ret = 'Could not retrieve testing parameters - ' + traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
return
|
||||||
|
|
||||||
|
# now try with data from real device: this part will most probably fail: correct the PV names with existing ones.
|
||||||
|
rpsMask14 = 0x4440 # mask for outputs 2-4
|
||||||
|
rpsMask58 = 0x0004 # mask for output 5
|
||||||
|
ilk = Interlock()
|
||||||
|
ilk.setInterlockMode(mode)
|
||||||
|
sleep(setGetDelay)
|
||||||
|
ilk.masterReset()
|
||||||
|
sleep(setGetDelay)
|
||||||
|
modeRead = ilk.getInterlockMode();
|
||||||
|
if not modeRead:
|
||||||
|
ret = 'No mode received'
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
return
|
||||||
|
try:
|
||||||
|
modePresent = modeRead.index(mode)
|
||||||
|
except:
|
||||||
|
modePresent = -1
|
||||||
|
ret = 'Could not set mode ' + mode
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
return
|
||||||
|
try:
|
||||||
|
# set up connection to channels. "type" of data can be "d" (= double), "l" (= long).
|
||||||
|
# outputs 1-4
|
||||||
|
rpsCh14 = Channel(rpsChName14, type='d')
|
||||||
|
# outputs 5-8
|
||||||
|
rpsCh58 = Channel(rpsChName58, type='d')
|
||||||
|
|
||||||
|
rpsVal14 = rpsCh14.get()
|
||||||
|
rpsVal58 = rpsCh58.get()
|
||||||
|
|
||||||
|
success = True
|
||||||
|
if ((rpsVal14 & rpsMask14) == expectedVal14):
|
||||||
|
ret = 'Interlocks outputs (1-4) of ' + rpsChName14 + ': ' + rpsVal14 + ' as expected'
|
||||||
|
else:
|
||||||
|
ret = 'Interlocks outputs (1-4) of ' + rpsChName14 + ': ' + rpsVal14 + ' was expected: ' + expectedVal14
|
||||||
|
success = False
|
||||||
|
|
||||||
|
if ((rpsVal58 & rpsMask58) == expectedVal58):
|
||||||
|
ret = ret + '\nInterlocks outputs (5-8) of ' + rpsChName58 + ': ' + rpsVal58 + ' as expected'
|
||||||
|
else:
|
||||||
|
ret = ret + '\nInterlocks outputs (5-8) of ' + rpsChName58 + ': ' + rpsVal58 + ' was expected: ' + expectedVal58
|
||||||
|
success = False
|
||||||
|
except:
|
||||||
|
import traceback
|
||||||
|
# prepare return information: return text:
|
||||||
|
ret = 'Unable to connect to channel - ' + traceback.format_exc()
|
||||||
|
# prepare return information: return success:
|
||||||
|
success = False
|
||||||
|
# send return information:
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
return
|
||||||
|
|
||||||
|
# Closing channels: all channels that were opened with Channel() must be closed before exit:
|
||||||
|
rpsCh14.close()
|
||||||
|
rpsCh58.close()
|
||||||
|
|
||||||
|
# once the test is finished, no need to do anything. The code below yours will do the rest.
|
||||||
|
|
||||||
|
################ END OF YOUR CODE ################
|
||||||
|
###### Final - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
|
||||||
|
# just in case the feedback was forgotten.
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
except (KeyboardInterrupt):
|
||||||
|
# user stop error handler.
|
||||||
|
import traceback
|
||||||
|
ret = 'Test stopped by user.'
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
except:
|
||||||
|
# generic error handler.
|
||||||
|
import traceback
|
||||||
|
ret = traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
|
||||||
|
|
||||||
|
# launch the test.
|
||||||
|
startTest(test, device, parameters)
|
||||||
|
|
||||||
|
################ END OF Final ####################
|
||||||
|
#### IF NEEDED, ADD YOUR FUNCTIONS HERE BELOW ####
|
||||||
|
# Indent to end left
|
||||||
|
# def yourCustomFunction:
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
<html>
|
||||||
|
<!-- Copyright (c) 2015 Paul Scherrer Institute. All rights reserved. -->
|
||||||
|
<body>
|
||||||
|
<h2>Description</h2>
|
||||||
|
Verify that the different RPS Modes give correct Outputs on the RPS modules (Test n. 1 in old caRPS_Tests)
|
||||||
|
<h2>Parameters</h2>
|
||||||
|
<table>
|
||||||
|
<tr><td><code>mode </code></td><td>[string] Betriebs mode</td></tr>
|
||||||
|
<tr><td><code>expectedVal14 </code></td><td>[hex] Expected value for channels 1-4</td></tr>
|
||||||
|
<tr><td><code>expectedVal58 </code></td><td>[hex] Expected value for channels 5-8</td></tr>
|
||||||
|
<tr><td><code>setGetDelay </code></td><td>[ms] delay between set and get</td></tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
<h2>Contact</h2>
|
||||||
|
<a href="https://intranet.psi.ch/search/#?t=phonebook&q=boccioli_m">Marco Boccioli</a> <br/>
|
||||||
|
Tel. 3078
|
||||||
|
</html>
|
||||||
|
</body>
|
||||||
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#Fri Oct 20 13:31:23 CEST 2017
|
||||||
|
name=Diagnostic
|
||||||
|
parameters=setGetDelay&"1"&"[s] delay between set and get";
|
||||||
|
description=Test interlocks of diagnostic modules by generating a pulse
|
||||||
+143
@@ -0,0 +1,143 @@
|
|||||||
|
# Test name: Diagnostic
|
||||||
|
# Test interlocks of diagnostic modules by generating a pulse
|
||||||
|
# Copyright (c) 2015 Paul Scherrer Institute. All rights reserved.
|
||||||
|
|
||||||
|
###### Init - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
global sys, inspect, os, traceback
|
||||||
|
import sys, inspect, os, traceback
|
||||||
|
|
||||||
|
|
||||||
|
def startTest(testName, DEVICE, params):
|
||||||
|
"""
|
||||||
|
Main method running the test
|
||||||
|
"""
|
||||||
|
# by default, assume the test failed:
|
||||||
|
ret = 'Test failed'
|
||||||
|
status = False
|
||||||
|
# put the whole custom code under try/catch.
|
||||||
|
try:
|
||||||
|
# get the path of this script:
|
||||||
|
testPath = inspect.getfile(inspect.currentframe())
|
||||||
|
# init the testing tool class:
|
||||||
|
test = TestingTool(testName, testPath, DEVICE, params)
|
||||||
|
|
||||||
|
################ END OF Init #####################
|
||||||
|
######### WRITE YOUR CODE HERE BELOW #############
|
||||||
|
|
||||||
|
"""
|
||||||
|
All the code in this section # WRITE YOUR CODE HERE BELOW # is just an example and can be modified/deleted.
|
||||||
|
It must be indented to the same level as this comment.
|
||||||
|
-----------------------------------
|
||||||
|
GETTING INPUTS:
|
||||||
|
-----------------------------------
|
||||||
|
If needed, the following methods are available:
|
||||||
|
|
||||||
|
test.getPath() string, path of this test file
|
||||||
|
test.getName() string, name of this test
|
||||||
|
test.getDeviceName() string, device for which the test must run (typically it is the beginning of a process variable name)
|
||||||
|
test.getPlotName() string, name to be given to the plot when using setPlotTitle(). Example: scan.setPlotTitle(test.getPlotName())
|
||||||
|
-----------------------------------
|
||||||
|
GETTING TEST PARAMETERS:
|
||||||
|
-----------------------------------
|
||||||
|
if you need to get parameters for the test, use:
|
||||||
|
|
||||||
|
myParamValue = test.getParam('myParamName')
|
||||||
|
|
||||||
|
the calls to getParam are added to the code automatically, one per parameter, when creating the new test.
|
||||||
|
NOTE: Casting may be necessary.
|
||||||
|
See the test config for the list of parameters specific to the test.
|
||||||
|
-----------------------------------
|
||||||
|
SETTING OUTPUTS:
|
||||||
|
-----------------------------------
|
||||||
|
When the test has ended (error or success), this method must be called in order to return to pshell:
|
||||||
|
|
||||||
|
test.sendFeedback(ret,success)
|
||||||
|
|
||||||
|
ret string, a text summarizing the result of the test.
|
||||||
|
success bool, True = test successful. False = test failed.
|
||||||
|
-----------------------------------
|
||||||
|
LOG INFO:
|
||||||
|
-----------------------------------
|
||||||
|
when some information must be shown on the log on pshell, use the following line:
|
||||||
|
test.log('text to log')
|
||||||
|
"""
|
||||||
|
|
||||||
|
########## Example (can be removed) ######
|
||||||
|
|
||||||
|
# print the list of parameters passed. If any error, stop and send feedback.
|
||||||
|
test.log("Example - Test name: " + test.getName())
|
||||||
|
test.log("Example - Device name: " + test.getDeviceName() )
|
||||||
|
try:
|
||||||
|
test.log("Running test with the following parameters:")
|
||||||
|
test.printParams()
|
||||||
|
# If present, use the parameters here below for your test script.
|
||||||
|
# These parameters were automatically generated: you might need to change the casting.
|
||||||
|
setGetDelay = float(test.getParam('setGetDelay'))
|
||||||
|
rpsAttribute = test.getParam('rpsAttribute')
|
||||||
|
rpsModule = test.getParam('rpsModule')
|
||||||
|
expectedValue2 = test.getParam('expectedValue2')
|
||||||
|
expectedValue1 = test.getParam('expectedValue1')
|
||||||
|
except:
|
||||||
|
import traceback
|
||||||
|
# test failed, write the report into the variables ret and success and send feedback:
|
||||||
|
ret = 'Could not retrieve testing parameters - ' + traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
return
|
||||||
|
|
||||||
|
# now try with data from real device: this part will most probably fail: correct the PV names with existing ones.
|
||||||
|
try:
|
||||||
|
# set up connection to channels. "type" of data can be "d" (= double), "l" (= long).
|
||||||
|
#rpsCh = Channel(test.getDeviceName() + ':' + rpsAttribute , type='d')
|
||||||
|
test.log('doing nothing here...')
|
||||||
|
except:
|
||||||
|
import traceback
|
||||||
|
# prepare return information: return text:
|
||||||
|
ret = 'Unable to create channel - ' + traceback.format_exc()
|
||||||
|
# prepare return information: return success:
|
||||||
|
success = False
|
||||||
|
# send return information:
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
return
|
||||||
|
# send a command to a channel (it is translated to a caput): uncomment this line below to try it
|
||||||
|
#pv_motor_com.put(1.0, timeout=None) # optionally, a timeout can be given.
|
||||||
|
# take 100 samples of the channels and plot them:
|
||||||
|
# get value (it is translated to a caget):
|
||||||
|
# motor_msta = pv_motor_msta.get()
|
||||||
|
|
||||||
|
# Closing channels: all channels that were opened with Channel() must be closed before exit:
|
||||||
|
#rpsCh.close()
|
||||||
|
|
||||||
|
# IMPORTANT: if the test was successful, write the report into the variables ret and success.
|
||||||
|
# for example, write the following:
|
||||||
|
ret = "Success, nothing was done :-)"
|
||||||
|
success = True
|
||||||
|
# once the test is finished, no need to do anything. The code below yours will do the rest.
|
||||||
|
################ End of Example ##########
|
||||||
|
|
||||||
|
################ END OF YOUR CODE ################
|
||||||
|
###### Final - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
|
||||||
|
# just in case the feedback was forgotten.
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
except (KeyboardInterrupt):
|
||||||
|
# user stop error handler.
|
||||||
|
import traceback
|
||||||
|
ret = 'Test stopped by user.'
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
except:
|
||||||
|
# generic error handler.
|
||||||
|
import traceback
|
||||||
|
ret = traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
|
||||||
|
|
||||||
|
# launch the test.
|
||||||
|
startTest(test, device, parameters)
|
||||||
|
|
||||||
|
################ END OF Final ####################
|
||||||
|
#### IF NEEDED, ADD YOUR FUNCTIONS HERE BELOW ####
|
||||||
|
# Indent to end left
|
||||||
|
# def yourCustomFunction:
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
<html>
|
||||||
|
<!-- Copyright (c) 2015 Paul Scherrer Institute. All rights reserved. -->
|
||||||
|
<body>
|
||||||
|
<h2>Description</h2>
|
||||||
|
Test interlocks of diagnostic modules by generating a pulse (Test n. 5 in old caRPS_Tests)
|
||||||
|
<h2>Parameters</h2>
|
||||||
|
<table>
|
||||||
|
<tr><td><code>setGetDelay </code></td><td>[s] delay between set and get</td></tr>
|
||||||
|
<tr><td><code>rpsAttribute</code></td><td>RPS EPICS attribute</td></tr>
|
||||||
|
<tr><td><code>rpsModule</code></td><td>RPS module EPICS channel name</td></tr>
|
||||||
|
<tr><td><code>expectedValue2</code></td><td>[hex] expected value 2</td></tr>
|
||||||
|
<tr><td><code>expectedValue1</code></td><td>[hex] expected value 1</td></tr>
|
||||||
|
</table>
|
||||||
|
<h2>Contact</h2>
|
||||||
|
<a href="https://intranet.psi.ch/search/#?t=phonebook&q=boccioli_m">Marco Boccioli</a> <br/>
|
||||||
|
Tel. 3078
|
||||||
|
</html>
|
||||||
|
</body>
|
||||||
|
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
#Wed Oct 18 14:59:58 CEST 2017
|
||||||
|
name=RPSlimits
|
||||||
|
parameters=
|
||||||
|
description=Verify that for different modes, the RPS behaves correctly when scanning the current settings of the Ablenkungsmagnet
|
||||||
+191
@@ -0,0 +1,191 @@
|
|||||||
|
# Test name: Interlocklimits
|
||||||
|
# Interlock Limits for Ablenksmagnet
|
||||||
|
# Copyright (c) 2015 Paul Scherrer Institute. All rights reserved.
|
||||||
|
|
||||||
|
###### Init - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
global sys, inspect, os, traceback
|
||||||
|
import sys, inspect, os, traceback
|
||||||
|
|
||||||
|
|
||||||
|
def startTest(testName, DEVICE, params):
|
||||||
|
"""
|
||||||
|
Main method running the test
|
||||||
|
"""
|
||||||
|
# by default, assume the test failed:
|
||||||
|
ret = 'Test failed'
|
||||||
|
status = False
|
||||||
|
# put the whole custom code under try/catch.
|
||||||
|
try:
|
||||||
|
# get the path of this script:
|
||||||
|
testPath = inspect.getfile(inspect.currentframe())
|
||||||
|
# init the testing tool class:
|
||||||
|
test = TestingTool(testName, testPath, DEVICE, params)
|
||||||
|
|
||||||
|
################ END OF Init #####################
|
||||||
|
######### WRITE YOUR CODE HERE BELOW #############
|
||||||
|
|
||||||
|
"""
|
||||||
|
All the code in this section # WRITE YOUR CODE HERE BELOW # is just an example and can be modified/deleted.
|
||||||
|
It must be indented to the same level as this comment.
|
||||||
|
-----------------------------------
|
||||||
|
GETTING INPUTS:
|
||||||
|
-----------------------------------
|
||||||
|
If needed, the following methods are available:
|
||||||
|
|
||||||
|
test.getPath() string, path of this test file
|
||||||
|
test.getName() string, name of this test
|
||||||
|
test.getDeviceName() string, device for which the test must run (typically it is the beginning of a process variable name)
|
||||||
|
test.getPlotName() string, name to be given to the plot when using setPlotTitle(). Example: scan.setPlotTitle(test.getPlotName())
|
||||||
|
-----------------------------------
|
||||||
|
GETTING TEST PARAMETERS:
|
||||||
|
-----------------------------------
|
||||||
|
if you need to get parameters for the test, use:
|
||||||
|
|
||||||
|
myParamValue = test.getParam('myParamName')
|
||||||
|
|
||||||
|
the calls to getParam are added to the code automatically, one per parameter, when creating the new test.
|
||||||
|
NOTE: Casting may be necessary.
|
||||||
|
See the test config for the list of parameters specific to the test.
|
||||||
|
-----------------------------------
|
||||||
|
SETTING OUTPUTS:
|
||||||
|
-----------------------------------
|
||||||
|
When the test has ended (error or success), this method must be called in order to return to pshell:
|
||||||
|
|
||||||
|
test.sendFeedback(ret,success)
|
||||||
|
|
||||||
|
ret string, a text summarizing the result of the test.
|
||||||
|
success bool, True = test successful. False = test failed.
|
||||||
|
-----------------------------------
|
||||||
|
LOG INFO:
|
||||||
|
-----------------------------------
|
||||||
|
when some information must be shown on the log on pshell, use the following line:
|
||||||
|
test.log('text to log')
|
||||||
|
"""
|
||||||
|
|
||||||
|
########## Example (can be removed) ######
|
||||||
|
|
||||||
|
# print the list of parameters passed. If any error, stop and send feedback.
|
||||||
|
test.log("Test " + test.getName() + " for " + test.getDeviceName() )
|
||||||
|
try:
|
||||||
|
test.log("Running test with the following parameters:")
|
||||||
|
test.printParams()
|
||||||
|
ret = 'Success, nothing was done :-)'
|
||||||
|
success = True
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
return
|
||||||
|
# fetch parameters
|
||||||
|
mode = (test.getParam('mode'))
|
||||||
|
ilkInExpectedValS = (test.getParam('ilkInExpectedValS'))
|
||||||
|
magnetChName = (test.getParam('magnetCh'))
|
||||||
|
ilkInChName = (test.getParam('ilkInCh'))
|
||||||
|
ilkInExpectedValIni = (test.getParam('ilkInExpectedValIni'))
|
||||||
|
ilkOutExpectedValL = (test.getParam('ilkOutExpectedValL'))
|
||||||
|
magnetEndVal = int(test.getParam('magnetEndVal'))
|
||||||
|
ilkOutChName = (test.getParam('ilkOutCh'))
|
||||||
|
ilkOutExpectedValIni = (test.getParam('ilkOutExpectedValIni'))
|
||||||
|
ilkOutExpectedValS = (test.getParam('ilkOutExpectedValS'))
|
||||||
|
magnetInitVal = int(test.getParam('magnetInitVal'))
|
||||||
|
setGetDelay = float(test.getParam('setGetDelay'))
|
||||||
|
except:
|
||||||
|
import traceback
|
||||||
|
# test failed, write the report into the variables ret and success and send feedback:
|
||||||
|
ret = 'Could not retrieve testing parameters - ' + traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
return
|
||||||
|
|
||||||
|
rpsMask14 = 0x4440 # mask for outputs 2-4
|
||||||
|
rpsMask58 = 0x0004 # mask for output 5
|
||||||
|
ilk = Interlock()
|
||||||
|
ilk.setInterlockMode(mode)
|
||||||
|
sleep(setGetDelay)
|
||||||
|
ilk.masterReset()
|
||||||
|
# loop to read channels for a while and plot the channels values.
|
||||||
|
# initialise plot tab with 3 plots:
|
||||||
|
scan = ManualScan(['units'], ['Magnet', 'Interlock-In', 'Interlock-Out'])
|
||||||
|
# set plot name(tab title):
|
||||||
|
scan.setPlotTitle(test.getPlotName())
|
||||||
|
# start plots. See further below how to add points to the plots (scan):
|
||||||
|
scan.start()
|
||||||
|
# now try with data from real device: this part will most probably fail: correct the PV names with existing ones.
|
||||||
|
try:
|
||||||
|
# set up connection to channels. "type" of data can be "d" (= double), "l" (= long).
|
||||||
|
#magnetCh = Channel(magnetChName , type='d')
|
||||||
|
#ilkInCh = Channel(ilkInChName , type='d')
|
||||||
|
#ilkOutCh = Channel(ilkOutChName , type='d')
|
||||||
|
print magnetChName
|
||||||
|
except:
|
||||||
|
import traceback
|
||||||
|
# prepare return information: return text:
|
||||||
|
ret = 'Unable to create channel - ' + traceback.format_exc()
|
||||||
|
# prepare return information: return success:
|
||||||
|
success = False
|
||||||
|
# send return information:
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
return
|
||||||
|
# check RPS status
|
||||||
|
#ilkInVal = ilkInCh.get()
|
||||||
|
#ilkOutVal = ilkOutCh.get()
|
||||||
|
ilkInVal = ilkInExpectedValIni #delete!!
|
||||||
|
ilkOutVal = ilkOutExpectedValIni #delete!!
|
||||||
|
if (ilkInVal == ilkInExpectedValIni):
|
||||||
|
test.log(ilkInChName + ' ok')
|
||||||
|
else:
|
||||||
|
ret = ilkInChName + ' wrong - expected: ' + ilkInExpectedValIni + ' got: ' + ilkInVal
|
||||||
|
success = False
|
||||||
|
return
|
||||||
|
if ((ilkOutVal & 0x000C) == ilkOutExpectedValIni):
|
||||||
|
test.log(ilkOutChName + ' ok')
|
||||||
|
else:
|
||||||
|
ret = ilkOutChName + ' wrong - expected: ' + ilkOutExpectedValIni + ' got: ' + (ilkOutVal & 0x000C)
|
||||||
|
success = False
|
||||||
|
return
|
||||||
|
|
||||||
|
# start scan of magnet
|
||||||
|
# inject a sinus into the plot, as example
|
||||||
|
from math import sin
|
||||||
|
for sample in range(magnetInitVal, magnetEndVal, 10):
|
||||||
|
readback1 = sample #the x axis.
|
||||||
|
sleep(0.01) # settling time.
|
||||||
|
# get value (it is translated to a caget):
|
||||||
|
magnetVal = sample
|
||||||
|
# get value:
|
||||||
|
ilkInVal = sin(float(sample)/10.0)*10.0-10.0
|
||||||
|
ilkOutVal = ilkInVal*0.5+10
|
||||||
|
# add values to plot:
|
||||||
|
scan.append([readback1], [readback1], [magnetVal, ilkInVal, ilkOutVal])
|
||||||
|
|
||||||
|
#magnetCh.close()
|
||||||
|
#ilkInCh.close()
|
||||||
|
#ilkOutCh.close()
|
||||||
|
|
||||||
|
ret = "Success, because..."
|
||||||
|
success = True
|
||||||
|
################ End of Example ##########
|
||||||
|
|
||||||
|
################ END OF YOUR CODE ################
|
||||||
|
###### Final - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
|
||||||
|
# just in case the feedback was forgotten.
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
except (KeyboardInterrupt):
|
||||||
|
# user stop error handler.
|
||||||
|
import traceback
|
||||||
|
ret = 'Test stopped by user.'
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
except:
|
||||||
|
# generic error handler.
|
||||||
|
import traceback
|
||||||
|
ret = traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
|
||||||
|
|
||||||
|
# launch the test.
|
||||||
|
startTest(test, device, parameters)
|
||||||
|
|
||||||
|
################ END OF Final ####################
|
||||||
|
#### IF NEEDED, ADD YOUR FUNCTIONS HERE BELOW ####
|
||||||
|
# Indent to end left
|
||||||
|
# def yourCustomFunction:
|
||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
<html>
|
||||||
|
<!-- Copyright (c) 2015 Paul Scherrer Institute. All rights reserved. -->
|
||||||
|
<body>
|
||||||
|
<h2>Description</h2>
|
||||||
|
Interlock Limits for Ablenksmagnet (Test n. 2 in old caRPS_Tests)
|
||||||
|
<h2>Parameters</h2>
|
||||||
|
<table>
|
||||||
|
<tr><td><code>ilkInExpectedValS </code></td><td>[hex] Interlock Input expected value for small values of magnet</td></tr>
|
||||||
|
<tr><td><code>magnetCh </code></td><td>Magnet epics channel</td></tr>
|
||||||
|
<tr><td><code>ilkInCh </code></td><td>Interlock Input epics channel</td></tr>
|
||||||
|
<tr><td><code>ilkInExpectedValIni </code></td><td>[hex] Interlock Input expected initial value</td></tr>
|
||||||
|
<tr><td><code>ilkOutExpectedValL </code></td><td>[hex] Interlock Output expected value for large values of magnet</td></tr>
|
||||||
|
<tr><td><code>magnetEndVal </code></td><td>[int] magnet final value for scan sequence</td></tr>
|
||||||
|
<tr><td><code>ilkOutCh </code></td><td>Interlock Output epics channel</td></tr>
|
||||||
|
<tr><td><code>ilkOutExpectedValIni </code></td><td>[hex] Interlock Output expected initial value</td></tr>
|
||||||
|
<tr><td><code>ilkOutExpectedValS </code></td><td>[hex] Interlock Output expected value for small values of magnet</td></tr>
|
||||||
|
<tr><td><code>magnetInitVal </code></td><td>[int] magnet initial value for scan sequence</td></tr>
|
||||||
|
<tr><td><code>setGetDelay </code></td><td>[s] delay between set and get</td></tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
<h2>Contact</h2>
|
||||||
|
<a href="https://intranet.psi.ch/search/#?t=phonebook&q=boccioli_m">Marco Boccioli</a> <br/>
|
||||||
|
Tel. 3078
|
||||||
|
</html>
|
||||||
|
</body>
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#TestingList for pshell: configuration properties
|
#TestingList for pshell: configuration properties
|
||||||
#Tue Mar 20 14:04:44 CET 2018
|
#Tue Mar 20 14:07:19 CET 2018
|
||||||
customPanel=
|
customPanel=
|
||||||
showEnabledTestsOnly=
|
showEnabledTestsOnly=
|
||||||
listFilter=rps-test
|
listFilter=rps-test
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
name=Calibrate
|
||||||
|
description=Calibrates the device
|
||||||
|
filename=Calibrate.xml
|
||||||
|
help = \
|
||||||
|
This test sends a command to the low level firmware which controls the collimators \n\
|
||||||
|
requesting that it calibrates itself. \n\n\
|
||||||
|
<b>Calibration</b> involves moving to the R1 and R2 reference positions and measuring the \n\
|
||||||
|
number of steps required to do so. At the end of the sequence the default collimator \n\
|
||||||
|
will be selected. \n\n\
|
||||||
|
During the course of the expected calibration period (45-70 seconds) the test \n\
|
||||||
|
procedure will plot the values of all critical system variables. \n\n\
|
||||||
|
For further information please consult Valery Ovinnikov.<br/>\
|
||||||
@@ -0,0 +1,139 @@
|
|||||||
|
###### Init - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
global sys, inspect, os, traceback
|
||||||
|
import sys, inspect, os, traceback
|
||||||
|
|
||||||
|
|
||||||
|
def startTest(testName, DEVICE, params):
|
||||||
|
# by default, assume the test failed
|
||||||
|
ret = 'Test failed'
|
||||||
|
success = False
|
||||||
|
# plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||||
|
plotName = DEVICE + ' - ' + testName
|
||||||
|
# put the whole custom code under try/catch
|
||||||
|
try:
|
||||||
|
# get the path of this script
|
||||||
|
testPath = inspect.getfile(inspect.currentframe())
|
||||||
|
# init the testing tool class. It can be sued in the following ways:
|
||||||
|
test = TestingTool(testName, testPath, DEVICE, params)
|
||||||
|
samplePeriod = 0.1
|
||||||
|
|
||||||
|
######### WRITE YOUR CODE HERE BELOW #############
|
||||||
|
scan = ManualScan(['time [1/'+ str(1/samplePeriod) + ' s]'], ['Motor Pos (IST3:2)', 'Poti Position (IST2:1)',
|
||||||
|
'Motor Status (STA:1)', 'Inkr (INKR:2)', 'InkrRb (INKRRB:2)',
|
||||||
|
'Diameter (DIAM:2)', 'Logical Position (IST:2)',
|
||||||
|
'Motor Pos Raw (IST3:1)','Poti Pos From Beam (IST1:2)',
|
||||||
|
'Poti Raw (POSA:1)', 'Poti Ref1 Position (REF1:1)', 'Poti Ref2 Position (REF2:1)'])
|
||||||
|
scan.setPlotTitle(plotName)
|
||||||
|
scan.start()
|
||||||
|
|
||||||
|
try:
|
||||||
|
idMotorStatus = Channel(DEVICE + ':STA:1' , type = 'd') # DSP device_status reg
|
||||||
|
idLogicalPosition = Channel(DEVICE + ':IST:2' , type = 'd') # Shows current position in logical units as calculated from motor step counter [1..n]
|
||||||
|
idPotiRaw = Channel(DEVICE + ':POSA:1' , type = 'd') # poti raw data [ADC units]
|
||||||
|
idMotorPositionRaw = Channel(DEVICE + ':IST3:1' , type = 'd') # shows current position in steps as as obtained from motor step counter [steps]
|
||||||
|
idInkr = Channel(DEVICE + ':INKR:2' , type = 'd') # move relative distance (positive means towards R2) [mm]
|
||||||
|
idInkrRb = Channel(DEVICE + ':INKRRB:2' , type = 'd') # readback of move relative distance (positive means towards R2) [mm]
|
||||||
|
idDiameter = Channel(DEVICE + ':DIAM:2' , type = 'd') # collimator diameter [mm]
|
||||||
|
idCom = Channel(DEVICE + ':COM:2' , type = 'd') # current position as from motor step counter [mm]
|
||||||
|
idMotorPosition = Channel(DEVICE + ':IST3:2' , type = 'd') # current position as from motor step counter [mm]
|
||||||
|
idPotiPosFromBeam = Channel(DEVICE + ':IST1:2' , type = 'd') # current position from beam as from potentiometer [mm]
|
||||||
|
idPotiPosition = Channel(DEVICE + ':IST2:1' , type = 'd') # current position as from potentiometer [mm]
|
||||||
|
idPotiRef1Position = Channel(DEVICE + ':REF1:1' , type = 'd') # R1 position as from potentiometer [mm]
|
||||||
|
idPotiRef2Position = Channel(DEVICE + ':REF2:1' , type = 'd') # R2 position as from potentiometer [mm]
|
||||||
|
|
||||||
|
#Pre-actions: 1 = calibrate
|
||||||
|
caput(DEVICE+':COM:2', 1)
|
||||||
|
except:
|
||||||
|
ret = 'Unable to create channel - ' + traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback( ret, success)
|
||||||
|
return
|
||||||
|
|
||||||
|
countDeviceInModeIdle = 0
|
||||||
|
for setpoint1 in range(0, 10000):
|
||||||
|
sleep( samplePeriod ) # Settling time
|
||||||
|
|
||||||
|
MotorStatus = idMotorStatus.get()
|
||||||
|
LogicalPosition = idLogicalPosition.get()
|
||||||
|
PotiRaw = idPotiRaw.get()
|
||||||
|
MotorPositionRaw = idMotorPositionRaw.get()
|
||||||
|
MotorPosition = idMotorPosition.get()
|
||||||
|
PotiPosFromBeam = idPotiPosFromBeam.get()
|
||||||
|
PotiPosition = idPotiPosition.get()
|
||||||
|
PotiRef1Position = idPotiRef1Position.get()
|
||||||
|
PotiRef2Position = idPotiRef2Position.get()
|
||||||
|
Diameter = idDiameter.get()
|
||||||
|
Inkr = idInkr.get()
|
||||||
|
InkrRb = idInkrRb.get()
|
||||||
|
|
||||||
|
scan.append([setpoint1], [setpoint1],
|
||||||
|
[MotorPosition, PotiPosition, MotorStatus, Inkr, InkrRb, Diameter, LogicalPosition,
|
||||||
|
MotorPositionRaw, PotiPosFromBeam, PotiRaw, PotiRef1Position, PotiRef2Position])
|
||||||
|
|
||||||
|
if (int(MotorStatus) & int('1',2))==0: #device finished calibration (bit#1)
|
||||||
|
#give the device some time before stating that it has really finished
|
||||||
|
countDeviceInModeIdle = countDeviceInModeIdle +1
|
||||||
|
if countDeviceInModeIdle == 10:
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
countDeviceInModeIdle = 0
|
||||||
|
|
||||||
|
#check if any error bit is raised
|
||||||
|
if bool(int(MotorStatus) & int('10000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Motor switched off (bit#4)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('100000',2)): #error: abort test
|
||||||
|
test.sendFeedback('No motor link (bit#5)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('1000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('No poti link (bit#6)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('10000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Calibration error (bit#7)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('100000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Cannot get to R1 (bit#8)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('1000000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Cannot get to R2 (bit#9)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('10000000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Position measurement mismatch (bit#10)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('100000000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Movement timeout (bit#11)', False)
|
||||||
|
return
|
||||||
|
|
||||||
|
#Closing channels
|
||||||
|
idMotorStatus.close()
|
||||||
|
idLogicalPosition.close()
|
||||||
|
idPotiRaw.close()
|
||||||
|
idMotorPositionRaw.close()
|
||||||
|
idMotorPosition.close()
|
||||||
|
idPotiPosFromBeam.close()
|
||||||
|
idPotiPosition.close()
|
||||||
|
idPotiRef1Position.close()
|
||||||
|
idPotiRef2Position.close()
|
||||||
|
idDiameter.close()
|
||||||
|
idInkr.close()
|
||||||
|
idInkrRb.close()
|
||||||
|
scan.end()
|
||||||
|
|
||||||
|
ret = 'Calibration done'
|
||||||
|
success = True
|
||||||
|
scan.end()
|
||||||
|
|
||||||
|
################ END OF YOUR CODE ################
|
||||||
|
###### Final - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
|
||||||
|
# just in case the feedback was forgotten
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
except:
|
||||||
|
# generic error handler
|
||||||
|
ret = traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
|
||||||
|
|
||||||
|
# launch the test
|
||||||
|
startTest(test, device, parameters)
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
|
<configuration xmlns="http://www.psi.ch/~ebner/models/scan/1.0">
|
||||||
|
<data fileName="Calibrate.fda"/>
|
||||||
|
<scan>
|
||||||
|
|
||||||
|
<!-- Send Calibrate Command -->
|
||||||
|
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="{DEVICE}:COM:2" value="CALLIBR"/>
|
||||||
|
|
||||||
|
<dimension>
|
||||||
|
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="PseudoPositioner" settlingTime="0.1" id="id000000">
|
||||||
|
<counts>900</counts>
|
||||||
|
</positioner>
|
||||||
|
|
||||||
|
<!-- Motor Drive Status -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:STA:1" id="id000001"/>
|
||||||
|
|
||||||
|
<!-- Logical Status -->
|
||||||
|
<!-- <detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:STA:2" id="id00001B"/> -->
|
||||||
|
|
||||||
|
<!-- Interlock Status -->
|
||||||
|
<!-- <detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IIST:2" id="id000002"/> -->
|
||||||
|
|
||||||
|
<!-- Logical Position -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST:2" id="id000003"/>
|
||||||
|
|
||||||
|
<!-- Collimator Diameter -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:DIAM:2" id="id000004"/>
|
||||||
|
|
||||||
|
<!-- Position Counter: Raw -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST1:1" id="id000005"/>
|
||||||
|
|
||||||
|
<!-- Position Counter: Processed -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST1:2" id="id000006"/>
|
||||||
|
|
||||||
|
<!-- Potentiometer: Raw -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST2:1" id="id000007"/>
|
||||||
|
|
||||||
|
<!-- Potentiometer: Processed -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST2:2" id="id000008"/>
|
||||||
|
|
||||||
|
<!-- BTVS Digitiser: Raw -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST3:1" id="id000009"/>
|
||||||
|
|
||||||
|
<!-- BTVS Digitiser: Processed -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST3:2" id="id000010"/>
|
||||||
|
|
||||||
|
|
||||||
|
</dimension>
|
||||||
|
|
||||||
|
</scan>
|
||||||
|
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000001" title="Drive Status: {DEVICE}:STA:1"/>
|
||||||
|
<!-- <visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000002" title="ILK Status: {DEVICE}:IIST:2"/> -->
|
||||||
|
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000003" title="Logical Pos: {DEVICE}:IST:2"/>
|
||||||
|
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000004" title="Diameter: {DEVICE}:DIAM:2 (mm)"/>
|
||||||
|
<!-- <visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000005" title="Cpc: {DEVICE}:IST1:1 (mm)"/> -->
|
||||||
|
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000006" title="Cpc: {DEVICE}:IST1:2 (mm)"/>
|
||||||
|
<!-- <visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000007" title="Pot: {DEVICE}:IST2:1 (mm)"/> -->
|
||||||
|
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000008" title="Pot: {DEVICE}:IST2:2 (mm)"/>
|
||||||
|
<!-- <visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000009" title="Btvs: {DEVICE}:IST3:1 (ADC raw)"/> -->
|
||||||
|
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000010" title="Btvs: {DEVICE}:IST3:2 (mm)"/>
|
||||||
|
</configuration>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
name=Drive Out
|
||||||
|
description=Drives the Collimator to the Out Position
|
||||||
|
filename=Drive Out.xml
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
#Script imported from: Drive Out.xml
|
||||||
|
import traceback
|
||||||
|
|
||||||
|
#by default, failed
|
||||||
|
ret = 'Test failed'
|
||||||
|
success = False
|
||||||
|
|
||||||
|
try:
|
||||||
|
#Pre-actions: 2 = drive out
|
||||||
|
caput(DEVICE+':COM:2', 2)
|
||||||
|
#Creating channels: dimension 1
|
||||||
|
#PseudoPositioner id000000
|
||||||
|
#ScalarDetector id000001
|
||||||
|
id000001 = Channel(DEVICE+':STA:1', type = 'd')
|
||||||
|
#ScalarDetector id000003
|
||||||
|
id000003 = Channel(DEVICE+':IST:2', type = 'd')
|
||||||
|
#ScalarDetector id000004
|
||||||
|
id000004 = Channel(DEVICE+':DIAM:2', type = 'd')
|
||||||
|
#ScalarDetector id000005
|
||||||
|
id000005 = Channel(DEVICE+':IST1:1', type = 'd')
|
||||||
|
#ScalarDetector id000006
|
||||||
|
id000006 = Channel(DEVICE+':IST1:2', type = 'd')
|
||||||
|
#ScalarDetector id000007
|
||||||
|
id000007 = Channel(DEVICE+':IST2:1', type = 'd')
|
||||||
|
#ScalarDetector id000008
|
||||||
|
id000008 = Channel(DEVICE+':IST2:2', type = 'd')
|
||||||
|
#ScalarDetector id000009
|
||||||
|
id000009 = Channel(DEVICE+':IST3:1', type = 'd')
|
||||||
|
#ScalarDetector id000010
|
||||||
|
id000010 = Channel(DEVICE+':IST3:2', type = 'd')
|
||||||
|
except:
|
||||||
|
print "Unexpected error:", sys.exc_info()[0]
|
||||||
|
ret = 'Unable to create channel - ' + traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
raise Exception('Unable to create channel - ' + traceback.format_exc())
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
|
#TODO: Set the diplay names of positioners and detectors
|
||||||
|
scan = ManualScan(['id000000'], ['id000001', 'id000003', 'id000004', 'id000005', 'id000006', 'id000007', 'id000008', 'id000009', 'id000010'] , [0.0], [3000.0], [3000])
|
||||||
|
scan.start()
|
||||||
|
|
||||||
|
#Dimension 1
|
||||||
|
#PseudoPositioner id000000
|
||||||
|
for setpoint1 in range(0, 3000):
|
||||||
|
readback1 = setpoint1
|
||||||
|
sleep( 0.1 ) # Settling time
|
||||||
|
#Detector id000001
|
||||||
|
detector1 = id000001.get()
|
||||||
|
#Detector id000003
|
||||||
|
detector2 = id000003.get()
|
||||||
|
#Detector id000004
|
||||||
|
detector3 = id000004.get()
|
||||||
|
#Detector id000005
|
||||||
|
detector4 = id000005.get()
|
||||||
|
#Detector id000006
|
||||||
|
detector5 = id000006.get()
|
||||||
|
#Detector id000007
|
||||||
|
detector6 = id000007.get()
|
||||||
|
#Detector id000008
|
||||||
|
detector7 = id000008.get()
|
||||||
|
#Detector id000009
|
||||||
|
detector8 = id000009.get()
|
||||||
|
#Detector id000010
|
||||||
|
detector9 = id000010.get()
|
||||||
|
scan.append ([setpoint1], [readback1], [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, detector9])
|
||||||
|
|
||||||
|
#Closing channels
|
||||||
|
id000001.close()
|
||||||
|
id000003.close()
|
||||||
|
id000004.close()
|
||||||
|
id000005.close()
|
||||||
|
id000006.close()
|
||||||
|
id000007.close()
|
||||||
|
id000008.close()
|
||||||
|
id000009.close()
|
||||||
|
id000010.close()
|
||||||
|
|
||||||
|
scan.end()
|
||||||
|
|
||||||
|
#return ok
|
||||||
|
ret = 'Slides moved out'
|
||||||
|
success = True
|
||||||
@@ -0,0 +1,144 @@
|
|||||||
|
# Drive Out
|
||||||
|
|
||||||
|
###### Init - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
global sys, inspect, os, traceback
|
||||||
|
import sys, inspect, os, traceback
|
||||||
|
|
||||||
|
|
||||||
|
def startTest(testName, DEVICE, params):
|
||||||
|
# by default, assume the test failed
|
||||||
|
ret = 'Test failed'
|
||||||
|
success = False
|
||||||
|
# plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||||
|
plotName = DEVICE + ' - ' + testName
|
||||||
|
# put the whole custom code under try/catch
|
||||||
|
try:
|
||||||
|
# get the path of this script
|
||||||
|
testPath = inspect.getfile(inspect.currentframe())
|
||||||
|
# init the testing tool class. It can be sued in the following ways:
|
||||||
|
test = TestingTool(testName, testPath, DEVICE, params)
|
||||||
|
samplePeriod = 0.1
|
||||||
|
|
||||||
|
######### WRITE YOUR CODE HERE BELOW #############
|
||||||
|
scan = ManualScan(['time [1/'+ str(1/samplePeriod) + ' s]'], ['Motor Pos (IST3:2)', 'Poti Position (IST2:1)',
|
||||||
|
'Motor Status (STA:1)', 'Inkr (INKR:2)', 'InkrRb (INKRRB:2)',
|
||||||
|
'Diameter (DIAM:2)', 'Com (COM:2)', 'Logical Position (IST:2)',
|
||||||
|
'Motor Pos Raw (IST3:1)','Poti Pos From Beam (IST1:2)',
|
||||||
|
'Poti Raw (POSA:1)', 'Poti Ref1 Position (REF1:1)', 'Poti Ref2 Position (REF2:1)'])
|
||||||
|
scan.setPlotTitle(plotName)
|
||||||
|
scan.start()
|
||||||
|
|
||||||
|
try:
|
||||||
|
idMotorStatus = Channel(DEVICE + ':STA:1' , type = 'd') # DSP device_status reg
|
||||||
|
idLogicalPosition = Channel(DEVICE + ':IST:2' , type = 'd') # Shows current position in logical units as calculated from motor step counter [1..n]
|
||||||
|
idPotiRaw = Channel(DEVICE + ':POSA:1' , type = 'd') # poti raw data [ADC units]
|
||||||
|
idMotorPositionRaw = Channel(DEVICE + ':IST3:1' , type = 'd') # shows current position in steps as as obtained from motor step counter [steps]
|
||||||
|
idInkr = Channel(DEVICE + ':INKR:2' , type = 'd') # move relative distance (positive means towards R2) [mm]
|
||||||
|
idInkrRb = Channel(DEVICE + ':INKRRB:2' , type = 'd') # readback of move relative distance (positive means towards R2) [mm]
|
||||||
|
idDiameter = Channel(DEVICE + ':DIAM:2' , type = 'd') # collimator diameter [mm]
|
||||||
|
idCom = Channel(DEVICE + ':COM:2' , type = 'd') # current position as from motor step counter [mm]
|
||||||
|
idMotorPosition = Channel(DEVICE + ':IST3:2' , type = 'd') # current position as from motor step counter [mm]
|
||||||
|
idPotiPosFromBeam = Channel(DEVICE + ':IST1:2' , type = 'd') # current position from beam as from potentiometer [mm]
|
||||||
|
idPotiPosition = Channel(DEVICE + ':IST2:1' , type = 'd') # current position as from potentiometer [mm]
|
||||||
|
idPotiRef1Position = Channel(DEVICE + ':REF1:1' , type = 'd') # R1 position as from potentiometer [mm]
|
||||||
|
idPotiRef2Position = Channel(DEVICE + ':REF2:1' , type = 'd') # R2 position as from potentiometer [mm]
|
||||||
|
|
||||||
|
#Pre-actions: 2 = drive out
|
||||||
|
caput(DEVICE+':COM:2', 2)
|
||||||
|
sleep( samplePeriod ) # Settling time
|
||||||
|
except:
|
||||||
|
ret = 'Unable to create channel - ' + traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback( ret, success)
|
||||||
|
return
|
||||||
|
|
||||||
|
for setpoint1 in range(0, 10000):
|
||||||
|
sleep( samplePeriod ) # Settling time
|
||||||
|
|
||||||
|
MotorStatus = idMotorStatus.get()
|
||||||
|
LogicalPosition = idLogicalPosition.get()
|
||||||
|
PotiRaw = idPotiRaw.get()
|
||||||
|
MotorPositionRaw = idMotorPositionRaw.get()
|
||||||
|
Com = idCom.get()
|
||||||
|
MotorPosition = idMotorPosition.get()
|
||||||
|
PotiPosFromBeam = idPotiPosFromBeam.get()
|
||||||
|
PotiPosition = idPotiPosition.get()
|
||||||
|
PotiRef1Position = idPotiRef1Position.get()
|
||||||
|
PotiRef2Position = idPotiRef2Position.get()
|
||||||
|
Diameter = idDiameter.get()
|
||||||
|
Inkr = idInkr.get()
|
||||||
|
InkrRb = idInkrRb.get()
|
||||||
|
|
||||||
|
|
||||||
|
scan.append([setpoint2], [setpoint2],
|
||||||
|
[MotorPosition, PotiPosition, MotorStatus, Inkr, InkrRb, Diameter, Com, LogicalPosition,
|
||||||
|
MotorPositionRaw, PotiPosFromBeam, PotiRaw, PotiRef1Position, PotiRef2Position])
|
||||||
|
|
||||||
|
if (MotorStatus & int('1',2))==0: #device finished calibration (bit#1)
|
||||||
|
#give the device some time before stating that it has really finished
|
||||||
|
countDeviceInModeIdle = countDeviceInModeIdle +1
|
||||||
|
if countDeviceInModeIdle == 10:
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
countDeviceInModeIdle = 0
|
||||||
|
|
||||||
|
#check if any error bit is raised
|
||||||
|
if bool(int(MotorStatus) & int('10000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Motor switched off (bit#4)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('100000',2)): #error: abort test
|
||||||
|
test.sendFeedback('No motor link (bit#5)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('1000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('No poti link (bit#6)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('10000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Calibration error (bit#7)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('100000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Cannot get to R1 (bit#8)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('1000000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Cannot get to R2 (bit#9)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('10000000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Position measurement mismatch (bit#10)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('100000000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Movement timeout (bit#11)', False)
|
||||||
|
return
|
||||||
|
|
||||||
|
#Closing channels
|
||||||
|
idMotorStatus.close()
|
||||||
|
idLogicalPosition.close()
|
||||||
|
idPotiRaw.close()
|
||||||
|
idMotorPositionRaw.close()
|
||||||
|
idCom.close()
|
||||||
|
idMotorPosition.close()
|
||||||
|
idPotiPosFromBeam.close()
|
||||||
|
idPotiPosition.close()
|
||||||
|
idPotiRef1Position.close()
|
||||||
|
idPotiRef2Position.close()
|
||||||
|
idDiameter.close()
|
||||||
|
idInkr.close()
|
||||||
|
idInkrRb.close()
|
||||||
|
scan.end()
|
||||||
|
|
||||||
|
ret = 'Drive Out done'
|
||||||
|
success = True
|
||||||
|
scan.end()
|
||||||
|
|
||||||
|
################ END OF YOUR CODE ################
|
||||||
|
###### Final - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
|
||||||
|
# just in case the feedback was forgotten
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
except:
|
||||||
|
# generic error handler
|
||||||
|
ret = traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
|
||||||
|
|
||||||
|
# launch the test
|
||||||
|
startTest(test, device, parameters)
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
|
<configuration xmlns="http://www.psi.ch/~ebner/models/scan/1.0">
|
||||||
|
<data fileName="Drive Out.fda"/>
|
||||||
|
<scan>
|
||||||
|
|
||||||
|
<!-- Send Drive Out Command -->
|
||||||
|
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="{DEVICE}:COM:2" value="FAHR_AUS"/>
|
||||||
|
|
||||||
|
<dimension>
|
||||||
|
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="PseudoPositioner" settlingTime="0.1" id="id000000">
|
||||||
|
<counts>3000</counts>
|
||||||
|
</positioner>
|
||||||
|
|
||||||
|
<!-- Motor Drive Status -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:STA:1" id="id000001"/>
|
||||||
|
|
||||||
|
<!-- Logical Status -->
|
||||||
|
<!-- <detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:STA:2" id="id00001B"/> -->
|
||||||
|
|
||||||
|
<!-- Interlock Status -->
|
||||||
|
<!-- <detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IIST:2" id="id000002"/> -->
|
||||||
|
|
||||||
|
<!-- Logical Position -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST:2" id="id000003"/>
|
||||||
|
|
||||||
|
<!-- Collimator Diameter -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:DIAM:2" id="id000004"/>
|
||||||
|
|
||||||
|
<!-- Position Counter: Raw -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST1:1" id="id000005"/>
|
||||||
|
|
||||||
|
<!-- Position Counter: Processed -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST1:2" id="id000006"/>
|
||||||
|
|
||||||
|
<!-- Potentiometer: Raw -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST2:1" id="id000007"/>
|
||||||
|
|
||||||
|
<!-- Potentiometer: Processed -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST2:2" id="id000008"/>
|
||||||
|
|
||||||
|
<!-- BTVS Digitiser: Raw -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST3:1" id="id000009"/>
|
||||||
|
|
||||||
|
<!-- BTVS Digitiser: Processed -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST3:2" id="id000010"/>
|
||||||
|
|
||||||
|
|
||||||
|
</dimension>
|
||||||
|
|
||||||
|
</scan>
|
||||||
|
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000001" title="Drive Status: {DEVICE}:STA:1"/>
|
||||||
|
<!-- <visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000002" title="ILK Status: {DEVICE}:IIST:2"/> -->
|
||||||
|
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000003" title="Logical Pos: {DEVICE}:IST:2"/>
|
||||||
|
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000004" title="Diameter: {DEVICE}:DIAM:2 (mm)"/>
|
||||||
|
<!-- <visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000005" title="Cpc: {DEVICE}:IST1:1 (mm)"/> -->
|
||||||
|
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000006" title="Cpc: {DEVICE}:IST1:2 (mm)"/>
|
||||||
|
<!-- <visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000007" title="Pot: {DEVICE}:IST2:1 (mm)"/> -->
|
||||||
|
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000008" title="Pot: {DEVICE}:IST2:2 (mm)"/>
|
||||||
|
<!-- <visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000009" title="Btvs: {DEVICE}:IST3:1 (ADC raw)"/> -->
|
||||||
|
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000010" title="Btvs: {DEVICE}:IST3:2 (mm)"/>
|
||||||
|
</configuration>
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#Fri Jun 09 14&14&06 CEST 2017
|
||||||
|
name=Monitor Movement
|
||||||
|
description=Monitor the movements during the specified time interval. No commands are sent.
|
||||||
|
parameters=monitorTime&20&How long the monitoring is performed [s];samplingDelay&0.1&Delay between each sample is taken [s];
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
|
||||||
|
###### Init - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
global sys, inspect, os, traceback
|
||||||
|
import sys, inspect, os, traceback
|
||||||
|
|
||||||
|
def startTest(testName, DEVICE, params):
|
||||||
|
#by default, assume the test failed
|
||||||
|
ret = 'Test failed'
|
||||||
|
success = False
|
||||||
|
#plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||||
|
plotName = DEVICE + ' - ' + testName
|
||||||
|
#put the whole custom code under try/catch
|
||||||
|
try:
|
||||||
|
#get the path of this script
|
||||||
|
testPath = inspect.getfile(inspect.currentframe())
|
||||||
|
#init the testing tool class. It can be sued in the following ways:
|
||||||
|
test = TestingTool(testName, testPath, DEVICE, params)
|
||||||
|
|
||||||
|
######### WRITE YOUR CODE HERE BELOW #############
|
||||||
|
#get parameters from the calling interface
|
||||||
|
try:
|
||||||
|
#test.log( "with the following parameters:\n" + str(params))
|
||||||
|
#test.log( 'testpath: ' + testPath )
|
||||||
|
#test.log( 'parameters:' + str( params) )
|
||||||
|
#test.log( 'device: ' + DEVICE )
|
||||||
|
monitorTime = float(test.getParam("monitorTime"))
|
||||||
|
samplePeriod = 0.05 #seconds
|
||||||
|
except:
|
||||||
|
ret = 'Could not retrieve testing parameters - ' + traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback( ret, success)
|
||||||
|
return
|
||||||
|
|
||||||
|
#get parameters from the calling interface
|
||||||
|
scan = ManualScan(['time [s]'],
|
||||||
|
['Motor Pos (IST3:2)', 'Poti Position (IST2:1)', 'Motor Pos - Poti Pos'] )
|
||||||
|
scan.setPlotTitle(plotName)
|
||||||
|
scan.start()
|
||||||
|
|
||||||
|
#Creating channels: dimension 1
|
||||||
|
try:
|
||||||
|
idCom = Channel(DEVICE+':COM:2' , type = 'd') #current position as from motor step counter [mm]
|
||||||
|
idMotorPosition = Channel(DEVICE+':IST3:2', type = 'd') #current position as from motor step counter [mm]
|
||||||
|
#idPotiPosFromBeam = Channel(DEVICE+':IST1:2', type = 'd') #current position from beam as from potentiometer [mm]
|
||||||
|
idPotiPosition = Channel(DEVICE+':IST2:1', type = 'd') #current position as from potentiometer [mm]
|
||||||
|
#idPotiRef1Position = Channel(DEVICE+':REF1:1', type = 'd') #R1 position as from potentiometer [mm]
|
||||||
|
#idPotiRef2Position = Channel(DEVICE+':REF2:1', type = 'd') #R2 position as from potentiometer [mm]
|
||||||
|
|
||||||
|
except:
|
||||||
|
test.sendFeedback( 'Unable to create channel - ' + traceback.format_exc(), False)
|
||||||
|
return
|
||||||
|
|
||||||
|
r1 = tscan((idMotorPosition, idPotiPosition), int(monitorTime/0.02), 0.02)
|
||||||
|
|
||||||
|
|
||||||
|
test.log( 'Monitoring movement for ' + str(monitorTime) + 's')
|
||||||
|
#scan quickly the output during some seconds
|
||||||
|
timeElapsed=0
|
||||||
|
startTime=float(java.lang.System.currentTimeMillis())
|
||||||
|
currentTime = float(java.lang.System.currentTimeMillis())
|
||||||
|
timeElapsed=currentTime-startTime
|
||||||
|
while timeElapsed<(monitorTime*1000):
|
||||||
|
#Detector time
|
||||||
|
currentTime = float(java.lang.System.currentTimeMillis())
|
||||||
|
timeElapsed=currentTime-startTime
|
||||||
|
motorPosition = idMotorPosition.get()
|
||||||
|
#potiPosFromBeam = idPotiPosFromBeam.get()
|
||||||
|
potiPosition = idPotiPosition.get()
|
||||||
|
#potiRef1Position = idPotiRef1Position.get()
|
||||||
|
#potiRef2Position = idPotiRef2Position.get()
|
||||||
|
diff1 = motorPosition-potiPosition
|
||||||
|
scan.append ([timeElapsed/1000], [timeElapsed/1000], [motorPosition, potiPosition, diff1])
|
||||||
|
sleep( samplePeriod ) # Settling time
|
||||||
|
#timeElapsed=timeElapsed+1
|
||||||
|
|
||||||
|
#Closing channels
|
||||||
|
idCom.close()
|
||||||
|
idMotorPosition.close()
|
||||||
|
#idPotiPosFromBeam.close()
|
||||||
|
idPotiPosition.close()
|
||||||
|
#idPotiRef1Position.close()
|
||||||
|
#idPotiRef2Position.close()
|
||||||
|
ret = 'End of Monitoring'
|
||||||
|
success = True
|
||||||
|
|
||||||
|
################ END OF YOUR CODE ################
|
||||||
|
###### Final - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
|
||||||
|
#just in case the feedback was forgotten
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
except:
|
||||||
|
#generic error handler
|
||||||
|
ret = traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
|
||||||
|
#launch the test
|
||||||
|
startTest(test, device, parameters)
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<h2>Description</h2>
|
||||||
|
Monitor the movements during the specified time interval. No commands are sent.
|
||||||
|
<h2>Parameters</h2>
|
||||||
|
<code>monitorTime</code> Monitoring time interval [s] <br/>
|
||||||
|
<code>samplingDelay </code>Delay between each sample is taken [s]
|
||||||
|
<h2>Contact</h2>
|
||||||
|
<a href="https://intranet.psi.ch/Main/MarcoBoccioli">Marco Boccioli </a>
|
||||||
|
</html>
|
||||||
|
</body>
|
||||||
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
name=Motor Test 1
|
||||||
|
description=Moves to CW switch then CCW switch N times.
|
||||||
|
|
||||||
|
|
||||||
|
#optional parameters. Description is compulsory. Syntax&
|
||||||
|
#parameters=<parameter1Name>&<parameter1Value>&<Parameter 1 description>[;<parameter2Name>&<parameter2Value>&<Parameter 2 description>]
|
||||||
|
parameters=repeatTimes&1&Repeat N times;delayS&5&Pause delay [s]
|
||||||
@@ -0,0 +1,154 @@
|
|||||||
|
#Script Motor Test 1
|
||||||
|
#Moves to CCW switch; then for M times moves N times to CW switch then CCW switch; between each M pauses for delay; log at CCW and CW
|
||||||
|
|
||||||
|
import traceback
|
||||||
|
|
||||||
|
#by default, failed
|
||||||
|
ret = 'Test failed'
|
||||||
|
status = False
|
||||||
|
DEVICE = device
|
||||||
|
params = parameters
|
||||||
|
#DEVICE = 'PO2DV-NCS-LS'
|
||||||
|
#get parameters from the calling interface
|
||||||
|
try:
|
||||||
|
print "Running test Motor Test 1 with the following parameters:"
|
||||||
|
print params
|
||||||
|
loopTimes = int(params["repeatTimes"]["value"])
|
||||||
|
delaySeconds = int(params["delayS"]["value"])
|
||||||
|
except:
|
||||||
|
print "Could not retrieve testing parameters: ", sys.exc_info()[0]
|
||||||
|
ret = 'Could not retrieve testing parameters - ' + traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
raise Exception('Could not retrieve testing parameters - ' + traceback.format_exc())
|
||||||
|
|
||||||
|
#TODO: Set the diplay names of positioners and detectors
|
||||||
|
#scan = ManualScan(['idX', 'idInkr'], ['idMotorStatus', 'idLogicalPosition', 'idDiameter', 'idMotorPosition', 'idPotiRaw', 'idPotiProc', 'idBtvsRaw', 'idBtvsProc', 'idDiff01', 'idDiff02'] , [-0.5, 0.0], [4.0, 3000.0], [3000, 20])
|
||||||
|
scan = ManualScan(['idX'], ['idMotorStatus', 'idLogicalPosition', 'idDiameter', 'idMotorPosition', 'idPotiRaw', 'idPotiProc', 'idBtvsRaw', 'idBtvsProc', 'idDiff01', 'idDiff02'] , [ 0.0], [ 3000.0], [20])
|
||||||
|
scan.start()
|
||||||
|
#Creating channels: dimension 1
|
||||||
|
try:
|
||||||
|
#RegionPositioner idInkr
|
||||||
|
#idInkr = Channel(DEVICE+':INKR:2', type = 'd')
|
||||||
|
idInkr = Channel(DEVICE+':MOTOR.VAL', type = 'd')
|
||||||
|
#ScalarDetector idMotorStatus
|
||||||
|
#idMotorStatus = Channel(DEVICE+':STA:1', type = 'd')
|
||||||
|
idMotorStatus = Channel(DEVICE+':MOTOR.MSTA', type = 'd')
|
||||||
|
#ScalarDetector idLogicalPosition
|
||||||
|
#idLogicalPosition = Channel(DEVICE+':IST:2', type = 'd')
|
||||||
|
idLogicalPosition = Channel(DEVICE+':MOTOR.RVAL', type = 'd')
|
||||||
|
#ScalarDetector idDiameter
|
||||||
|
#idDiameter = Channel(DEVICE+':DIAM:2', type = 'd')
|
||||||
|
idDiameter = Channel(DEVICE+':ENCODERoff', type = 'd')
|
||||||
|
#ScalarDetector idMotorPosition
|
||||||
|
#idMotorPosition = Channel(DEVICE+':IST1:2', type = 'd')
|
||||||
|
idMotorPosition = Channel(DEVICE+':MOTOR.RBV', type = 'd')
|
||||||
|
#ScalarDetector idPotiRaw
|
||||||
|
#idPotiRaw = Channel(DEVICE+':POSA:1', type = 'd')
|
||||||
|
idPotiRaw = Channel(DEVICE+':ENCODERraw', type = 'd')
|
||||||
|
#ScalarDetector idPotiProc
|
||||||
|
#idPotiProc = Channel(DEVICE+':POSA:2', type = 'd')
|
||||||
|
idPotiProc = Channel(DEVICE+':ENCODER', type = 'd')
|
||||||
|
#ScalarDetector idBtvsRaw
|
||||||
|
#idBtvsRaw = Channel(DEVICE+':IST3:1', type = 'd')
|
||||||
|
idBtvsRaw = Channel(DEVICE+':MOTOR.LLS', type = 'd')
|
||||||
|
#ScalarDetector idBtvsProc
|
||||||
|
#idBtvsProc = Channel(DEVICE+':IST3:2', type = 'd')
|
||||||
|
idBtvsProc = Channel(DEVICE+':MOTOR.HLS', type = 'd')
|
||||||
|
#ScalarDetector idEndSwitchL
|
||||||
|
#idBtvsRaw = Channel(DEVICE+':IST3:1', type = 'd')
|
||||||
|
idEndSwitchL = Channel(DEVICE+':MOTOR.LLS', type = 'd')
|
||||||
|
#ScalarDetector idEndSwitchH
|
||||||
|
#idBtvsProc = Channel(DEVICE+':IST3:2', type = 'd')
|
||||||
|
idEndSwitchH = Channel(DEVICE+':MOTOR.HLS', type = 'd')
|
||||||
|
#high position limit
|
||||||
|
idLimitH = Channel(DEVICE+':MOTOR.HLM', type = 'd')
|
||||||
|
#low position limit
|
||||||
|
idLimitL = Channel(DEVICE+':MOTOR.LLM', type = 'd')
|
||||||
|
except:
|
||||||
|
print "Unexpected error:", sys.exc_info()[0]
|
||||||
|
ret = 'Unable to create channel - ' + traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
raise Exception('Unable to create channel - ' + traceback.format_exc())
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
|
#remove limits
|
||||||
|
idLimitH.put(999999.9, timeout=None)
|
||||||
|
idLimitL.put(-999999.9, timeout=None)
|
||||||
|
#Dimension 1
|
||||||
|
direction = 1.0;
|
||||||
|
startDefault = -100.0
|
||||||
|
endDefault = 1000.0
|
||||||
|
end = endDefault
|
||||||
|
#find position at Low end switch: it will be the starting point of the test
|
||||||
|
print 'Homing'
|
||||||
|
idInkr.put(-100.0, timeout=None) # TODO: Set appropriate timeout
|
||||||
|
start = startDefault #idInkr.get()+direction
|
||||||
|
setpoint2 = end
|
||||||
|
count = 0
|
||||||
|
print 'Starting test sequence'
|
||||||
|
for setpoint1 in range(0, loopTimes*2):
|
||||||
|
sleep( delaySeconds ) # Settling time
|
||||||
|
#RegionPositioner idInkr
|
||||||
|
idInkr.put(setpoint2, timeout=None) # TODO: Set appropriate timeout
|
||||||
|
readback2 = idInkr.get()
|
||||||
|
#if abs(readback2 - setpoint2) > 1 : # TODO: Check accuracy
|
||||||
|
# ret = 'Actor idInkr could not be set to the value ' + str(setpoint2) + ' (current value: ' + str(readback2) + ')'
|
||||||
|
# success = False
|
||||||
|
# raise Exception(ret)
|
||||||
|
#Detector idMotorStatus
|
||||||
|
detector1 = idMotorStatus.get()
|
||||||
|
#Detector idLogicalPosition
|
||||||
|
detector2 = idLogicalPosition.get()
|
||||||
|
#Detector idDiameter
|
||||||
|
detector3 = idDiameter.get()
|
||||||
|
#Detector idMotorPosition
|
||||||
|
detector4 = idMotorPosition.get()
|
||||||
|
#Detector idPotiRaw
|
||||||
|
detector5 = idPotiRaw.get()
|
||||||
|
#Detector idPotiProc
|
||||||
|
detector6 = idPotiProc.get()
|
||||||
|
#Detector idBtvsRaw
|
||||||
|
detector7 = idBtvsRaw.get()
|
||||||
|
#Detector idBtvsProc
|
||||||
|
detector8 = idBtvsProc.get()
|
||||||
|
#end switches
|
||||||
|
endH = idEndSwitchH.get()
|
||||||
|
endL = idEndSwitchL.get()
|
||||||
|
#Manipulation idDiff02
|
||||||
|
#Variable Mappings
|
||||||
|
a = detector4
|
||||||
|
b = detector8
|
||||||
|
idDiff02 = a-b
|
||||||
|
#Manipulation idDiff01
|
||||||
|
#Variable Mappings
|
||||||
|
a = detector4
|
||||||
|
b = detector6
|
||||||
|
count = count + 1
|
||||||
|
idDiff01 = a-b
|
||||||
|
if endH>0.0 :
|
||||||
|
#invert direction and swap start with end of translation
|
||||||
|
setpoint2 = start
|
||||||
|
print 'End H switch, changing target to ' + str(setpoint2)
|
||||||
|
scan.append ([setpoint2], [readback2], [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, idDiff02, idDiff01])
|
||||||
|
if endL>0.0 :
|
||||||
|
#invert direction and swap start with end of translation
|
||||||
|
setpoint2 = end
|
||||||
|
print 'End L switch, changing target to ' + str(setpoint2)
|
||||||
|
scan.append ([setpoint2], [readback2], [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, idDiff02, idDiff01])
|
||||||
|
|
||||||
|
#set limits back
|
||||||
|
idLimitH.put(145.0, timeout=None)
|
||||||
|
idLimitL.put(0.0, timeout=None)
|
||||||
|
#Closing channels
|
||||||
|
idInkr.close()
|
||||||
|
idMotorStatus.close()
|
||||||
|
idLogicalPosition.close()
|
||||||
|
idDiameter.close()
|
||||||
|
idMotorPosition.close()
|
||||||
|
idPotiRaw.close()
|
||||||
|
idPotiProc.close()
|
||||||
|
idBtvsRaw.close()
|
||||||
|
idBtvsProc.close()
|
||||||
|
scan.end()
|
||||||
|
ret = 'Slide moved back and forth (' + str(count) + ' runs)'
|
||||||
|
status = True
|
||||||
@@ -0,0 +1,187 @@
|
|||||||
|
# Script Motor Test 1
|
||||||
|
# Moves to CCW switch; then for M times moves N times to CW switch then CCW switch; between each M pauses for delay; log at CCW and CW
|
||||||
|
|
||||||
|
|
||||||
|
###### Init - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
global sys, inspect, os, traceback
|
||||||
|
import sys, inspect, os, traceback
|
||||||
|
|
||||||
|
|
||||||
|
def startTest(testName, DEVICE, params):
|
||||||
|
# by default, assume the test failed
|
||||||
|
ret = 'Test failed'
|
||||||
|
success = False
|
||||||
|
# plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||||
|
plotName = DEVICE + ' - ' + testName
|
||||||
|
# put the whole custom code under try/catch
|
||||||
|
try:
|
||||||
|
# get the path of this script
|
||||||
|
testPath = inspect.getfile(inspect.currentframe())
|
||||||
|
# init the testing tool class. It can be sued in the following ways:
|
||||||
|
test = TestingTool(testName, testPath, DEVICE, params)
|
||||||
|
|
||||||
|
######### WRITE YOUR CODE HERE BELOW #############
|
||||||
|
|
||||||
|
# DEVICE = 'PO2DV-NCS-LS'
|
||||||
|
# get parameters from the calling interface
|
||||||
|
try:
|
||||||
|
test.log("Running test with the following parameters:")
|
||||||
|
test.log(params)
|
||||||
|
loopTimes = int(test.getParam("repeatTimes"))
|
||||||
|
delaySeconds = int(test.getParam("delayS"))
|
||||||
|
samplePeriod = 0.05 #seconds
|
||||||
|
except:
|
||||||
|
ret = 'Could not retrieve testing parameters - ' + traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
return
|
||||||
|
|
||||||
|
scan = ManualScan(['time [1/'+ str(1/samplePeriod) + ' s]'], [
|
||||||
|
'Btvs Poti Position (IST3:2)',
|
||||||
|
'Mcs Poti Position (IST2:1)',
|
||||||
|
'Motor Status (STA:1)',
|
||||||
|
'Inkr (INKR:2)',
|
||||||
|
'InkrRb (INKRRB:2)',
|
||||||
|
'Diameter (DIAM:2)',
|
||||||
|
'Logical Position (IST:2)',
|
||||||
|
'Btvs Raw (IST3:1)',
|
||||||
|
'Motor Position (IST1:2)',
|
||||||
|
'Poti Raw (POSA:1)',
|
||||||
|
'Poti Ref1 Position (REF1:1)',
|
||||||
|
'Poti Ref2 Position (REF2:1)'])
|
||||||
|
|
||||||
|
p1 = plot(None, name = "Motor Position - Btvs Poti Position", context = plotName + " pos difference")[0]
|
||||||
|
scan.setPlotTitle(plotName)
|
||||||
|
scan.start()
|
||||||
|
# Creating channels: dimension 1
|
||||||
|
try:
|
||||||
|
idMotorStatus = Channel(DEVICE + ':STA:1' , type = 'd') # DSP device_status reg
|
||||||
|
idLogicalPosition = Channel(DEVICE + ':IST:2' , type = 'd') # Shows current position in logical units as calculated from motor step counter [1..n]
|
||||||
|
idPotiRaw = Channel(DEVICE + ':POSA:1' , type = 'd') # poti raw data [ADC units]
|
||||||
|
idBtvsRaw = Channel(DEVICE + ':IST3:1' , type = 'd') # shows current position in steps as as obtained from motor step counter [steps]
|
||||||
|
idInkr = Channel(DEVICE + ':INKR:2' , type = 'd') # move relative distance (positive means towards R2) [mm]
|
||||||
|
idInkrRb = Channel(DEVICE + ':INKRRB:2' , type = 'd') # readback of move relative distance (positive means towards R2) [mm]
|
||||||
|
idDiameter = Channel(DEVICE + ':DIAM:2' , type = 'd') # collimator diameter [mm]
|
||||||
|
idCom = Channel(DEVICE + ':COM:2' , type = 'd') # motor commands [0=Stop; 1=Calibrate; 2=gotoR1; 3=gotoR2]
|
||||||
|
idBtvs = Channel(DEVICE + ':IST3:2' , type = 'd') # current position as from motor step counter [mm]
|
||||||
|
idMotorPosition = Channel(DEVICE + ':IST1:2' , type = 'd') # current position from beam as from potentiometer [mm]
|
||||||
|
idPotiPosition = Channel(DEVICE + ':IST2:1' , type = 'd') # current position as from potentiometer [mm]
|
||||||
|
idPotiRef1Position = Channel(DEVICE + ':REF1:1' , type = 'd') # R1 position as from potentiometer [mm]
|
||||||
|
idPotiRef2Position = Channel(DEVICE + ':REF2:1' , type = 'd') # R2 position as from potentiometer [mm]
|
||||||
|
except:
|
||||||
|
ret = 'Unable to create channel - ' + traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
return
|
||||||
|
|
||||||
|
end = 4.0 #go to R2
|
||||||
|
start = 3.0 #go to R1
|
||||||
|
setpoint2 = end
|
||||||
|
count = 0
|
||||||
|
test.log('Starting test sequence')
|
||||||
|
for setpoint1 in range(0, (loopTimes * 2)):
|
||||||
|
p1.addSeries(LinePlotSeries("Run"+str(count)))
|
||||||
|
sleep(delaySeconds) # Settling time between runs
|
||||||
|
# RegionPositioner idInkr
|
||||||
|
idCom.put(setpoint2, timeout=None) # TODO: Set appropriate timeout
|
||||||
|
count = count + 1
|
||||||
|
# scan for changes
|
||||||
|
for scanTimes in range(0, 100000):
|
||||||
|
sleep(samplePeriod)
|
||||||
|
currentTime = float(java.lang.System.currentTimeMillis())
|
||||||
|
|
||||||
|
MotorStatus = idMotorStatus.get()
|
||||||
|
LogicalPosition = idLogicalPosition.get()
|
||||||
|
PotiRaw = idPotiRaw.get()
|
||||||
|
BtvsRaw = idBtvsRaw.get()
|
||||||
|
Btvs = idBtvs.get()
|
||||||
|
MotorPosition = idMotorPosition.get()
|
||||||
|
PotiPosition = idPotiPosition.get()
|
||||||
|
PotiRef1Position = idPotiRef1Position.get()
|
||||||
|
PotiRef2Position = idPotiRef2Position.get()
|
||||||
|
Diameter = idDiameter.get()
|
||||||
|
Inkr = idInkr.get()
|
||||||
|
InkrRb = idInkrRb.get()
|
||||||
|
|
||||||
|
idDiff01 = MotorPosition - Btvs
|
||||||
|
|
||||||
|
scan.append([currentTime], [currentTime],
|
||||||
|
[Btvs, PotiPosition, MotorStatus, Inkr, InkrRb, Diameter, LogicalPosition,
|
||||||
|
BtvsRaw, MotorPosition, PotiRaw, PotiRef1Position, PotiRef2Position])
|
||||||
|
|
||||||
|
p1.getSeries(count).appendData(currentTime, idDiff01)
|
||||||
|
|
||||||
|
#extract Status bits
|
||||||
|
endH = bool(int(MotorStatus) & 8) #Ref2 (high limit)
|
||||||
|
endL = bool(int(MotorStatus) & 4) #Ref1 (low limit)
|
||||||
|
|
||||||
|
#check if arrived to R1 or R2
|
||||||
|
if endH:
|
||||||
|
# invert direction and swap start with end of translation
|
||||||
|
setpoint2 = start
|
||||||
|
test.log('Reached R2 switch, changing target to R1')
|
||||||
|
break
|
||||||
|
elif endL:
|
||||||
|
# invert direction and swap start with end of translation
|
||||||
|
setpoint2 = end
|
||||||
|
test.log('Reached R1 switch, changing target to R2')
|
||||||
|
break
|
||||||
|
#check if any error bit is raised
|
||||||
|
if bool(int(MotorStatus) & int('10000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Motor switched off (bit#4)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('100000',2)): #error: abort test
|
||||||
|
test.sendFeedback('No motor link (bit#5)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('1000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('No poti link (bit#6)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('10000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Calibration error (bit#7)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('100000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Cannot get to R1 (bit#8)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('1000000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Cannot get to R2 (bit#9)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('10000000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Position measurement mismatch (bit#10)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('100000000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Movement timeout (bit#11)', False)
|
||||||
|
return
|
||||||
|
|
||||||
|
# Closing channels
|
||||||
|
idMotorStatus.close()
|
||||||
|
idLogicalPosition.close()
|
||||||
|
idPotiRaw.close()
|
||||||
|
idBtvsRaw.close()
|
||||||
|
idBtvs.close()
|
||||||
|
idMotorPosition.close()
|
||||||
|
idPotiPosition.close()
|
||||||
|
idPotiRef1Position.close()
|
||||||
|
idPotiRef2Position.close()
|
||||||
|
idDiameter.close()
|
||||||
|
idCom.close()
|
||||||
|
idInkr.close()
|
||||||
|
idInkrRb.close()
|
||||||
|
|
||||||
|
scan.end()
|
||||||
|
ret = 'Slide moved back and forth (' + str(count) + ' runs)'
|
||||||
|
success = True
|
||||||
|
|
||||||
|
################ END OF YOUR CODE ################
|
||||||
|
###### Final - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
|
||||||
|
# just in case the feedback was forgotten
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
except:
|
||||||
|
# generic error handler
|
||||||
|
ret = traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
|
||||||
|
|
||||||
|
# launch the test
|
||||||
|
startTest(test, device, parameters)
|
||||||
@@ -0,0 +1,178 @@
|
|||||||
|
# Script Motor Test 1
|
||||||
|
# Moves to CCW switch; then for M times moves N times to CW switch then CCW switch; between each M pauses for delay; log at CCW and CW
|
||||||
|
|
||||||
|
|
||||||
|
###### Init - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
global sys, inspect, os, traceback
|
||||||
|
import sys, inspect, os, traceback
|
||||||
|
|
||||||
|
|
||||||
|
def startTest(testName, DEVICE, params):
|
||||||
|
# by default, assume the test failed
|
||||||
|
ret = 'Test failed'
|
||||||
|
success = False
|
||||||
|
# plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||||
|
plotName = DEVICE + ' - ' + testName
|
||||||
|
# put the whole custom code under try/catch
|
||||||
|
try:
|
||||||
|
# get the path of this script
|
||||||
|
testPath = inspect.getfile(inspect.currentframe())
|
||||||
|
# init the testing tool class. It can be sued in the following ways:
|
||||||
|
test = TestingTool(testName, testPath, DEVICE, params)
|
||||||
|
|
||||||
|
######### WRITE YOUR CODE HERE BELOW #############
|
||||||
|
|
||||||
|
# DEVICE = 'PO2DV-NCS-LS'
|
||||||
|
# get parameters from the calling interface
|
||||||
|
try:
|
||||||
|
test.log("Running test with the following parameters:")
|
||||||
|
test.log(params)
|
||||||
|
loopTimes = int(test.getParam("repeatTimes"))
|
||||||
|
delaySeconds = int(test.getParam("delayS"))
|
||||||
|
samplePeriod = 0.05 #seconds
|
||||||
|
except:
|
||||||
|
ret = 'Could not retrieve testing parameters - ' + traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
return
|
||||||
|
|
||||||
|
scan = ManualScan(['time [1/'+ str(1/samplePeriod) + ' s]'], ['Btvs (IST3:2)', 'Poti Position (IST2:1)',
|
||||||
|
'Motor Status (STA:1)', 'Inkr (INKR:2)', 'InkrRb (INKRRB:2)',
|
||||||
|
'Diameter (DIAM:2)', 'Logical Position (IST:2)',
|
||||||
|
'Btvs Raw (IST3:1)','Motor Position (IST1:2)',
|
||||||
|
'Poti Raw (POSA:1)', 'Poti Ref1 Position (REF1:1)', 'Poti Ref2 Position (REF2:1)'])
|
||||||
|
p1 = plot(None, name = "Poti Pos From Beam - Motor Position", context = plotName + " pos difference")[0]
|
||||||
|
scan.setPlotTitle(plotName)
|
||||||
|
scan.start()
|
||||||
|
# Creating channels: dimension 1
|
||||||
|
try:
|
||||||
|
idMotorStatus = Channel(DEVICE + ':STA:1' , type = 'd') # DSP device_status reg
|
||||||
|
idLogicalPosition = Channel(DEVICE + ':IST:2' , type = 'd') # Shows current position in logical units as calculated from motor step counter [1..n]
|
||||||
|
idPotiRaw = Channel(DEVICE + ':POSA:1' , type = 'd') # poti raw data [ADC units]
|
||||||
|
idBtvsRaw = Channel(DEVICE + ':IST3:1' , type = 'd') # shows current position in steps as as obtained from motor step counter [steps]
|
||||||
|
idInkr = Channel(DEVICE + ':INKR:2' , type = 'd') # move relative distance (positive means towards R2) [mm]
|
||||||
|
idInkrRb = Channel(DEVICE + ':INKRRB:2' , type = 'd') # readback of move relative distance (positive means towards R2) [mm]
|
||||||
|
idDiameter = Channel(DEVICE + ':DIAM:2' , type = 'd') # collimator diameter [mm]
|
||||||
|
idCom = Channel(DEVICE + ':COM:2' , type = 'd') # current position as from motor step counter [mm]
|
||||||
|
idBtvs = Channel(DEVICE + ':IST3:2' , type = 'd') # current position as from motor step counter [mm]
|
||||||
|
idMotorPosition = Channel(DEVICE + ':IST1:2' , type = 'd') # current position from beam as from potentiometer [mm]
|
||||||
|
idPotiPosition = Channel(DEVICE + ':IST2:1' , type = 'd') # current position as from potentiometer [mm]
|
||||||
|
idPotiRef1Position = Channel(DEVICE + ':REF1:1' , type = 'd') # R1 position as from potentiometer [mm]
|
||||||
|
idPotiRef2Position = Channel(DEVICE + ':REF2:1' , type = 'd') # R2 position as from potentiometer [mm]
|
||||||
|
except:
|
||||||
|
ret = 'Unable to create channel - ' + traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
return
|
||||||
|
|
||||||
|
end = 4.0 #go to R2
|
||||||
|
start = 3.0 #go to R1
|
||||||
|
setpoint2 = end
|
||||||
|
count = 0
|
||||||
|
test.log('Starting test sequence')
|
||||||
|
for setpoint1 in range(0, (loopTimes * 2)):
|
||||||
|
p1.addSeries(LinePlotSeries("Run"+str(count)))
|
||||||
|
sleep(delaySeconds) # Settling time between runs
|
||||||
|
# RegionPositioner idInkr
|
||||||
|
idCom.put(setpoint2, timeout=None) # TODO: Set appropriate timeout
|
||||||
|
count = count + 1
|
||||||
|
# scan for changes
|
||||||
|
for scanTimes in range(0, 100000):
|
||||||
|
sleep(samplePeriod)
|
||||||
|
currentTime = float(java.lang.System.currentTimeMillis())
|
||||||
|
|
||||||
|
MotorStatus = idMotorStatus.get()
|
||||||
|
LogicalPosition = idLogicalPosition.get()
|
||||||
|
PotiRaw = idPotiRaw.get()
|
||||||
|
BtvsRaw = idBtvsRaw.get()
|
||||||
|
Btvs = idBtvs.get()
|
||||||
|
MotorPosition = idMotorPosition.get()
|
||||||
|
PotiPosition = idPotiPosition.get()
|
||||||
|
PotiRef1Position = idPotiRef1Position.get()
|
||||||
|
PotiRef2Position = idPotiRef2Position.get()
|
||||||
|
Diameter = idDiameter.get()
|
||||||
|
Inkr = idInkr.get()
|
||||||
|
InkrRb = idInkrRb.get()
|
||||||
|
|
||||||
|
idDiff01 = PotiPosition - Btvs
|
||||||
|
|
||||||
|
scan.append([currentTime], [currentTime],
|
||||||
|
[Btvs , PotiPosition, MotorStatus, Inkr, InkrRb, Diameter, LogicalPosition,
|
||||||
|
BtvsRaw , MotorPosition, PotiRaw, PotiRef1Position, PotiRef2Position])
|
||||||
|
|
||||||
|
p1.getSeries(count).appendData(currentTime, idDiff01)
|
||||||
|
|
||||||
|
#extract Status bits
|
||||||
|
endH = bool(int(MotorStatus) & 8) #Ref2 (high limit)
|
||||||
|
endL = bool(int(MotorStatus) & 4) #Ref1 (low limit)
|
||||||
|
|
||||||
|
#check if arrived to R1 or R2
|
||||||
|
if endH:
|
||||||
|
# invert direction and swap start with end of translation
|
||||||
|
setpoint2 = start
|
||||||
|
test.log('Reached R2 switch, changing target to R1')
|
||||||
|
break
|
||||||
|
elif endL:
|
||||||
|
# invert direction and swap start with end of translation
|
||||||
|
setpoint2 = end
|
||||||
|
test.log('Reached R1 switch, changing target to R2')
|
||||||
|
break
|
||||||
|
#check if any error bit is raised
|
||||||
|
if bool(int(MotorStatus) & int('10000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Motor switched off (bit#4)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('100000',2)): #error: abort test
|
||||||
|
test.sendFeedback('No motor link (bit#5)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('1000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('No poti link (bit#6)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('10000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Calibration error (bit#7)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('100000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Cannot get to R1 (bit#8)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('1000000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Cannot get to R2 (bit#9)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('10000000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Position measurement mismatch (bit#10)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('100000000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Movement timeout (bit#11)', False)
|
||||||
|
return
|
||||||
|
|
||||||
|
# Closing channels
|
||||||
|
idMotorStatus.close()
|
||||||
|
idLogicalPosition.close()
|
||||||
|
idPotiRaw.close()
|
||||||
|
idBtvsRaw .close()
|
||||||
|
idBtvs.close()
|
||||||
|
idMotorPosition.close()
|
||||||
|
idPotiPosition.close()
|
||||||
|
idPotiRef1Position.close()
|
||||||
|
idPotiRef2Position.close()
|
||||||
|
idDiameter.close()
|
||||||
|
idCom.close()
|
||||||
|
idInkr.close()
|
||||||
|
idInkrRb.close()
|
||||||
|
|
||||||
|
scan.end()
|
||||||
|
ret = 'Slide moved back and forth (' + str(count) + ' runs)'
|
||||||
|
success = True
|
||||||
|
|
||||||
|
################ END OF YOUR CODE ################
|
||||||
|
###### Final - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
|
||||||
|
# just in case the feedback was forgotten
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
except:
|
||||||
|
# generic error handler
|
||||||
|
ret = traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
|
||||||
|
|
||||||
|
# launch the test
|
||||||
|
startTest(test, device, parameters)
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<h2>Short Description</h2>
|
||||||
|
Moves to CW switch then CCW switch N times.
|
||||||
|
<h2>Details</h2>
|
||||||
|
Moves to CW switch then CCW switch N times.
|
||||||
|
<h2>Parameters</h2>
|
||||||
|
<code>repeatTimes</code> Repeat the moving N times<br/>
|
||||||
|
<code>delayS</code> Pause delay between each repetition [s]
|
||||||
|
<h2>Contact</h2>
|
||||||
|
<a href="https://intranet.psi.ch/Main/MarcoBoccioli">Marco Boccioli </a>
|
||||||
|
</html>
|
||||||
|
</body>
|
||||||
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
name=Motor Test 2
|
||||||
|
description=Go to absolute position A, then move +B steps, then -2B steps, then +2Bsteps (ie oscillate round centre position, logging after each movement); repeat N times
|
||||||
|
|
||||||
|
|
||||||
|
#optional parameters. Description is compulsory. Syntax&
|
||||||
|
#parameters=<parameter1Name>&<parameter1Value>&<Parameter 1 description>[;<parameter2Name>&<parameter2Value>&<Parameter 2 description>]
|
||||||
|
parameters=repeatTimes&1&Repeat N times;midPoint&41.0&Middle point A [mm];spanFromMidPoint&2.0&B steps around middle point A [integer];translationStep&5.0&Step lenght [mm]
|
||||||
@@ -0,0 +1,206 @@
|
|||||||
|
# Script Motor Test 2 for production system
|
||||||
|
# Go to absolute position A, then move +B steps, then -2B steps, then +2Bsteps (ie oscillate round centre position, logging after each movement); repeat N times
|
||||||
|
|
||||||
|
###### Init - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
global sys, inspect, os, traceback
|
||||||
|
import sys, inspect, os, traceback
|
||||||
|
|
||||||
|
|
||||||
|
def startTest(testName, DEVICE, params):
|
||||||
|
# by default, assume the test failed
|
||||||
|
ret = 'Test failed'
|
||||||
|
success = False
|
||||||
|
# plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||||
|
plotName = DEVICE + ' - ' + testName
|
||||||
|
# put the whole custom code under try/catch
|
||||||
|
try:
|
||||||
|
# get the path of this script
|
||||||
|
testPath = inspect.getfile(inspect.currentframe())
|
||||||
|
# init the testing tool class. It can be sued in the following ways:
|
||||||
|
test = TestingTool(testName, testPath, DEVICE, params)
|
||||||
|
|
||||||
|
######### WRITE YOUR CODE HERE BELOW #############
|
||||||
|
|
||||||
|
# get parameters from the calling interface
|
||||||
|
try:
|
||||||
|
test.log("Running test with the following parameters:")
|
||||||
|
test.log(params)
|
||||||
|
middle = float(test.getParam("midPoint"))
|
||||||
|
loopTimes = int(test.getParam("repeatTimes"))
|
||||||
|
span = float(test.getParam("spanFromMidPoint"))
|
||||||
|
translationStep = float(test.getParam("translationStep")) # each translation will be this amount of mm
|
||||||
|
settlingTime = 0.2 # seconds
|
||||||
|
except:
|
||||||
|
ret = 'Could not retrieve testing parameters - ' + traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
return
|
||||||
|
|
||||||
|
scan = ManualScan(['time [1/'+ str(1/settlingTime) + ' s]'], ['Btvs Poti Position (IST3:2)', 'Mcs Poti Position (IST2:1)',
|
||||||
|
'Motor Status (STA:1)', 'Inkr (INKR:2)', 'InkrRb (INKRRB:2)',
|
||||||
|
'Diameter (DIAM:2)', 'Logical Position (IST:2)',
|
||||||
|
'Btvs Raw (IST3:1)','Motor Position (IST1:2)',
|
||||||
|
'Poti Raw (POSA:1)', 'Poti Ref1 Position (REF1:1)', 'Poti Ref2 Position (REF2:1)'])
|
||||||
|
scan.setPlotTitle(plotName)
|
||||||
|
scan.start()
|
||||||
|
# coloured plot (one colour per scan)
|
||||||
|
p1 = plot(None, name="Motor Position - Btvs Poti Position", context=plotName + " difference")[0]
|
||||||
|
|
||||||
|
# Creating channels: dimension 1
|
||||||
|
try:
|
||||||
|
idMotorStatus = Channel(DEVICE + ':STA:1' , type = 'd') # DSP device_status reg
|
||||||
|
idLogicalPosition = Channel(DEVICE + ':IST:2' , type = 'd') # Shows current position in logical units as calculated from motor step counter [1..n]
|
||||||
|
idPotiRaw = Channel(DEVICE + ':POSA:1' , type = 'd') # poti raw data [ADC units]
|
||||||
|
idBtvsRaw = Channel(DEVICE + ':IST3:1' , type = 'd') # shows current position in steps as as obtained from motor step counter [steps]
|
||||||
|
idInkr = Channel(DEVICE + ':INKR:2' , type = 'd') # move relative distance (positive means towards R2) [mm]
|
||||||
|
idInkrRb = Channel(DEVICE + ':INKRRB:2' , type = 'd') # readback of move relative distance (positive means towards R2) [mm]
|
||||||
|
idDiameter = Channel(DEVICE + ':DIAM:2' , type = 'd') # collimator diameter [mm]
|
||||||
|
idBtvs = Channel(DEVICE + ':IST3:2' , type = 'd') # current position as from motor step counter [mm]
|
||||||
|
idMotorPosition = Channel(DEVICE + ':IST1:2' , type = 'd') # current position from beam as from potentiometer [mm]
|
||||||
|
idPotiPosition = Channel(DEVICE + ':IST2:1' , type = 'd') # current position as from potentiometer [mm]
|
||||||
|
idPotiRef1Position = Channel(DEVICE + ':REF1:1' , type = 'd') # R1 position as from potentiometer [mm]
|
||||||
|
idPotiRef2Position = Channel(DEVICE + ':REF2:1' , type = 'd') # R2 position as from potentiometer [mm]
|
||||||
|
idCom = Channel(DEVICE + ':COM:2' , type = 'd') # motor commands [0=Stop; 1=Calibrate; 2=gotoR1; 3=gotoR2]
|
||||||
|
except:
|
||||||
|
ret = 'Unable to create channel - ' + traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
# find position: it will be the middle point of the test
|
||||||
|
test.log('Moving to initial position R1')
|
||||||
|
idCom.put(2, timeout=None) # go to R1 start limit
|
||||||
|
test.log('Moving to middle point ' + str(middle))
|
||||||
|
idInkr.put(middle, timeout=None) # TODO: Set appropriate timeout
|
||||||
|
if abs(readback2 - middle) > 5: # TODO: Check accuracy
|
||||||
|
ret = 'Actor idInkr could not be set to the value ' + str(middle) + ' (current value: ' + str(readback2) + ')'
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
return
|
||||||
|
direction = 1.0
|
||||||
|
count = 0
|
||||||
|
test.log('Moving around middle point (+-' + str(span) + ')')
|
||||||
|
for setpoint1 in range(0, (loopTimes * 2)):
|
||||||
|
count = count + 1
|
||||||
|
sleep(5) # Settling time
|
||||||
|
p1.addSeries(LinePlotSeries("Run" + str(count)))
|
||||||
|
# RegionPositioner idInkr
|
||||||
|
for setpoint2 in range(0, span+1):
|
||||||
|
idInkr.put(translationStep*direction, timeout=None)
|
||||||
|
sleep(settlingTime) # Settling time
|
||||||
|
currentTime = float(java.lang.System.currentTimeMillis())
|
||||||
|
|
||||||
|
MotorStatus = idMotorStatus.get()
|
||||||
|
LogicalPosition = idLogicalPosition.get()
|
||||||
|
PotiRaw = idPotiRaw.get()
|
||||||
|
BtvsRaw = idBtvsRaw.get()
|
||||||
|
Btvs = idBtvs.get()
|
||||||
|
MotorPosition = idMotorPosition.get()
|
||||||
|
PotiPosition = idPotiPosition.get()
|
||||||
|
PotiRef1Position = idPotiRef1Position.get()
|
||||||
|
PotiRef2Position = idPotiRef2Position.get()
|
||||||
|
Diameter = idDiameter.get()
|
||||||
|
Inkr = idInkr.get()
|
||||||
|
InkrRb = idInkrRb.get()
|
||||||
|
|
||||||
|
idDiff01 = MotorPosition - Btvs
|
||||||
|
|
||||||
|
# plots
|
||||||
|
scan.append([currentTime], [currentTime],
|
||||||
|
[Btvs, PotiPosition, MotorStatus, Inkr, InkrRb, Diameter, LogicalPosition,
|
||||||
|
BtvsRaw, MotorPosition, PotiRaw, PotiRef1Position, PotiRef2Position])
|
||||||
|
# plot error against position
|
||||||
|
p1.getSeries(count).appendData(MotorPosition, idDiff01)
|
||||||
|
|
||||||
|
# end of loop: invert direction
|
||||||
|
if setpoint2 == span:
|
||||||
|
direction = direction*(-1.0)
|
||||||
|
break
|
||||||
|
|
||||||
|
# check if reached end of span before the end of loop; if so, invert direction
|
||||||
|
if (direction > 0.0 and MotorPosition >= middle+span):
|
||||||
|
# invert direction and swap start with end of translation
|
||||||
|
direction = -1.0
|
||||||
|
test.log('End of span (' + str(MotorPosition) + '), changing direction to towards R1')
|
||||||
|
break
|
||||||
|
if (direction < 0.0 and MotorPosition <= middle-span):
|
||||||
|
# invert direction and swap start with end of translation
|
||||||
|
direction = 1.0
|
||||||
|
test.log('End of span (' + str(MotorPosition) + '), changing direction to towards R2')
|
||||||
|
break
|
||||||
|
|
||||||
|
# extract Status bits
|
||||||
|
endH = bool(int(MotorStatus) & 8) # Ref2 (high limit)
|
||||||
|
endL = bool(int(MotorStatus) & 4) # Ref1 (low limit)
|
||||||
|
# check if arrived to R1 or R2; if so, invert direction
|
||||||
|
if endH:
|
||||||
|
# invert direction and swap start with end of translation
|
||||||
|
direction = -1.0
|
||||||
|
test.log('Reached R2, changing direction to ' + str(direction))
|
||||||
|
break
|
||||||
|
elif endL:
|
||||||
|
# invert direction and swap start with end of translation
|
||||||
|
direction = 1.0
|
||||||
|
test.log('Reached R1, changing direction to ' + str(direction))
|
||||||
|
break
|
||||||
|
|
||||||
|
# check if any error bit is raised
|
||||||
|
if bool(int(MotorStatus) & int('10000',2)): # error: abort test
|
||||||
|
test.sendFeedback('Motor switched off (bit# 4)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('100000',2)): # error: abort test
|
||||||
|
test.sendFeedback('No motor link (bit# 5)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('1000000',2)): # error: abort test
|
||||||
|
test.sendFeedback('No poti link (bit# 6)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('10000000',2)): # error: abort test
|
||||||
|
test.sendFeedback('Calibration error (bit# 7)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('100000000',2)): # error: abort test
|
||||||
|
test.sendFeedback('Cannot get to R1 (bit# 8)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('1000000000',2)): # error: abort test
|
||||||
|
test.sendFeedback('Cannot get to R2 (bit# 9)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('10000000000',2)): # error: abort test
|
||||||
|
test.sendFeedback('Position measurement mismatch (bit# 10)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('100000000000',2)): # error: abort test
|
||||||
|
test.sendFeedback('Movement timeout (bit# 11)', False)
|
||||||
|
return
|
||||||
|
|
||||||
|
# Closing channels
|
||||||
|
idMotorStatus.close()
|
||||||
|
idLogicalPosition.close()
|
||||||
|
idPotiRaw.close()
|
||||||
|
idBtvsRaw.close()
|
||||||
|
idBtvs.close()
|
||||||
|
idMotorPosition.close()
|
||||||
|
idPotiPosition.close()
|
||||||
|
idPotiRef1Position.close()
|
||||||
|
idPotiRef2Position.close()
|
||||||
|
idDiameter.close()
|
||||||
|
idInkr.close()
|
||||||
|
idInkrRb.close()
|
||||||
|
idCom.close()
|
||||||
|
|
||||||
|
scan.end()
|
||||||
|
ret = 'Slide moved back and forth (' + str(count) + ' runs)'
|
||||||
|
success = True
|
||||||
|
|
||||||
|
################ END OF YOUR CODE ################
|
||||||
|
###### Final - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
|
||||||
|
# just in case the feedback was forgotten
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
except:
|
||||||
|
# generic error handler
|
||||||
|
ret = traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
|
||||||
|
|
||||||
|
# launch the test
|
||||||
|
startTest(test, device, parameters)
|
||||||
@@ -0,0 +1,209 @@
|
|||||||
|
# Script Motor Test 2 for production system
|
||||||
|
# Go to absolute position A, then move +B steps, then -2B steps, then +2Bsteps (ie oscillate round centre position, logging after each movement); repeat N times
|
||||||
|
|
||||||
|
###### Init - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
global sys, inspect, os, traceback
|
||||||
|
import sys, inspect, os, traceback
|
||||||
|
|
||||||
|
|
||||||
|
def startTest(testName, DEVICE, params):
|
||||||
|
# by default, assume the test failed
|
||||||
|
ret = 'Test failed'
|
||||||
|
success = False
|
||||||
|
# plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||||
|
plotName = DEVICE + ' - ' + testName
|
||||||
|
# put the whole custom code under try/catch
|
||||||
|
try:
|
||||||
|
# get the path of this script
|
||||||
|
testPath = inspect.getfile(inspect.currentframe())
|
||||||
|
# init the testing tool class. It can be sued in the following ways:
|
||||||
|
test = TestingTool(testName, testPath, DEVICE, params)
|
||||||
|
|
||||||
|
######### WRITE YOUR CODE HERE BELOW #############
|
||||||
|
|
||||||
|
# get parameters from the calling interface
|
||||||
|
try:
|
||||||
|
test.log("Running test with the following parameters:")
|
||||||
|
test.log(params)
|
||||||
|
middle = float(test.getParam("midPoint"))
|
||||||
|
loopTimes = int(test.getParam("repeatTimes"))
|
||||||
|
span = float(test.getParam("spanFromMidPoint"))
|
||||||
|
settlingTime = 0.2 #seconds
|
||||||
|
except:
|
||||||
|
ret = 'Could not retrieve testing parameters - ' + traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
return
|
||||||
|
|
||||||
|
scan = ManualScan(['time [1/'+ str(1/settlingTime) + ' s]'], ['Motor Pos (IST3:2)', 'Poti Position (IST2:1)',
|
||||||
|
'Motor Status (STA:1)', 'Inkr (INKR:2)', 'InkrRb (INKRRB:2)',
|
||||||
|
'Diameter (DIAM:2)', 'Logical Position (IST:2)',
|
||||||
|
'Motor Pos Raw (IST3:1)','Poti Pos From Beam (IST1:2)',
|
||||||
|
'Poti Raw (POSA:1)', 'Poti Ref1 Position (REF1:1)', 'Poti Ref2 Position (REF2:1)'])
|
||||||
|
scan.setPlotTitle(plotName)
|
||||||
|
scan.start()
|
||||||
|
# coloured plot (one colour per scan)
|
||||||
|
p1 = plot(None, name="Poti-Increment difference", context=plotName + " difference")[0]
|
||||||
|
p2 = plot(None, name="Poti-MotorPosition difference", context=plotName + " difference")[0]
|
||||||
|
|
||||||
|
# Creating channels: dimension 1
|
||||||
|
try:
|
||||||
|
idMotorStatus = Channel(DEVICE + ':STA:1' , type = 'd') # DSP device_status reg
|
||||||
|
idLogicalPosition = Channel(DEVICE + ':IST:2' , type = 'd') # Shows current position in logical units as calculated from motor step counter [1..n]
|
||||||
|
idPotiRaw = Channel(DEVICE + ':POSA:1' , type = 'd') # poti raw data [ADC units]
|
||||||
|
idMotorPositionRaw = Channel(DEVICE + ':IST3:1' , type = 'd') # shows current position in steps as as obtained from motor step counter [steps]
|
||||||
|
idInkr = Channel(DEVICE + ':INKR:2' , type = 'd') # move relative distance (positive means towards R2) [mm]
|
||||||
|
idInkrRb = Channel(DEVICE + ':INKRRB:2' , type = 'd') # readback of move relative distance (positive means towards R2) [mm]
|
||||||
|
idDiameter = Channel(DEVICE + ':DIAM:2' , type = 'd') # collimator diameter [mm]
|
||||||
|
idMotorPosition = Channel(DEVICE + ':IST3:2' , type = 'd') # current position as from motor step counter [mm]
|
||||||
|
idPotiPosFromBeam = Channel(DEVICE + ':IST1:2' , type = 'd') # current position from beam as from potentiometer [mm]
|
||||||
|
idPotiPosition = Channel(DEVICE + ':IST2:1' , type = 'd') # current position as from potentiometer [mm]
|
||||||
|
idPotiRef1Position = Channel(DEVICE + ':REF1:1' , type = 'd') # R1 position as from potentiometer [mm]
|
||||||
|
idPotiRef2Position = Channel(DEVICE + ':REF2:1' , type = 'd') # R2 position as from potentiometer [mm]
|
||||||
|
except:
|
||||||
|
ret = 'Unable to create channel - ' + traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
return
|
||||||
|
|
||||||
|
direction = 1.0
|
||||||
|
startDefault = middle - span
|
||||||
|
endDefault = middle + span
|
||||||
|
end = endDefault + 1
|
||||||
|
# find position: it will be the middle point of the test
|
||||||
|
test.log('Moving to middle point ' + str(middle))
|
||||||
|
idInkr.put(middle, timeout=None) # TODO: Set appropriate timeout
|
||||||
|
readback2 = idInkr.get()
|
||||||
|
if abs(readback2 - middle) > 5: # TODO: Check accuracy
|
||||||
|
ret = 'Actor idInkr could not be set to the value ' + str(middle) + ' (current value: ' + str(
|
||||||
|
readback2) + ')'
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
return
|
||||||
|
start = readback2 + direction
|
||||||
|
countSteps = 0
|
||||||
|
count = 0
|
||||||
|
test.log('Moving around middle point (+-' + str(span) + ')')
|
||||||
|
for setpoint1 in range(0, (loopTimes * 2)):
|
||||||
|
count = count + 1
|
||||||
|
sleep(5) # Settling time
|
||||||
|
p1.addSeries(LinePlotSeries("Run" + str(count)))
|
||||||
|
# RegionPositioner idInkr
|
||||||
|
for setpoint2 in frange(start, end, direction):
|
||||||
|
readback1 = setpoint1
|
||||||
|
idInkr.put(setpoint2, timeout=None) # TODO: Set appropriate timeout
|
||||||
|
sleep(settlingTime) # Settling time
|
||||||
|
readback2 = idInkr.get()
|
||||||
|
|
||||||
|
MotorStatus = idMotorStatus.get()
|
||||||
|
LogicalPosition = idLogicalPosition.get()
|
||||||
|
PotiRaw = idPotiRaw.get()
|
||||||
|
MotorPositionRaw = idMotorPositionRaw.get()
|
||||||
|
MotorPosition = idMotorPosition.get()
|
||||||
|
PotiPosFromBeam = idPotiPosFromBeam.get()
|
||||||
|
PotiPosition = idPotiPosition.get()
|
||||||
|
PotiRef1Position = idPotiRef1Position.get()
|
||||||
|
PotiRef2Position = idPotiRef2Position.get()
|
||||||
|
Diameter = idDiameter.get()
|
||||||
|
Inkr = idInkr.get()
|
||||||
|
InkrRb = idInkrRb.get()
|
||||||
|
|
||||||
|
idDiff01 = PotiPosition - MotorPosition
|
||||||
|
countSteps = countSteps + 1
|
||||||
|
scan.append([setpoint2], [setpoint2],
|
||||||
|
[MotorPosition, PotiPosition, MotorStatus, Inkr, InkrRb, Diameter, LogicalPosition,
|
||||||
|
MotorPositionRaw, PotiPosFromBeam, PotiRaw, PotiRef1Position, PotiRef2Position])
|
||||||
|
p1.getSeries(count).appendData(setpoint2, idDiff01)
|
||||||
|
if (direction > 0.0 and setpoint2 >= end - 1):
|
||||||
|
# invert direction and swap start with end of translation
|
||||||
|
end = startDefault - 1
|
||||||
|
start = setpoint2 - direction
|
||||||
|
direction = -1.0
|
||||||
|
test.log('End of span (' + str(setpoint2) + '), changing direction to ' + str(direction))
|
||||||
|
break
|
||||||
|
if (direction < 0.0 and setpoint2 <= end + 1):
|
||||||
|
# invert direction and swap start with end of translation
|
||||||
|
end = endDefault + 1
|
||||||
|
start = setpoint2 - direction
|
||||||
|
direction = 1.0
|
||||||
|
test.log('End of span (' + str(setpoint2) + '), changing direction to ' + str(direction))
|
||||||
|
break
|
||||||
|
|
||||||
|
|
||||||
|
#extract Status bits
|
||||||
|
endH = bool(int(MotorStatus) & 8) #Ref2 (high limit)
|
||||||
|
endL = bool(int(MotorStatus) & 4) #Ref1 (low limit)
|
||||||
|
|
||||||
|
#check if arrived to R1 or R2; if so, invert direction
|
||||||
|
if endH:
|
||||||
|
# invert direction and swap start with end of translation
|
||||||
|
end = startDefault - 1
|
||||||
|
start = setpoint2 - direction
|
||||||
|
direction = -1.0
|
||||||
|
test.log('Reached R2 switch, changing direction to ' + str(direction))
|
||||||
|
break
|
||||||
|
elif endL:
|
||||||
|
# invert direction and swap start with end of translation
|
||||||
|
end = endDefault + 1
|
||||||
|
start = setpoint2 - direction
|
||||||
|
direction = 1.0
|
||||||
|
test.log('Reached R1 switch, changing direction to ' + str(direction))
|
||||||
|
break
|
||||||
|
#check if any error bit is raised
|
||||||
|
if bool(int(MotorStatus) & int('10000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Motor switched off (bit#4)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('100000',2)): #error: abort test
|
||||||
|
test.sendFeedback('No motor link (bit#5)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('1000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('No poti link (bit#6)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('10000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Calibration error (bit#7)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('100000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Cannot get to R1 (bit#8)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('1000000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Cannot get to R2 (bit#9)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('10000000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Position measurement mismatch (bit#10)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('100000000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Movement timeout (bit#11)', False)
|
||||||
|
return
|
||||||
|
|
||||||
|
# Closing channels
|
||||||
|
idMotorStatus.close()
|
||||||
|
idLogicalPosition.close()
|
||||||
|
idPotiRaw.close()
|
||||||
|
idMotorPositionRaw.close()
|
||||||
|
idMotorPosition.close()
|
||||||
|
idPotiPosFromBeam.close()
|
||||||
|
idPotiPosition.close()
|
||||||
|
idPotiRef1Position.close()
|
||||||
|
idPotiRef2Position.close()
|
||||||
|
idDiameter.close()
|
||||||
|
idInkr.close()
|
||||||
|
idInkrRb.close()
|
||||||
|
|
||||||
|
scan.end()
|
||||||
|
ret = 'Slide moved back and forth (' + str(count) + ' runs)'
|
||||||
|
success = True
|
||||||
|
|
||||||
|
################ END OF YOUR CODE ################
|
||||||
|
###### Final - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
|
||||||
|
# just in case the feedback was forgotten
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
except:
|
||||||
|
# generic error handler
|
||||||
|
ret = traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
|
||||||
|
|
||||||
|
# launch the test
|
||||||
|
startTest(test, device, parameters)
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<h2>Short Description</h2>
|
||||||
|
Oscillate around a specified position
|
||||||
|
<h2>Details</h2>
|
||||||
|
Go to absolute position A, then move +B steps, then -2B steps, then +2Bsteps (ie oscillate round centre position, logging after each movement); repeat N times
|
||||||
|
<h2>Parameters</h2>
|
||||||
|
<code>repeatTimes</code> Repeat N times<br/>
|
||||||
|
<code>midPoint</code> Position A [mm]<br/>
|
||||||
|
<code>spanFromMidPoint</code> The B steps [integer]<br/>
|
||||||
|
<code>translationStep</code> Length of the movement per each traslation step [mm]<br/>
|
||||||
|
<h2>Contact</h2>
|
||||||
|
<a href="https://intranet.psi.ch/Main/MarcoBoccioli">Marco Boccioli </a>
|
||||||
|
</html>
|
||||||
|
</body>
|
||||||
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
name=Motor Test 3
|
||||||
|
description=Moves from CCW to CW as a series of discrete translations (C times) logs after each translation. When end switch is encountered change direction. Repeat N times
|
||||||
|
|
||||||
|
|
||||||
|
#optional parameters. Description is compulsory. Syntax&
|
||||||
|
#parameters=<parameter1Name>&<parameter1Value>&<Parameter 1 description>[;<parameter2Name>&<parameter2Value>&<Parameter 2 description>]
|
||||||
|
parameters=repeatTimes&1&Repeat N times;translation&2&Translation C steps
|
||||||
@@ -0,0 +1,212 @@
|
|||||||
|
#Script Motor Test 3
|
||||||
|
#Moves from CCW to CW as a series of discrete translations (C times) logs after each translation. When end switch is encountered change direction. Repeat N times
|
||||||
|
|
||||||
|
###### Init - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
global sys, inspect, os, traceback
|
||||||
|
import sys, inspect, os, traceback
|
||||||
|
|
||||||
|
def startTest(testName, DEVICE, params):
|
||||||
|
#by default, assume the test failed
|
||||||
|
ret = 'Test failed'
|
||||||
|
success = False
|
||||||
|
#plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||||
|
plotName = DEVICE + ' - ' + testName
|
||||||
|
#put the whole custom code under try/catch
|
||||||
|
try:
|
||||||
|
#get the path of this script
|
||||||
|
testPath = inspect.getfile(inspect.currentframe())
|
||||||
|
#init the testing tool class. It can be sued in the following ways:
|
||||||
|
test = TestingTool(testName, testPath, DEVICE, params)
|
||||||
|
|
||||||
|
######### WRITE YOUR CODE HERE BELOW #############
|
||||||
|
#get parameters from the calling interface
|
||||||
|
try:
|
||||||
|
test.log("Running test Motor Test 3 with the following parameters:")
|
||||||
|
test.log(params)
|
||||||
|
loopTimes = int(test.getParam("repeatTimes")) # C times
|
||||||
|
translation = int(test.getParam("translation")) # Increment mm
|
||||||
|
samplePeriod = 0.2 #seconds
|
||||||
|
except:
|
||||||
|
test.log("Could not retrieve testing parameters: ", sys.exc_info()[0])
|
||||||
|
ret = 'Could not retrieve testing parameters - ' + traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
return
|
||||||
|
|
||||||
|
scan = ManualScan(['time [1/'+ str(1/samplePeriod) + ' s]'], [
|
||||||
|
'Btvs Poti Position (IST3:2)',
|
||||||
|
'Mcs Poti Position (IST2:1)',
|
||||||
|
'Motor Status (STA:1)',
|
||||||
|
'Inkr (INKR:2)',
|
||||||
|
'InkrRb (INKRRB:2)',
|
||||||
|
'Diameter (DIAM:2)',
|
||||||
|
'Logical Position (IST:2)',
|
||||||
|
'Btvs Raw (IST3:1)',
|
||||||
|
'Motor Position (IST1:2)',
|
||||||
|
'Poti Raw (POSA:1)',
|
||||||
|
'Poti Ref1 Position (REF1:1)',
|
||||||
|
'Poti Ref2 Position (REF2:1)'])
|
||||||
|
scan.setPlotTitle(plotName)
|
||||||
|
scan.start()
|
||||||
|
p1 = plot(None, name = "Motor Position - Btvs Poti Position", context = plotName + " Motor-Poti difference")[0]
|
||||||
|
# Creating channels
|
||||||
|
try:
|
||||||
|
idMotorStatus = Channel(DEVICE + ':STA:1' , type = 'd') # DSP device_status reg
|
||||||
|
idLogicalPosition = Channel(DEVICE + ':IST:2' , type = 'd') # Shows current position in logical units as calculated from motor step counter [1..n]
|
||||||
|
idPotiRaw = Channel(DEVICE + ':POSA:1' , type = 'd') # poti raw data [ADC units]
|
||||||
|
idBtvsRaw = Channel(DEVICE + ':IST3:1' , type = 'd') # shows current position in steps as as obtained from motor step counter [steps]
|
||||||
|
idInkr = Channel(DEVICE + ':INKR:2' , type = 'd') # move relative distance (positive means towards R2) [mm]
|
||||||
|
idInkrRb = Channel(DEVICE + ':INKRRB:2' , type = 'd') # readback of move relative distance (positive means towards R2) [mm]
|
||||||
|
idDiameter = Channel(DEVICE + ':DIAM:2' , type = 'd') # collimator diameter [mm]
|
||||||
|
idBtvs = Channel(DEVICE + ':IST3:2' , type = 'd') # current position as from motor step counter [mm]
|
||||||
|
idMotorPosition = Channel(DEVICE + ':IST1:2' , type = 'd') # current position from beam as from potentiometer [mm]
|
||||||
|
idPotiPosition = Channel(DEVICE + ':IST2:1' , type = 'd') # current position as from potentiometer [mm]
|
||||||
|
idPotiRef1Position = Channel(DEVICE + ':REF1:1' , type = 'd') # R1 position as from potentiometer [mm]
|
||||||
|
idPotiRef2Position = Channel(DEVICE + ':REF2:1' , type = 'd') # R2 position as from potentiometer [mm]
|
||||||
|
idCom = Channel(DEVICE + ':COM:2' , type = 'd') # motor commands [0=Stop; 1=Calibrate; 2=gotoR1; 3=gotoR2]
|
||||||
|
|
||||||
|
except:
|
||||||
|
ret = 'Unable to create channel - ' + traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback( ret, success)
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
#go to position at Low end switch: it will be the starting point of the test
|
||||||
|
test.log('Homing')
|
||||||
|
idCom.put(2, timeout=10) # go to R1
|
||||||
|
# wait for motor to get to Ref1
|
||||||
|
for setpoint1 in range(0, 100):
|
||||||
|
sleep( 2 ) # Settling time
|
||||||
|
MotorStatus = idMotorStatus.get()
|
||||||
|
if bool(int(MotorStatus) & 4): # arrived at Ref1 (low limit)
|
||||||
|
break
|
||||||
|
if not bool(int(MotorStatus) & 4): # not arrived at Ref1 (low limit)
|
||||||
|
ret = 'Could not reach Ref1'
|
||||||
|
success = False
|
||||||
|
test.sendFeedback( ret, success)
|
||||||
|
return
|
||||||
|
|
||||||
|
direction = 1
|
||||||
|
countSteps = 0
|
||||||
|
test.log('Starting testing sequence')
|
||||||
|
count = 0
|
||||||
|
for setpoint1 in range(0, (loopTimes*2)):
|
||||||
|
count = count + 1
|
||||||
|
sleep( 2 ) # Settling time
|
||||||
|
# add multi cuve plot
|
||||||
|
p1.addSeries(LinePlotSeries("Run"+str(count)))
|
||||||
|
|
||||||
|
for setpoint2 in frange(0, 1000000):
|
||||||
|
|
||||||
|
idInkr.put(translation*direction, timeout=10)
|
||||||
|
sleep(samplePeriod) # Settling time
|
||||||
|
currentTime = float(java.lang.System.currentTimeMillis())
|
||||||
|
|
||||||
|
MotorStatus = idMotorStatus.get()
|
||||||
|
LogicalPosition = idLogicalPosition.get()
|
||||||
|
PotiRaw = idPotiRaw.get()
|
||||||
|
BtvsRaw = idBtvsRaw.get()
|
||||||
|
Btvs = idBtvs.get()
|
||||||
|
MotorPosition = idMotorPosition.get()
|
||||||
|
PotiPosition = idPotiPosition.get()
|
||||||
|
PotiRef1Position = idPotiRef1Position.get()
|
||||||
|
PotiRef2Position = idPotiRef2Position.get()
|
||||||
|
Diameter = idDiameter.get()
|
||||||
|
Inkr = idInkr.get()
|
||||||
|
InkrRb = idInkrRb.get()
|
||||||
|
|
||||||
|
idDiff01 = MotorPosition-Btvs
|
||||||
|
countSteps = countSteps + (translation*direction)
|
||||||
|
|
||||||
|
# multi plot
|
||||||
|
scan.append([currentTime], [currentTime],[
|
||||||
|
Btvs,
|
||||||
|
PotiPosition,
|
||||||
|
MotorStatus,
|
||||||
|
Inkr,
|
||||||
|
InkrRb,
|
||||||
|
Diameter,
|
||||||
|
LogicalPosition,
|
||||||
|
BtvsRaw,
|
||||||
|
MotorPosition,
|
||||||
|
PotiRaw,
|
||||||
|
PotiRef1Position,
|
||||||
|
PotiRef2Position])
|
||||||
|
# draw diff against steps
|
||||||
|
p1.getSeries(count).appendData(countSteps, idDiff01)
|
||||||
|
|
||||||
|
#extract Status bits
|
||||||
|
endH = bool(int(MotorStatus) & 8) #Ref2 (high limit)
|
||||||
|
endL = bool(int(MotorStatus) & 4) #Ref1 (low limit)
|
||||||
|
|
||||||
|
#check if arrived to R1 or R2
|
||||||
|
if endH:
|
||||||
|
#invert direction and swap start with end of translation
|
||||||
|
direction = -1
|
||||||
|
test.log('Reached R2 switch, changing target to R1')
|
||||||
|
break
|
||||||
|
elif endL:
|
||||||
|
#invert direction and swap start with end of translation
|
||||||
|
direction = 1
|
||||||
|
test.log('Reached R1 switch, changing target to R2')
|
||||||
|
break
|
||||||
|
|
||||||
|
#check if any error bit is raised
|
||||||
|
if bool(int(MotorStatus) & int('10000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Motor switched off (bit#4)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('100000',2)): #error: abort test
|
||||||
|
test.sendFeedback('No motor link (bit#5)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('1000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('No poti link (bit#6)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('10000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Calibration error (bit#7)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('100000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Cannot get to R1 (bit#8)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('1000000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Cannot get to R2 (bit#9)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('10000000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Position measurement mismatch (bit#10)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('100000000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Movement timeout (bit#11)', False)
|
||||||
|
return
|
||||||
|
|
||||||
|
#Closing channels
|
||||||
|
idMotorStatus.close()
|
||||||
|
idLogicalPosition.close()
|
||||||
|
idPotiRaw.close()
|
||||||
|
idBtvsRaw.close()
|
||||||
|
idBtvs.close()
|
||||||
|
idMotorPosition.close()
|
||||||
|
idPotiPosition.close()
|
||||||
|
idPotiRef1Position.close()
|
||||||
|
idPotiRef2Position.close()
|
||||||
|
idDiameter.close()
|
||||||
|
idInkr.close()
|
||||||
|
idInkrRb.close()
|
||||||
|
idCom.close()
|
||||||
|
|
||||||
|
scan.end()
|
||||||
|
ret = 'Slide moved back and forth (' + str(count) + ' runs)'
|
||||||
|
success = True
|
||||||
|
|
||||||
|
################ END OF YOUR CODE ################
|
||||||
|
###### Final - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
|
||||||
|
#just in case the feedback was forgotten
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
except:
|
||||||
|
#generic error handler
|
||||||
|
ret = traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
|
||||||
|
#launch the test
|
||||||
|
startTest(test, device, parameters)
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<h2>Description</h2>
|
||||||
|
Moves from CCW to CW as a series of discrete translations (C steps) logs after each translation. When end switch is encountered change direction. Repeat N times
|
||||||
|
<h2>Parameters</h2>
|
||||||
|
<code>repeatTimes </code>How many N times the test is repeated<br/>
|
||||||
|
<code>translation </code>How many C steps are done for one translation<br/>
|
||||||
|
|
||||||
|
<h2>Contact</h2>
|
||||||
|
<a href="https://intranet.psi.ch/search/#?t=phonebook&q=boccioli_m">boccioli_m</a>
|
||||||
|
</html>
|
||||||
|
</body>
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
name=Move Ref 1
|
||||||
|
description=Moves to the Reference 1 Position
|
||||||
|
filename=Move Ref 1.xml
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
|
||||||
|
###### DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
def startTest(testName, DEVICE, params):
|
||||||
|
#get the path of this script
|
||||||
|
testPath = inspect.getfile(inspect.currentframe())
|
||||||
|
#by default, failed
|
||||||
|
ret = 'Test failed'
|
||||||
|
success = False
|
||||||
|
#plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||||
|
plotName = DEVICE + ' - ' + testName
|
||||||
|
###### WRITE YOUR CODE HERE BELOW #######
|
||||||
|
#get parameters from the calling interface
|
||||||
|
print_log(testName, DEVICE, 'testpath: ' + testPath )
|
||||||
|
print_log(testName, DEVICE, 'parameters:' + str( params) )
|
||||||
|
print_log(testName, DEVICE, 'device: ' + DEVICE )
|
||||||
|
scan = ManualScan(['time'], ['idMotorStep', 'idPotiPosition', 'idPotiRef1Position','idMotorStep-idPotiPosition'] , [0.0], [30.0], [20])
|
||||||
|
scan.setPlotTitle(plotName)
|
||||||
|
scan.start()
|
||||||
|
|
||||||
|
#Creating channels: dimension 1
|
||||||
|
try:
|
||||||
|
idCom = Channel(DEVICE+':COM:2', type = 'd') #current position as from motor step counter [mm]
|
||||||
|
idMotorStep = Channel(DEVICE+':IST3:2', type = 'd') #current position as from motor step counter [mm]
|
||||||
|
idPotiPosFromBeam = Channel(DEVICE+':IST1:2', type = 'd') #current position from beam as from potentiometer [mm]
|
||||||
|
idPotiPosition = Channel(DEVICE+':IST2:1', type = 'd') #current position as from potentiometer [mm]
|
||||||
|
idPotiRef1Position = Channel(DEVICE+':REF1:1', type = 'd') #R1 position as from potentiometer [mm]
|
||||||
|
idPotiRef2Position = Channel(DEVICE+':REF2:1', type = 'd') #R2 position as from potentiometer [mm]
|
||||||
|
|
||||||
|
except:
|
||||||
|
sendFeedback(testPath, testName, DEVICE, 'Unable to create channel - ' + traceback.format_exc(), False)
|
||||||
|
#raise Exception('Unable to create channel - ' + traceback.format_exc())
|
||||||
|
return
|
||||||
|
|
||||||
|
idCom.put('3', timeout=None) # go to R1
|
||||||
|
print_log(testName, DEVICE, 'Moving to reference point')
|
||||||
|
#scan quickly the output during some seconds
|
||||||
|
detector4 = idPotiPosition.get()
|
||||||
|
detector6 = idPotiRef2Position.get()
|
||||||
|
timeElapsed=0
|
||||||
|
while detector4>detector6 and timeElapsed<600:
|
||||||
|
#Detector time
|
||||||
|
detector1 = float(java.lang.System.currentTimeMillis())
|
||||||
|
|
||||||
|
detector2 = idMotorStep.get()
|
||||||
|
detector3 = idPotiPosFromBeam.get()
|
||||||
|
detector4 = idPotiPosition.get()
|
||||||
|
detector5 = idPotiRef1Position.get()
|
||||||
|
detector6 = idPotiRef2Position.get()
|
||||||
|
diff1 = detector2-detector4
|
||||||
|
scan.append ([detector1], [detector1], [detector2, detector4, detector5, diff1])
|
||||||
|
sleep( 0.1 ) # Settling time
|
||||||
|
timeElapsed=timeElapsed+1
|
||||||
|
|
||||||
|
#Closing channels
|
||||||
|
idCom.close()
|
||||||
|
idMotorStep.close()
|
||||||
|
idPotiPosFromBeam.close()
|
||||||
|
idPotiPosition.close()
|
||||||
|
idPotiRef1Position.close()
|
||||||
|
idPotiRef2Position.close()
|
||||||
|
print_log(testName, DEVICE, ' Reference point reached')
|
||||||
|
|
||||||
|
########## END OF YOUR CODE ###########
|
||||||
|
|
||||||
|
###### DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
sendFeedback(testPath, testName, DEVICE, ret, success)
|
||||||
|
|
||||||
|
#prepare and send feedback to calling tool
|
||||||
|
def sendFeedback(testPath, testName, DEVICE, returnString, testPassed):
|
||||||
|
print_log(testName, DEVICE, 'End of test. Result:')
|
||||||
|
print_log(testName, DEVICE, 'Test path: ' + testPath)
|
||||||
|
print_log(testName, DEVICE, 'Test name: ' + testName )
|
||||||
|
print_log(testName, DEVICE, 'Device: ' + DEVICE)
|
||||||
|
print_log(testName, DEVICE, 'Test passed: ' + str(testPassed))
|
||||||
|
print_log(testName, DEVICE, 'Return string: ' + returnString)
|
||||||
|
ret = [testPath, DEVICE, returnString, testPassed]
|
||||||
|
set_return(ret)
|
||||||
|
|
||||||
|
def print_log(testName, DEVICE, text):
|
||||||
|
time.ctime()
|
||||||
|
now = time.strftime('%Y.%m.%d %H:%M:%S')
|
||||||
|
print now + ' ' + DEVICE + ' - ' + testName + ': ' + text
|
||||||
|
|
||||||
|
import sys, inspect, os, traceback
|
||||||
|
#get test arguments
|
||||||
|
DEVICE = device
|
||||||
|
testName = test
|
||||||
|
params = parameters
|
||||||
|
#launch the test
|
||||||
|
startTest(testName, DEVICE, params)
|
||||||
@@ -0,0 +1,144 @@
|
|||||||
|
|
||||||
|
# Drive to R1
|
||||||
|
|
||||||
|
###### Init - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
global sys, inspect, os, traceback
|
||||||
|
import sys, inspect, os, traceback
|
||||||
|
|
||||||
|
|
||||||
|
def startTest(testName, DEVICE, params):
|
||||||
|
# by default, assume the test failed
|
||||||
|
ret = 'Test failed'
|
||||||
|
success = False
|
||||||
|
# plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||||
|
plotName = DEVICE + ' - ' + testName
|
||||||
|
# put the whole custom code under try/catch
|
||||||
|
try:
|
||||||
|
# get the path of this script
|
||||||
|
testPath = inspect.getfile(inspect.currentframe())
|
||||||
|
# init the testing tool class. It can be sued in the following ways:
|
||||||
|
test = TestingTool(testName, testPath, DEVICE, params)
|
||||||
|
samplePeriod = 0.1
|
||||||
|
|
||||||
|
######### WRITE YOUR CODE HERE BELOW #############
|
||||||
|
scan = ManualScan(['time [1/'+ str(1/samplePeriod) + ' s]'], ['Motor Pos (IST3:2)', 'Poti Position (IST2:1)',
|
||||||
|
'Motor Status (STA:1)', 'Inkr (INKR:2)', 'InkrRb (INKRRB:2)',
|
||||||
|
'Diameter (DIAM:2)', 'Com (COM:2)', 'Logical Position (IST:2)',
|
||||||
|
'Motor Pos Raw (IST3:1)','Poti Pos From Beam (IST1:2)',
|
||||||
|
'Poti Raw (POSA:1)', 'Poti Ref1 Position (REF1:1)', 'Poti Ref2 Position (REF2:1)'])
|
||||||
|
scan.setPlotTitle(plotName)
|
||||||
|
scan.start()
|
||||||
|
|
||||||
|
try:
|
||||||
|
idMotorStatus = Channel(DEVICE + ':STA:1' , type = 'd') # DSP device_status reg
|
||||||
|
idLogicalPosition = Channel(DEVICE + ':IST:2' , type = 'd') # Shows current position in logical units as calculated from motor step counter [1..n]
|
||||||
|
idPotiRaw = Channel(DEVICE + ':POSA:1' , type = 'd') # poti raw data [ADC units]
|
||||||
|
idMotorPositionRaw = Channel(DEVICE + ':IST3:1' , type = 'd') # shows current position in steps as as obtained from motor step counter [steps]
|
||||||
|
idInkr = Channel(DEVICE + ':INKR:2' , type = 'd') # move relative distance (positive means towards R2) [mm]
|
||||||
|
idInkrRb = Channel(DEVICE + ':INKRRB:2' , type = 'd') # readback of move relative distance (positive means towards R2) [mm]
|
||||||
|
idDiameter = Channel(DEVICE + ':DIAM:2' , type = 'd') # collimator diameter [mm]
|
||||||
|
idCom = Channel(DEVICE + ':COM:2' , type = 'd') # current position as from motor step counter [mm]
|
||||||
|
idMotorPosition = Channel(DEVICE + ':IST3:2' , type = 'd') # current position as from motor step counter [mm]
|
||||||
|
idPotiPosFromBeam = Channel(DEVICE + ':IST1:2' , type = 'd') # current position from beam as from potentiometer [mm]
|
||||||
|
idPotiPosition = Channel(DEVICE + ':IST2:1' , type = 'd') # current position as from potentiometer [mm]
|
||||||
|
idPotiRef1Position = Channel(DEVICE + ':REF1:1' , type = 'd') # R1 position as from potentiometer [mm]
|
||||||
|
idPotiRef2Position = Channel(DEVICE + ':REF2:1' , type = 'd') # R2 position as from potentiometer [mm]
|
||||||
|
|
||||||
|
idCom.put('3', timeout=None) # go to R1
|
||||||
|
sleep( samplePeriod ) # Settling time
|
||||||
|
except:
|
||||||
|
ret = 'Unable to create channel - ' + traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback( ret, success)
|
||||||
|
return
|
||||||
|
|
||||||
|
#scan for a while to collect data
|
||||||
|
for setpoint1 in range(0, 10000):
|
||||||
|
sleep( samplePeriod ) # Settling time
|
||||||
|
|
||||||
|
MotorStatus = idMotorStatus.get()
|
||||||
|
LogicalPosition = idLogicalPosition.get()
|
||||||
|
PotiRaw = idPotiRaw.get()
|
||||||
|
MotorPositionRaw = idMotorPositionRaw.get()
|
||||||
|
Com = idCom.get()
|
||||||
|
MotorPosition = idMotorPosition.get()
|
||||||
|
PotiPosFromBeam = idPotiPosFromBeam.get()
|
||||||
|
PotiPosition = idPotiPosition.get()
|
||||||
|
PotiRef1Position = idPotiRef1Position.get()
|
||||||
|
PotiRef2Position = idPotiRef2Position.get()
|
||||||
|
Diameter = idDiameter.get()
|
||||||
|
Inkr = idInkr.get()
|
||||||
|
InkrRb = idInkrRb.get()
|
||||||
|
|
||||||
|
|
||||||
|
scan.append([setpoint2], [setpoint2],
|
||||||
|
[MotorPosition, PotiPosition, MotorStatus, Inkr, InkrRb, Diameter, Com, LogicalPosition,
|
||||||
|
MotorPositionRaw, PotiPosFromBeam, PotiRaw, PotiRef1Position, PotiRef2Position])
|
||||||
|
|
||||||
|
if (MotorStatus & int('1',2))==0: #device finished calibration (bit#1)
|
||||||
|
#give the device some time before stating that it has really finished
|
||||||
|
countDeviceInModeIdle = countDeviceInModeIdle +1
|
||||||
|
if countDeviceInModeIdle == 10:
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
countDeviceInModeIdle = 0
|
||||||
|
|
||||||
|
#check if any error bit is raised
|
||||||
|
if bool(int(MotorStatus) & int('10000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Motor switched off (bit#4)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('100000',2)): #error: abort test
|
||||||
|
test.sendFeedback('No motor link (bit#5)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('1000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('No poti link (bit#6)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('10000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Calibration error (bit#7)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('100000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Cannot get to R1 (bit#8)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('1000000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Cannot get to R2 (bit#9)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('10000000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Position measurement mismatch (bit#10)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('100000000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Movement timeout (bit#11)', False)
|
||||||
|
return
|
||||||
|
|
||||||
|
#Closing channels
|
||||||
|
idMotorStatus.close()
|
||||||
|
idLogicalPosition.close()
|
||||||
|
idPotiRaw.close()
|
||||||
|
idMotorPositionRaw.close()
|
||||||
|
idCom.close()
|
||||||
|
idMotorPosition.close()
|
||||||
|
idPotiPosFromBeam.close()
|
||||||
|
idPotiPosition.close()
|
||||||
|
idPotiRef1Position.close()
|
||||||
|
idPotiRef2Position.close()
|
||||||
|
idDiameter.close()
|
||||||
|
idInkr.close()
|
||||||
|
idInkrRb.close()
|
||||||
|
scan.end()
|
||||||
|
|
||||||
|
ret = 'Moved to R1'
|
||||||
|
success = True
|
||||||
|
scan.end()
|
||||||
|
|
||||||
|
################ END OF YOUR CODE ################
|
||||||
|
###### Final - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
|
||||||
|
# just in case the feedback was forgotten
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
except:
|
||||||
|
# generic error handler
|
||||||
|
ret = traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
|
||||||
|
# launch the test
|
||||||
|
startTest(test, device, parameters)
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
|
<configuration xmlns="http://www.psi.ch/~ebner/models/scan/1.0">
|
||||||
|
<data fileName="Move Ref 1.fda"/>
|
||||||
|
<scan>
|
||||||
|
|
||||||
|
<!-- Send Move to Ref 1 Command -->
|
||||||
|
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="{DEVICE}:COM:2" value="FAHR_R1"/>
|
||||||
|
|
||||||
|
<dimension>
|
||||||
|
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="PseudoPositioner" settlingTime="0.1" id="id000000">
|
||||||
|
<counts>3000</counts>
|
||||||
|
</positioner>
|
||||||
|
|
||||||
|
<!-- Motor Drive Status -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:STA:1" id="id000001"/>
|
||||||
|
|
||||||
|
<!-- Logical Status -->
|
||||||
|
<!-- <detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:STA:2" id="id00001B"/> -->
|
||||||
|
|
||||||
|
<!-- Interlock Status -->
|
||||||
|
<!-- <detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IIST:2" id="id000002"/> -->
|
||||||
|
|
||||||
|
<!-- Logical Position -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST:2" id="id000003"/>
|
||||||
|
|
||||||
|
<!-- Collimator Diameter -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:DIAM:2" id="id000004"/>
|
||||||
|
|
||||||
|
<!-- Position Counter: Raw -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST1:1" id="id000005"/>
|
||||||
|
|
||||||
|
<!-- Position Counter: Processed -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST1:2" id="id000006"/>
|
||||||
|
|
||||||
|
<!-- Potentiometer: Raw -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST2:1" id="id000007"/>
|
||||||
|
|
||||||
|
<!-- Potentiometer: Processed -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST2:2" id="id000008"/>
|
||||||
|
|
||||||
|
<!-- BTVS Digitiser: Raw -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST3:1" id="id000009"/>
|
||||||
|
|
||||||
|
<!-- BTVS Digitiser: Processed -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST3:2" id="id000010"/>
|
||||||
|
|
||||||
|
|
||||||
|
</dimension>
|
||||||
|
|
||||||
|
</scan>
|
||||||
|
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000001" title="Drive Status: {DEVICE}:STA:1"/>
|
||||||
|
<!-- <visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000002" title="ILK Status: {DEVICE}:IIST:2"/> -->
|
||||||
|
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000003" title="Logical Pos: {DEVICE}:IST:2"/>
|
||||||
|
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000004" title="Diameter: {DEVICE}:DIAM:2 (mm)"/>
|
||||||
|
<!-- <visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000005" title="Cpc: {DEVICE}:IST1:1 (mm)"/> -->
|
||||||
|
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000006" title="Cpc: {DEVICE}:IST1:2 (mm)"/>
|
||||||
|
<!-- <visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000007" title="Pot: {DEVICE}:IST2:1 (mm)"/> -->
|
||||||
|
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000008" title="Pot: {DEVICE}:IST2:2 (mm)"/>
|
||||||
|
<!-- <visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000009" title="Btvs: {DEVICE}:IST3:1 (ADC raw)"/> -->
|
||||||
|
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000010" title="Btvs: {DEVICE}:IST3:2 (mm)"/>
|
||||||
|
</configuration>
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<h2>Short Description</h2>
|
||||||
|
Go to reference position R1
|
||||||
|
<h2>Details</h2>
|
||||||
|
Go to reference position R1 (command '3').
|
||||||
|
<h2>Parameters</h2>
|
||||||
|
none
|
||||||
|
<h2>Contact</h2>
|
||||||
|
<a href="https://intranet.psi.ch/Main/MarcoBoccioli">Marco Boccioli </a>
|
||||||
|
</html>
|
||||||
|
</body>
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
name=Move Ref 2
|
||||||
|
description=Moves to the Reference 2 Position
|
||||||
|
filename=Move Ref 2.xml
|
||||||
@@ -0,0 +1,144 @@
|
|||||||
|
|
||||||
|
# Drive to R2
|
||||||
|
|
||||||
|
###### Init - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
global sys, inspect, os, traceback
|
||||||
|
import sys, inspect, os, traceback
|
||||||
|
|
||||||
|
|
||||||
|
def startTest(testName, DEVICE, params):
|
||||||
|
# by default, assume the test failed
|
||||||
|
ret = 'Test failed'
|
||||||
|
success = False
|
||||||
|
# plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||||
|
plotName = DEVICE + ' - ' + testName
|
||||||
|
# put the whole custom code under try/catch
|
||||||
|
try:
|
||||||
|
# get the path of this script
|
||||||
|
testPath = inspect.getfile(inspect.currentframe())
|
||||||
|
# init the testing tool class. It can be sued in the following ways:
|
||||||
|
test = TestingTool(testName, testPath, DEVICE, params)
|
||||||
|
samplePeriod = 0.1
|
||||||
|
|
||||||
|
######### WRITE YOUR CODE HERE BELOW #############
|
||||||
|
scan = ManualScan(['time [1/'+ str(1/samplePeriod) + ' s]'], ['Motor Pos (IST3:2)', 'Poti Position (IST2:1)',
|
||||||
|
'Motor Status (STA:1)', 'Inkr (INKR:2)', 'InkrRb (INKRRB:2)',
|
||||||
|
'Diameter (DIAM:2)', 'Com (COM:2)', 'Logical Position (IST:2)',
|
||||||
|
'Motor Pos Raw (IST3:1)','Poti Pos From Beam (IST1:2)',
|
||||||
|
'Poti Raw (POSA:1)', 'Poti Ref1 Position (REF1:1)', 'Poti Ref2 Position (REF2:1)'])
|
||||||
|
scan.setPlotTitle(plotName)
|
||||||
|
scan.start()
|
||||||
|
|
||||||
|
try:
|
||||||
|
idMotorStatus = Channel(DEVICE + ':STA:1' , type = 'd') # DSP device_status reg
|
||||||
|
idLogicalPosition = Channel(DEVICE + ':IST:2' , type = 'd') # Shows current position in logical units as calculated from motor step counter [1..n]
|
||||||
|
idPotiRaw = Channel(DEVICE + ':POSA:1' , type = 'd') # poti raw data [ADC units]
|
||||||
|
idMotorPositionRaw = Channel(DEVICE + ':IST3:1' , type = 'd') # shows current position in steps as as obtained from motor step counter [steps]
|
||||||
|
idInkr = Channel(DEVICE + ':INKR:2' , type = 'd') # move relative distance (positive means towards R2) [mm]
|
||||||
|
idInkrRb = Channel(DEVICE + ':INKRRB:2' , type = 'd') # readback of move relative distance (positive means towards R2) [mm]
|
||||||
|
idDiameter = Channel(DEVICE + ':DIAM:2' , type = 'd') # collimator diameter [mm]
|
||||||
|
idCom = Channel(DEVICE + ':COM:2' , type = 'd') # current position as from motor step counter [mm]
|
||||||
|
idMotorPosition = Channel(DEVICE + ':IST3:2' , type = 'd') # current position as from motor step counter [mm]
|
||||||
|
idPotiPosFromBeam = Channel(DEVICE + ':IST1:2' , type = 'd') # current position from beam as from potentiometer [mm]
|
||||||
|
idPotiPosition = Channel(DEVICE + ':IST2:1' , type = 'd') # current position as from potentiometer [mm]
|
||||||
|
idPotiRef1Position = Channel(DEVICE + ':REF1:1' , type = 'd') # R1 position as from potentiometer [mm]
|
||||||
|
idPotiRef2Position = Channel(DEVICE + ':REF2:1' , type = 'd') # R2 position as from potentiometer [mm]
|
||||||
|
|
||||||
|
idCom.put('4', timeout=None) # go to R2
|
||||||
|
sleep( samplePeriod ) # Settling time
|
||||||
|
except:
|
||||||
|
ret = 'Unable to create channel - ' + traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback( ret, success)
|
||||||
|
return
|
||||||
|
|
||||||
|
#scan for a while to collect data
|
||||||
|
for setpoint1 in range(0, 10000):
|
||||||
|
sleep( samplePeriod ) # Settling time
|
||||||
|
|
||||||
|
MotorStatus = idMotorStatus.get()
|
||||||
|
LogicalPosition = idLogicalPosition.get()
|
||||||
|
PotiRaw = idPotiRaw.get()
|
||||||
|
MotorPositionRaw = idMotorPositionRaw.get()
|
||||||
|
Com = idCom.get()
|
||||||
|
MotorPosition = idMotorPosition.get()
|
||||||
|
PotiPosFromBeam = idPotiPosFromBeam.get()
|
||||||
|
PotiPosition = idPotiPosition.get()
|
||||||
|
PotiRef1Position = idPotiRef1Position.get()
|
||||||
|
PotiRef2Position = idPotiRef2Position.get()
|
||||||
|
Diameter = idDiameter.get()
|
||||||
|
Inkr = idInkr.get()
|
||||||
|
InkrRb = idInkrRb.get()
|
||||||
|
|
||||||
|
|
||||||
|
scan.append([setpoint2], [setpoint2],
|
||||||
|
[MotorPosition, PotiPosition, MotorStatus, Inkr, InkrRb, Diameter, Com, LogicalPosition,
|
||||||
|
MotorPositionRaw, PotiPosFromBeam, PotiRaw, PotiRef1Position, PotiRef2Position])
|
||||||
|
|
||||||
|
if (MotorStatus & int('1',2))==0: #device finished calibration (bit#1)
|
||||||
|
#give the device some time before stating that it has really finished
|
||||||
|
countDeviceInModeIdle = countDeviceInModeIdle +1
|
||||||
|
if countDeviceInModeIdle == 10:
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
countDeviceInModeIdle = 0
|
||||||
|
|
||||||
|
#check if any error bit is raised
|
||||||
|
if bool(int(MotorStatus) & int('10000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Motor switched off (bit#4)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('100000',2)): #error: abort test
|
||||||
|
test.sendFeedback('No motor link (bit#5)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('1000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('No poti link (bit#6)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('10000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Calibration error (bit#7)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('100000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Cannot get to R1 (bit#8)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('1000000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Cannot get to R2 (bit#9)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('10000000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Position measurement mismatch (bit#10)', False)
|
||||||
|
return
|
||||||
|
if bool(int(MotorStatus) & int('100000000000',2)): #error: abort test
|
||||||
|
test.sendFeedback('Movement timeout (bit#11)', False)
|
||||||
|
return
|
||||||
|
|
||||||
|
#Closing channels
|
||||||
|
idMotorStatus.close()
|
||||||
|
idLogicalPosition.close()
|
||||||
|
idPotiRaw.close()
|
||||||
|
idMotorPositionRaw.close()
|
||||||
|
idCom.close()
|
||||||
|
idMotorPosition.close()
|
||||||
|
idPotiPosFromBeam.close()
|
||||||
|
idPotiPosition.close()
|
||||||
|
idPotiRef1Position.close()
|
||||||
|
idPotiRef2Position.close()
|
||||||
|
idDiameter.close()
|
||||||
|
idInkr.close()
|
||||||
|
idInkrRb.close()
|
||||||
|
scan.end()
|
||||||
|
|
||||||
|
ret = 'Moved to R2'
|
||||||
|
success = True
|
||||||
|
scan.end()
|
||||||
|
|
||||||
|
################ END OF YOUR CODE ################
|
||||||
|
###### Final - DO NOT MODIFY THE CODE BELOW ######
|
||||||
|
|
||||||
|
# just in case the feedback was forgotten
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
except:
|
||||||
|
# generic error handler
|
||||||
|
ret = traceback.format_exc()
|
||||||
|
success = False
|
||||||
|
test.sendFeedback(ret, success)
|
||||||
|
|
||||||
|
# launch the test
|
||||||
|
startTest(test, device, parameters)
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
|
<configuration xmlns="http://www.psi.ch/~ebner/models/scan/1.0">
|
||||||
|
<data fileName="Move Ref 2.fda"/>
|
||||||
|
<scan>
|
||||||
|
|
||||||
|
<!-- Send Move to Ref 2 Command -->
|
||||||
|
<preAction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ChannelAction" channel="{DEVICE}:COM:2" value="FAHR_R2"/>
|
||||||
|
|
||||||
|
<dimension>
|
||||||
|
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="PseudoPositioner" settlingTime="0.1" id="id000000">
|
||||||
|
<counts>3000</counts>
|
||||||
|
</positioner>
|
||||||
|
|
||||||
|
<!-- Motor Drive Status -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:STA:1" id="id000001"/>
|
||||||
|
|
||||||
|
<!-- Logical Status -->
|
||||||
|
<!-- <detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:STA:2" id="id00001B"/> -->
|
||||||
|
|
||||||
|
<!-- Interlock Status -->
|
||||||
|
<!-- <detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IIST:2" id="id000002"/> -->
|
||||||
|
|
||||||
|
<!-- Logical Position -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST:2" id="id000003"/>
|
||||||
|
|
||||||
|
<!-- Collimator Diameter -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:DIAM:2" id="id000004"/>
|
||||||
|
|
||||||
|
<!-- Position Counter: Raw -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST1:1" id="id000005"/>
|
||||||
|
|
||||||
|
<!-- Position Counter: Processed -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST1:2" id="id000006"/>
|
||||||
|
|
||||||
|
<!-- Potentiometer: Raw -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST2:1" id="id000007"/>
|
||||||
|
|
||||||
|
<!-- Potentiometer: Processed -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST2:2" id="id000008"/>
|
||||||
|
|
||||||
|
<!-- BTVS Digitiser: Raw -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST3:1" id="id000009"/>
|
||||||
|
|
||||||
|
<!-- BTVS Digitiser: Processed -->
|
||||||
|
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ScalarDetector" name="{DEVICE}:IST3:2" id="id000010"/>
|
||||||
|
|
||||||
|
|
||||||
|
</dimension>
|
||||||
|
|
||||||
|
</scan>
|
||||||
|
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000001" title="Drive Status: {DEVICE}:STA:1"/>
|
||||||
|
<!-- <visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000002" title="ILK Status: {DEVICE}:IIST:2"/> -->
|
||||||
|
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000003" title="Logical Pos: {DEVICE}:IST:2"/>
|
||||||
|
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000004" title="Diameter: {DEVICE}:DIAM:2 (mm)"/>
|
||||||
|
<!-- <visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000005" title="Cpc: {DEVICE}:IST1:1 (mm)"/> -->
|
||||||
|
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000006" title="Cpc: {DEVICE}:IST1:2 (mm)"/>
|
||||||
|
<!-- <visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000007" title="Pot: {DEVICE}:IST2:1 (mm)"/> -->
|
||||||
|
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000008" title="Pot: {DEVICE}:IST2:2 (mm)"/>
|
||||||
|
<!-- <visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000009" title="Btvs: {DEVICE}:IST3:1 (ADC raw)"/> -->
|
||||||
|
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="id000000" y="id000010" title="Btvs: {DEVICE}:IST3:2 (mm)"/>
|
||||||
|
</configuration>
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<h2>Short Description</h2>
|
||||||
|
Go to reference position R2
|
||||||
|
<h2>Details</h2>
|
||||||
|
Go to reference position R2 (command '4').
|
||||||
|
<h2>Parameters</h2>
|
||||||
|
none
|
||||||
|
<h2>Contact</h2>
|
||||||
|
<a href="https://intranet.psi.ch/Main/MarcoBoccioli">Marco Boccioli </a>
|
||||||
|
</html>
|
||||||
|
</body>
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
name=Stop
|
||||||
|
description=Sends the STOP command
|
||||||
|
filename=Stop.xml
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user