# 1 "../deltaOff.st" # 1 "" # 1 "" # 1 "../deltaOff.st" # 10 "../deltaOff.st" program deltaOff option +d; option -c; option +r; int dmov; assign dmov to "{USEG}:DMOV"; monitor dmov; int inPos; assign inPos to "{USEG}:INPOS"; monitor inPos; int posMainEn; assign posMainEn to "{USEG}:POSNMAINEN"; monitor posMainEn; int off; assign off to "{USEG}:OFFCMD"; monitor off; int offAct; assign offAct to "{USEG}:OFFACT"; monitor offAct; int mDisv; assign mDisv to "{USEG}:MDISV"; monitor mDisv; float d1; assign d1 to "{USEG}:1:MOTR.DISV"; monitor d1; float d2; assign d2 to "{USEG}:2:MOTR.DISV"; monitor d2; float d3; assign d3 to "{USEG}:3:MOTR.DISV"; monitor d3; float d4; assign d4 to "{USEG}:4:MOTR.DISV"; monitor d4; float m1Rbv; assign m1Rbv to "{USEG}:1:MOTR.RBV"; monitor m1Rbv; float m2Rbv; assign m2Rbv to "{USEG}:2:MOTR.RBV"; monitor m2Rbv; float m3Rbv; assign m3Rbv to "{USEG}:3:MOTR.RBV"; monitor m3Rbv; float m4Rbv; assign m4Rbv to "{USEG}:4:MOTR.RBV"; monitor m4Rbv; float m1; assign m1 to "{USEG}:1:MOTR"; monitor m1; float m2; assign m2 to "{USEG}:2:MOTR"; monitor m2; float m3; assign m3 to "{USEG}:3:MOTR"; monitor m3; float m4; assign m4 to "{USEG}:4:MOTR"; monitor m4; float m1Off; assign m1Off to "{USEG}:1:MOFF"; monitor m1Off; float m2Off; assign m2Off to "{USEG}:2:MOFF"; monitor m2Off; float m3Off; assign m3Off to "{USEG}:3:MOFF"; monitor m3Off; float m4Off; assign m4Off to "{USEG}:4:MOFF"; monitor m4Off; ss deltaOff { state s_Stby { entry { d1 = 1; pvPut(d1); d2 = 1; pvPut(d2); d3 = 1; pvPut(d3); d4 = 1; pvPut(d4); mDisv = 1; pvPut(mDisv); } when(off == 1) { } state s_Mov } state s_Mov { when(off == 0) { } state s_Stby when() { m1 = m1Off; pvPut(m1); m2 = m2Off; pvPut(m2); m3 = m3Off; pvPut(m3); m4 = m4Off; pvPut(m4); } state s_startMov } state s_startMov { when(pvPutComplete(m1) && pvPutComplete(m2) && pvPutComplete(m3) && pvPutComplete(m4)) { } state s_Wait when(delay(100)){ } state s_Err } state s_Wait { when(off == 0){ } state s_Stby when(dmov && inPos && (offAct==0)){ } state s_Off when(dmov && !inPos){ } state s_Mov } state s_Off { when(delay(2)){ d1 = 0; pvPut(d1); d2 = 0; pvPut(d2); d3 = 0; pvPut(d3); d4 = 0; pvPut(d4); mDisv = 0; pvPut(mDisv); } state s_StbyEn } state s_StbyEn{ when(off == 0) { m1 = m1Rbv; pvPut(m1, SYNC); m2 = m2Rbv; pvPut(m2, SYNC); m3 = m3Rbv; pvPut(m3, SYNC); m4 = m4Rbv; pvPut(m4, SYNC); } state s_Stby } state s_Err{ when(){ off = 1; pvPut(off); } state s_Stby } }