Controlling the Mass
Flow Controllers for the BoNuS Detector
K. Giovanetti, G. Niculescu. I. Niculescu,

Standard Operation: For
standard operation the top four
toggle switches should be on indicating that the program should attempt to
control both MFCs, write data to the Epics database
and update the MFC settings based on new EPICS values.
The Bonus gas system is regulated by two remotely controlled Mass Flow Controllers, MFCs. The MFCs were manufactured by Qualiflow. The MFCs have been calibrated for Helium and DME. They are mounted on a panel located on the target frame in the experimental hall. Communication with the MFCs is done using RS232 connections. The actual communication language used over the RS232 line is a special protocol specifically designed for instrument control. The MFCs come with software support so that MFC control does not need to be done using this primitive code, the lowest level.
To operate the MFCs [AFC 80MD mass flow controllers] one needs:
Basic layout is shown below.

The computer is a standard PC running Windows 2000. The computer is mounted on one of the target frames in the experimental hall. The computer can be reached using VNC a client/server virtual network. The VNC server software must be running on the PC. (The VNC server should start by default on a boot.)
PC internet address: 129.57.167.246 [PORT:5800]
One can access the desktop of the computer using a web browser
(http:// 129.57.167.246:5800 ) or a VNC viewer. You will be prompted for a password.
On the computer (computer name in the browser=miller_1245) two programs for control are available, either the manufacturers stand alone package Digisoft or a LabView program. The Digisoft program has more MFC conrtol and monitoring features but has no EPICS component. For example,the Digisoft program can set the MFCs to run in either analog or digital mode. This feature cannot be accessed with the LabView program. The Digisoft program can talk to one and only one MFC at one time. The choice is made using the COM port pull down menu on the first screen. Choose either port 1 or 2 and then click to the regulation screen (Top Tab). The program scans the port for a MFC and then reports on what it finds. User’s can simply change ports to contact another MFC and the user can alternate back and forth as necessary. More information can be found at
http://www.qualiflow.com/us/s_notes.html
A Labview program was developed and integrated with EPICS so that data could be stored in the data stream and so that MFCs could be set through EPICS channel access. This program combines the LabView tools that were provided by Qualiflow with a Windows based IOC developed by Willem Blokland for the Spalation Neutron Source.
http://www.sns.gov/diagnostics/documents/epics/LabVIEW/SNS_LabVIEWEPICS.html
http://www.sns.gov/diagnostics/documents/epics/Downloads/downloads.html
The program can be started by choosing the Labview icon. You CAN NOT run the Digisoft program and the labview program simultaneously because they both would address the same com ports. However the adjusted settings of either program remain in force unless the new program makes a specific change. In considering the operation of the MFCs one should remember that the MFCs when powered keep their settings and operate independently of whether or not the control program is running. This enables either program to alternate between the two MFCs and allows one to set values using one program and then switch to the other. For example, the MFC needs to run in digital mode to be controlled by the Labview software. If the MFC is not currently in digital mode it can be changed using the Digisoft program (selection on Regulation window). The labview program can then be run after the Digisoft program is exited.
The LabView program has been designed to run with front panel inputs that determine program flow. To facilitate the explanation the following modes of operation are important and are determined by the upper panel ENABLE rocker switch setting:

MFC1 operational: [MFC1 Available = TRUE]
The MFC is present and powered-up therefore read and writes will be executed. Otherwise the program ignores the MFC.
MFC2 operational: [MFC2 Available = TRUE]
The MFC is present and powered-up therefore read and writes will be executed. Otherwise the program ignores the MFC.
Epics ON: [Use Epics =TRUE]
The Epics IOC software is started. Data recording to the EPICS database will be performed.
Epics OFF: [Use Epics =FALSE]
The Epics software is not intialized. EPICS database ignored.
Local mode: [Epics will set MFC =FALSE] (MFC Setpoints controlled LOCALly from the front panel.)
Epics may be configured to read only or not used at all. If Epics is started it is not allowed to update the MFC setpoints. Setpoints are changed by values in the Req Setpoint window on the front panel and loaded using the write button.
Epics Write Mode: [Epics will set MFC =TRUE]
Epics is configured to allow a change in the setpoint based on epics values. The database values are used to update the Req Setpoint window and the write is performed as part of the MFC sequence. The sequence of events is ordered so that the MFC current setpoint is read, and then this setpoint as read from the MFC is loaded as the intial value for the EPICS database. Epics On must be set in order to use this mode.
In local mode (either “Epics on” Local Mode or “Epics Off” Local Mode) the MFC setpoint is loaded into the MFC by pressing a write button otherwise the program just retrieves the values (reads the MFC). When the program starts the MFC settings are not changed only read. The setpoint value ( Req Setpoint) should be considered arbitrary and the user should examine the current MFC setting in the MFC setpoint window and carefully entering a reasonable value in the Req Setpoint window before hitting the write button. A new setting can be entered in the window and a write initiated with the write button.
For each MFC there are three important values shown on the control panel.
In addition there are some diagnostic values on the control panel that show the current Epics database values

and the current MFC values.

For a typical startup the program should
A flow chart depicting this follows:

Internally the labview program uses variables, controls and indicators to control data and program flow. Some of the important variables can be found in the following table.
The I’s are indices to the database. The D’s are the fron panel diagnostic diplays for the database the M’s are the MFC values read back from the MFCs.
|
MFC# |
index |
dbdisplay |
MFCcntl |
|
labview |
|
|
|
|
|
|
|
|
1 |
I1Setpoint |
D1Setpoint |
M1Setpoint |
orange |
sgl |
|
1 |
I1ReqSetpoint |
D1ReqSetpoint |
M1ReqSetpoint |
orange |
sgl |
|
1 |
I1Flow |
D1Flow |
M1Flow |
orange |
sgl |
|
1 |
I1ValvNo |
D1ValvNo |
M1ValvNo |
blue |
U16 |
|
1 |
I1Alarm |
D1Alarm |
M1Alarm |
blue |
U8 |
|
1 |
I1AlarmReset |
D1AlarmReset |
M1AlarmReset |
green |
I16 |
|
1 |
I1Override |
D1Override |
M1Override |
pink |
string |
|
1 |
I1ReqOverrride |
D1ReqOverrride |
M1ReqOverrride |
pink |
string |
|
1 |
I1ManID |
D1ManID |
M1ManID |
pink |
string |
|
1 |
I1ProdID |
D1ProdID |
M1ProdID |
pink |
string |
|
1 |
I1Serial |
D1Serial |
M1Serial |
pink |
string |
|
1 |
I1Type |
D1Type |
M1Type |
pink |
string |
|
1 |
I1SoftVer |
D1SoftVer |
M1SoftVer |
pink |
string |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
I2Setpoint |
D2Setpoint |
M2Setpoint |
|
sgl |
|
2 |
I2ReqSetpoint |
D2ReqSetpoint |
M2ReqSetpoint |
|
sgl |
|
2 |
I2Flow |
D2Flow |
M2Flow |
|
sgl |
|
2 |
I2ValvNo |
D2ValvNo |
M2ValvNo |
|
U16 |
|
2 |
I2Alarm |
D2Alarm |
M2Alarm |
|
U8 |
|
2 |
I2AlarmReset |
D2AlarmReset |
M2AlarmReset |
|
I16 |
|
2 |
I2Override |
D2Override |
M2Override |
|
string |
|
2 |
I2ReqOverrride |
D2ReqOverrride |
M2ReqOverrride |
|
string |
|
2 |
I2ManID |
D2ManID |
M2ManID |
|
string |
|
2 |
I2ProdID |
D2ProdID |
M2ProdID |
|
string |
|
2 |
I2Serial |
D2Serial |
M2Serial |
|
string |
|
2 |
I2Type |
D2Type |
M2Type |
|
string |
|
2 |
I2SoftVer |
D2SoftVer |
M2SoftVer |
|
string |
|
|
|
|
|
|
|
Variable used for program control include:
|
MFC1Present |
T/F |
boolean |
control |
set by user (default now is
false) |
|
use/skip MFC port open and
reading |
|
MFC2Present |
T/F |
boolean |
control |
set by user (default now is
false) |
|
use/skip MFC port open and
reading |
|
UseEpics |
T/F |
boolean |
control |
set by user (default now is
true) |
typically chosen and fixed |
true starts epics in
"init" step |
|
EpicsSet |
T/F |
boolean |
control |
set by user (default now is
false) |
makes epics the source of
new settings |
you can disable and then
use the front panel to set the MFCs |
|
Epics IOC Started |
T/F |
boolean |
indicator |
False at start |
set at completion of the initialaization of IOC |
|
|
MFC1active |
T/F |
boolean |
indicator |
False at start |
true only in the valve 1 process |
|
|
MFC2active |
T/F |
boolean |
indicator |
False at start |
true only in the valve 2 process |
|
|
Login Verified |
T/F |
boolean |
control |
False at start |
currentl disabled |
repeats login until
verified |
|
Epics write 1 |
T/F |
boolean |
|
False at start/ set false
if Epics set is False |
true after the DB req has been loaded |
controls whether a MFC setpoint is written |
|
Epics write 2 |
T/F |
boolean |
|
""""" |
""""" |
""""" |
|
MFC1Read |
T/F |
boolean |
control |
false/set to true after MFC
read |
"none" loop waits
until true to set db (sets it false),"valve1/2" loops sets true at
end |
controls the time when the db values are updated to only
after a MFC read. |
|
MFC2Read |
T/F |
boolean |
control |
''' |
""""" |
''' |
|
Init DB REQ 1 |
T/F |
boolean |
control |
false until the MFC read
and DB set to current read value |
reset if EpicsSet is False so
that you can go back to front panle control. |
used to intialize the database
to the cirrent MFC setting. Need to read MFC and
load this setpoint into the DB. |
|
Init DB REQ 2 |
T/F |
boolean |
control |
'' |
'' |
' |