Files
dev/script/55_Interlocks.js
2018-01-19 10:56:53 +01:00

52 lines
1.2 KiB
JavaScript
Executable File

///////////////////////////////////////////////////////////////////////////////////////////////////
// Interlocks: example on creating and installing device interlock rules.
///////////////////////////////////////////////////////////////////////////////////////////////////
//Motor and Positioners
var MyInterlock1 = Java.extend(Interlock)
var interlock1 = new MyInterlock1( [m1, p1]) {
check: function (pos) {
m=pos[0]
p=pos[1]
if ((p<500) && (m<5) && (m>4)){
return false
}
return true
},
}
/*
//Motor group
var MyInterlock2 = Java.extend(Interlock)
var interlock2 = new MyInterlock2( [mg1, p1]) {
check: function (pos) {
print(pos)
mg=pos[0]
p=pos[1]
print(to_array(mg))
if ((p<500) && (mg[0]<5) && (mg[1]>4)){
return false
}
return true
},
}
*/
/*
//Discrete Positioner
var MyInterlock3 = Java.extend(Interlock)
interlock3 = new MyInterlock3( [dp1, p1]) {
check: function (pos) {
dp=pos[0]
p=pos[1]
print ("DP " + dp)
print ("P " + p)
if ((p<500) && (dp=="Out")){
return false
}
return true
},
}
*/