Added RS485 PVS

This commit is contained in:
Bernardo Carvalho
2019-11-06 10:29:33 +00:00
parent 724a0d3290
commit 10b2504e23
5 changed files with 138 additions and 59 deletions

View File

@@ -0,0 +1,97 @@
record (longin, "$(P)$(R)P001:M")
{
field (DESC, "getPressure001 $(bus)")
field (DTYP, "stream")
field (INP, "@pfeiffer.proto getPressure001($(P)$(R)P001:E) $(bus)")
field (SCAN, "1 second")
field (FLNK, "$(P)$(R)P001")
}
record (longin, "$(P)$(R)P001:E")
{
field (DESC, "Pressure001 exponent $(bus)")
}
record (calc, "$(P)$(R)P001")
{
field (DESC, "ex ISTTOK:vacuum:Pressure_Chamber1")
field(INPA, "$(P)$(R)P001:M")
field(INPB, "$(P)$(R)P001:E")
field(CALC, "(A*0.001)*10.0**(B-20)")
field(PREC, "3")
field(EGU, "mBar")
}
record (longin, "$(P)$(R)P002:M")
{
field (DESC, "getPressure002 $(bus)")
field (DTYP, "stream")
field (INP, "@pfeiffer.proto getPressure002($(P)$(R)P002:E) $(bus)")
field (SCAN, "2 second")
field (FLNK, "$(P)$(R)P002")
}
record (longin, "$(P)$(R)P002:E")
{
field (DESC, "Pressure002 exponent $(bus)")
}
record (calc, "$(P)$(R)P002")
{
field (DESC, "Pressure_Primary1")
field(INPA, "$(P)$(R)P002:M")
field(INPB, "$(P)$(R)P002:E")
field(CALC, "(A*0.001)*10.0**(B-20)")
field(PREC, "3")
field(EGU, "mBar")
}
record (longin, "$(P)$(R)P003:M")
{
field (DESC, "getPressure003 Mantissa $(bus)")
field (DTYP, "stream")
field (INP, "@pfeiffer.proto getPressure003($(P)$(R)P003:E) $(bus)")
field (SCAN, "1 second")
# field (SCAN, "I/O Intr")
field (FLNK, "$(P)$(R)P003")
}
record (longin, "$(P)$(R)P003:E")
{
field (DESC, "Pressure003 Exponent $(bus)")
}
record (calc, "$(P)$(R)P003")
{
field(DESC, "Pressure_Primary2")
field(INPA, "$(P)$(R)P003:M")
field(INPB, "$(P)$(R)P003:E")
field(CALC, "(A*0.001)* 10.0**(B-20)")
field(PREC, "3")
field(EGU, "mBar")
}
record (longin, "$(P)$(R)P004:M")
{
field (DESC, "getPressure004 Mantissa $(bus)")
field (DTYP, "stream")
field (INP, "@pfeiffer.proto getPressure004($(P)$(R)P004:E) $(bus)")
field (SCAN, "1 second")
field (FLNK, "$(P)$(R)P004")
}
record (longin, "$(P)$(R)P004:E")
{
field (DESC, "Pressure004 Exponent $(bus)")
}
record (calc, "$(P)$(R)P004")
{
field(DESC, "Pressure_TMP_Admission")
field(INPA, "$(P)$(R)P004:M")
field(INPB, "$(P)$(R)P004:E")
field(CALC, "(A*0.001)* 10.0**(B-20)")
field(PREC, "3")
field(EGU, "mBar")
}
record(stringout,"$(P)$(R)RS485Debug") {
field(DESC, "")
field(DTYP, "stream")
field(OUT, "@pfeiffer.proto debug $(bus)")
field(VAL,"")
}

View File

@@ -1,49 +0,0 @@
record (longin, "$(P)$(R)P003:M")
{
field (DESC, "getPressure003 Mantissa $(bus)")
field (DTYP, "stream")
field (INP, "@pfeiffer.proto getPressure003($(P)$(R)P003:E) $(bus)")
field (SCAN, "I/O Intr")
field (FLNK, "$(P)$(R)P003")
}
record (longin, "$(P)$(R)P003:E")
{
field (DESC, "Pressure003 Exponent $(bus)")
}
record (calc, "$(P)$(R)P003")
{
field(INPA, "$(P)$(R)P003:M")
field(INPB, "$(P)$(R)P003:E")
field(CALC, "(A*0.001)* 10.0**(B-20)")
field(PREC, "3")
field(EGU, "mBar")
}
record (longin, "$(P)$(R)P002:M")
{
field (DESC, "getPressure002 $(bus)")
field (DTYP, "stream")
field (INP, "@pfeiffer.proto getPressure002($(P)$(R)P002:E) $(bus)")
field (SCAN, "I/O Intr")
field (FLNK, "$(P)$(R)P002")
}
record (longin, "$(P)$(R)P002:E")
{
field (DESC, "Pressure002 exponent $(bus)")
}
record (calc, "$(P)$(R)P002")
{
field(INPA, "$(P)$(R)P002:M")
field(INPB, "$(P)$(R)P002:E")
field(CALC, "(A*0.001)*10.0**(B-20)")
field(PREC, "3")
field(EGU, "mBar")
}
record(stringout,"$(P)$(R)Debug") {
field(DESC, "")
field(DTYP, "stream")
field(OUT, "@pfeiffer.proto debug $(bus)")
field(VAL,"")
}

View File

@@ -8,7 +8,7 @@ DB += ISTTOKstates.db
DB += ISTTOKvacummPumps.db DB += ISTTOKvacummPumps.db
DB += ISTTOKpcf8574.db DB += ISTTOKpcf8574.db
DB += ISTTOKpcf8591.db DB += ISTTOKpcf8591.db
DB += ISTTOKrs485.db DB += ISTTOKpfeiffer.db
# If <anyname>.db template is not named <anyname>*.template add # If <anyname>.db template is not named <anyname>*.template add
# <anyname>_TEMPLATE = <templatename> # <anyname>_TEMPLATE = <templatename>

View File

@@ -31,10 +31,26 @@ drvAsynI2CConfigure( "I2C", "/dev/i2c-1", 1 )
## Load record instances ## Load record instances
dbLoadRecords("db/ISTTOKstates.db","P=ISTTOK:,R=central:") dbLoadRecords("db/ISTTOKstates.db","P=ISTTOK:,R=central:")
dbLoadRecords("db/ISTTOKpcf8574.db","P=ISTTOK:,R=central:") dbLoadRecords("db/ISTTOKpcf8574.db","P=ISTTOK:,R=central:")
dbLoadRecords("db/ISTTOKpcf8591.db","P=ISTTOK:,R=central:")
#dbLoadRecords("db/ISTTOKpcf8574.db","P=ISTTOK:,R=central:,ID=57") #dbLoadRecords("db/ISTTOKpcf8574.db","P=ISTTOK:,R=central:,ID=57")
dbLoadRecords("db/ISTTOKvacummPumps.db","P=ISTTOK:,R=central:") dbLoadRecords("db/ISTTOKvacummPumps.db","P=ISTTOK:,R=central:")
dbLoadRecords("db/ISTTOKpcf8591.db","P=ISTTOK:,R=central:") ## Load Serial drivers
drvAsynSerialPortConfigure("RS0","/dev/ttyUSB0")
asynSetOption("RS0", 0, "baud", "9600")
asynSetOption("RS0", 0, "bits", "8")
asynSetOption("RS0", 0, "parity", "none")
asynSetOption("RS0", 0, "stop", "1")
asynSetOption("RS0", 0, "clocal", "Y")
asynSetOption("RS0", 0, "crtscts", "N")
dbLoadRecords("db/ISTTOKpfeiffer.db","P=ISTTOK:,R=central:,bus=RS0")
# Uncomment to Debug STREAM serial activity
#var streamError 1
#var streamDebug 1
#streamSetLogfile("logfile.txt")
## Run this to trace the stages of iocInit ## Run this to trace the stages of iocInit
#traceIocInit #traceIocInit

View File

@@ -1,17 +1,33 @@
Terminator=CR; Terminator=CR;
MaxInput = 20; MaxInput = 20;
ReadTimeout = 2000;
getPressure003 { #in millisecond
in "0031074006%4u%(\$1)2u%+<sum8>"; #ReadTimeout = 2000;
ReplyTimeout = 200;
# Using redirection to read 2 records, mantissa and exponent
getPressure001 {
out "0010074002=?106";
in "0011074006%4u%(\$1)2u%+<sum8>";
} }
getPressure002 { getPressure002 {
in "0021074006%4u%(\$1)2u%+<sum8>"; out "0020074002=?107";
in "0021074006%4u%(\$1)2u%+<sum8>";
} }
getPressure003 {
out "0030074002=?108";
in "0031074006%4u%(\$1)2u%+<sum8>";
}
getPressure004 {
out "0040074002=?109";
in "0041074006%4u%(\$1)2u%+<sum8>";
}
#
# in "0031074006%4u%(\$1)2u%*3u"; # in "0031074006%4u%(\$1)2u%*3u";
# #
getPressureE003 { #getPressureE003 {
in "0031074006%*4u%2u%*3u"; # in "0031074006%*4u%2u%*3u";
} #}
# Connect a stringout record to this to get # Connect a stringout record to this to get
# a generic command interface. # a generic command interface.
@@ -20,6 +36,5 @@ getPressureE003 {
debug { debug {
ExtraInput = Ignore; ExtraInput = Ignore;
out "%s"; in "%39c" out "%s"; in "%39c"
} }