Yes it does. Cut your program down to a single state set, use variables in the PV names, set the reetrant flag, then launch the same program multiple times ...
/* set reentrant option for multiple instances */
option +r;
float pv1;
assign pv1 to "magnet{mag}";
ss ss1 {
state one {
pv1 = 1;
pvPut(pv1);
} state two
state two {
pv1 = 2;
pvPut(pv1);
} state one
}
In the st.cmd file ...
seq &sncExample, "mag=1"
seq &sncExample, "mag=2"
Ned
From: "Bradley Pietrzak" <[email protected]>
To: [email protected]
Sent: Thursday, September 22, 2011 10:53:37 AM
Subject: Combing Two State Sets into One
Hello,
The state notation language program shown below runs successfully. "magnet1" and "magnet2" are nothing more than simple analog inputs. Clearly, state sets one and two are identical, except for the process variables on which they operate. Ultimately, I'd like to combine the two state sets into a single state set which can operate on either pv1 or pv2, depending on which of the two variables I "pass" into it. Does the state notation compiler allow for such functionality? Any help would be greatly appreciated.
Thanks,
Bradley Pietrzak
Indiana University Center for the Exploration of Energy and Matter
/* Sample Program */
program sncExample
float pv1;
assign pv1 to "magnet1";
float pv2;
assign pv2 to "magnet2";
ss ss1 {
state one {
pv1 = 1;
pvPut(pv1);
} state two
state two {
pv1 = 2;
pvPut(pv1);
} state one
}
ss ss2 {
state one {
pv2 = 1;
pvPut(pv2);
} state two
state two {
pv2 = 2;
pvPut(pv2);
} state one
}