Inserted 3rd Relay Board and PVs

This commit is contained in:
Bernardo Carvalho
2022-02-14 16:45:44 +00:00
parent d616a7fa1f
commit 8e534c636b
5 changed files with 66 additions and 26 deletions

View File

@@ -217,7 +217,6 @@ Process Variables in this IOC Server:
| ISTTOK:central:TDA8444:32:DAC_CH3| longout | no | | ISTTOK:central:TDA8444:32:DAC_CH3| longout | no |
| ISTTOK:central:TDA8444:32:DAC_CH5| longout | no | | ISTTOK:central:TDA8444:32:DAC_CH5| longout | no |
| ISTTOK:central:TDA8444:32:DAC_CH6| longout | no | | ISTTOK:central:TDA8444:32:DAC_CH6| longout | no |
| ISTTOK:central:Shot-TorPSCurrent| longout | no |
---------- ----------
* Connected to PCF8591 ADC / DAC register @ address 0x48=d72 * Connected to PCF8591 ADC / DAC register @ address 0x48=d72
@@ -259,6 +258,14 @@ SPDT Relay Address = 17
|ISTTOK:central:Buzzer| bo | 3 | Relay NO/NC| |ISTTOK:central:Buzzer| bo | 3 | Relay NO/NC|
* Connected to Seeeduino- 4-Channel SPDT Relay Address = 19
|PV Name | PV Type | Bit | Relay NO/NC|
|:----------|-------|---:|
| ISTTOK:central:Shot-TorPSDisable| 0 | NO |
| ISTTOK:central:Lab-WarningLight| 1 | NO |
### Vacuum Node (**Not used, backup server only**) ### Vacuum Node (**Not used, backup server only**)
- Vacuum Pfeiffer Sensors (RS485) - Vacuum Pfeiffer Sensors (RS485)

View File

@@ -443,13 +443,27 @@ record(bo, "$(P)$(R)Buzzer" ) {
field(OSV,"MINOR") field(OSV,"MINOR")
} }
######################################
# Tor Power Supply Disable #
# É desligado na emergência e em qualquer estado que
# não seja Process ou Wait Shot.
######################################
record(bo, "$(P)$(R)Shot-TorPSDisable" ) {
field(DESC,"Tor Power Supply Disable")
####field( OUT, "$(P)$(R)PCF8574:61:REGISTER.B1 PP" )
field(OUT,"$(P)$(R)SEEED4RELAY:19:REGISTER.B0 PP")
field( ZNAM, "Enabled" )
field( ONAM, "Disabled" )
field(VAL,"0")
field(OSV,"MINOR")
}
############################## ##############################
# LIGHTS ON/OFF # # LIGHTS ON/OFF #
############################## ##############################
record(bo, "$(P)$(R)Lab-WarningLight" ) { record(bo, "$(P)$(R)Lab-WarningLight" ) {
field(DESC,"Luzes de sinalização, 220V ") field(DESC,"Luzes de sinalização, 220V ")
# ####field(OUT, "$(P)$(R)PCF8574:60:REGISTER.B5 PP" ) # ####field(OUT, "$(P)$(R)PCF8574:60:REGISTER.B5 PP" )
field(OUT,"$(P)$(R)SEEED4RELAY:19:REGISTER.B0 PP") field(OUT,"$(P)$(R)SEEED4RELAY:19:REGISTER.B1 PP")
field(ZNAM,"OFF") field(ZNAM,"OFF")
field(ONAM, "ON") field(ONAM, "ON")
field(VAL, "0") field(VAL, "0")
@@ -460,20 +474,6 @@ record(bo, "$(P)$(R)Lab-WarningLight" ) {
# field(VAL,"1") # field(VAL,"1")
#} #}
######################################
# Tor Power Supply Disable #
# É desligado na emergência e em qualquer estado que
# não seja Process ou Wait Shot.
######################################
record(bo, "$(P)$(R)Shot-TorPSDisable" ) {
field(DESC,"Tor Power Supply Disable")
####field( OUT, "$(P)$(R)PCF8574:61:REGISTER.B1 PP" )
field(OUT,"$(P)$(R)SEEED4RELAY:19:REGISTER.B1 PP")
field( ZNAM, "Enabled" )
field( ONAM, "Disabled" )
field(VAL,"0")
field(OSV,"MINOR")
}
# field( ZNAM, "Off" ) # field( ZNAM, "Off" )
# field( ONAM, "On" ) # field( ONAM, "On" )
# field(VAL,"1") # field(VAL,"1")

View File

@@ -18,10 +18,18 @@
**/ **/
//%% #include "errlog.h" //%% #include "errlog.h"
program IsttokSeqExec program IsttokSeqExec ("output=logFile.txt")
%{#include "errlog.h"}% %{#include "errlog.h"}%
%%#include <fcntl.h> /* for exit() */
%%#include <stdio.h> /* for exit() */
%%#include <stdlib.h> /* for exit() */
/* CONSTANT DECLARATION*/ /* CONSTANT DECLARATION*/
/*Relays and INPUT (Valleman Board) have negative Logic!*/ /*Relays and INPUT PVs on Valleman Board have negative Logic!*/
/*=================== declarations =========================*/
int fd; /* file descriptor for logging */
char *pmac; /* used to access program macros */
short PCF_RELAY_ON = 0; short PCF_RELAY_ON = 0;
short PCF_RELAY_OFF= 1; short PCF_RELAY_OFF= 1;
short PCF_INPUT_ON = 0; short PCF_INPUT_ON = 0;
@@ -142,12 +150,13 @@ assign IsttokRPump2_Motor to "ISTTOK:central:RPump2-Motor";
short IsttokRPump2_Valve; short IsttokRPump2_Valve;
assign IsttokRPump2_Valve to "ISTTOK:central:RPump2-Valve"; assign IsttokRPump2_Valve to "ISTTOK:central:RPump2-Valve";
/* No use for these, Controller does not respond
short IsttokTMPump1_ControllerOff; short IsttokTMPump1_ControllerOff;
assign IsttokTMPump1_ControllerOff to "ISTTOK:central:TMPump1-ControllerOff"; assign IsttokTMPump1_ControllerOff to "ISTTOK:central:TMPump1-ControllerOff";
short IsttokTMPump1_ControllerOn; short IsttokTMPump1_ControllerOn;
assign IsttokTMPump1_ControllerOn to "ISTTOK:central:TMPump1-ControllerOn"; assign IsttokTMPump1_ControllerOn to "ISTTOK:central:TMPump1-ControllerOn";
*/
short IsttokTMPump1_MotorOff; short IsttokTMPump1_MotorOff;
assign IsttokTMPump1_MotorOff to "ISTTOK:central:TMPump1-MotorOff"; assign IsttokTMPump1_MotorOff to "ISTTOK:central:TMPump1-MotorOff";
@@ -277,6 +286,23 @@ ss PulseSequence {
/*********** State: init ****************** */ /*********** State: init ****************** */
state init { state init {
entry { entry {
fd = -1;
/* Use parameter to define logging file */
pmac = macValueGet("output");
if (pmac == 0 || pmac[0] == 0) {
printf("No macro defined for \"output\"\n");
fd = 1;
}
else {
fd = open(pmac, (O_CREAT | O_WRONLY), 0664);
/* if (fd == ERROR) { */
if (fd == -1) {
printf("Can't open %s\n", pmac);
exit (-1);
}
}
dprintf(fd, "Starting program\n");
strcpy(msg, "INIT: Sequence Entry"); strcpy(msg, "INIT: Sequence Entry");
pvPut(msg); pvPut(msg);
errlogSevPrintf(NO_ALARM, "%s\n",msg); errlogSevPrintf(NO_ALARM, "%s\n",msg);
@@ -326,13 +352,13 @@ ss PulseSequence {
Isttok_TorPSTrigger= OFF; Isttok_TorPSTrigger= OFF;
pvPut(Isttok_TorPSTrigger); pvPut(Isttok_TorPSTrigger);
/*
IsttokTMPump1_ControllerOff = OFF; IsttokTMPump1_ControllerOff = OFF;
pvPut(IsttokTMPump1_ControllerOff); pvPut(IsttokTMPump1_ControllerOff);
IsttokTMPump1_ControllerOn = OFF; IsttokTMPump1_ControllerOn = OFF;
pvPut(IsttokTMPump1_ControllerOn); pvPut(IsttokTMPump1_ControllerOn);
*/
IsttokTMPump1_MotorOff = OFF; IsttokTMPump1_MotorOff = OFF;
pvPut(IsttokTMPump1_MotorOff); pvPut(IsttokTMPump1_MotorOff);
@@ -457,7 +483,6 @@ ss PulseSequence {
} state Emergency } state Emergency
when ( (pvStatus(IsttokRPump1_Pressure) != pvStatOK) || (pvStatus(IsttokTMPump1_Emergency) != pvStatOK) ) { when ( (pvStatus(IsttokRPump1_Pressure) != pvStatOK) || (pvStatus(IsttokTMPump1_Emergency) != pvStatOK) ) {
//when ( pvStatus(IsttokRPump1_Pressure) != pvStatOK || pvStatus(IsttokRPump2_Pressure) != pvStatOK ||
// pvStatus(IsttokTMPump1_Emergency) != pvStatOK || pvStatus(IsttokTMPump2_Emergency) != pvStatOK) { // pvStatus(IsttokTMPump1_Emergency) != pvStatOK || pvStatus(IsttokTMPump2_Emergency) != pvStatOK) {
/* Vacuum emergency: Pulse state change to Stopping */ /* Vacuum emergency: Pulse state change to Stopping */
/*IsttokOPREQ = STOP; State should recover from */ /*IsttokOPREQ = STOP; State should recover from */
@@ -466,8 +491,8 @@ ss PulseSequence {
strcpy(msg, "State Idle to Stopping"); strcpy(msg, "State Idle to Stopping");
pvPut(msg); pvPut(msg);
errlogSevPrintf(MINOR, "%s\n", msg); errlogSevPrintf(MINOR, "%s\n", msg);
sprintf(sendMail, "Rpump1 Pressure:%1.1e TMP1 Emergency:%d TMP1 Adm. Pressure:%4.2e", sprintf(sendMail, "Vacuum Emergency while Idle, Rpump1 Pressure:%1.1e, TMP1 Adm. Pressure:%4.2e, TMP1 Emergency:%d",
IsttokRPump1_Pressure, IsttokTMPump1_Emergency, IsttokTMPump1_Pressure); IsttokRPump1_Pressure, IsttokTMPump1_Pressure, IsttokTMPump1_Emergency);
pvPut(sendMail); pvPut(sendMail);
} state Stopping } state Stopping
@@ -1394,6 +1419,14 @@ ss StoppingSequence {
when (IsttokOPSTATE != POS_Stopping ) { } state NonStopping when (IsttokOPSTATE != POS_Stopping ) { } state NonStopping
} }
} }
/* Exit procedure - close the log file
exit {
printf("close fd=%d\n", fd);
if ((fd > 0) && (fd != ioGlobalStdGet(1)) )
close(fd);
fd = -1;
}
*/
/**** END PROGRAM ***/ /**** END PROGRAM ***/

View File

@@ -1,4 +1,4 @@
# autosave R5.3 Automatically generated - DO NOT MODIFY - 220204-153705 # autosave R5.3 Automatically generated - DO NOT MODIFY - 220214-164146
ISTTOK:central:PULSE-NUMBER.VAL 49468 ISTTOK:central:PULSE-NUMBER.VAL 49468
ISTTOK:central:LogMessage.VAL ISTTOK:central:LogMessage.VAL
ISTTOK:central:LASTOPSTATE.VAL 2 ISTTOK:central:LASTOPSTATE.VAL 2

View File

@@ -83,4 +83,4 @@ asInit
create_monitor_set("$(IOC).req", 30, "P=ISTTOK:,R=central:") create_monitor_set("$(IOC).req", 30, "P=ISTTOK:,R=central:")
## Start any sequence programs , use safe mode ## Start any sequence programs , use safe mode
seq IsttokSeqExec "unit=ISTTOK" seq IsttokSeqExec "unit=ISTTOK,node=central,output=logFile2"