Hi EPICS folks,
For the state notation language, the when statement is mostly straightforward in that the code following the when statement occurs when the logical _expression_ inside the when statement is true. However, I'm a little
confused by the delay function in a when statement because something needs to start and monitor the timer for the delay. I need to understand this delay logic better for a EPICS robot control application I'm working on. When does the timer start and how is
it monitored for the delay? For example, if I use the following when statement for a state transition,
when(A==1 && delay(1.0) && B==1),
does the timer for the delay only start and continue after the A==1 logical condition is met and, after the delay is done, then it checks the B==1 logical condition? Thus, does the order of logical conditions in
the when statement make a difference so that when(delay(1.0) && A==1 && B==1) behaves differently? Here is one possible interpretation of when(A==1 && delay(1.0) && B==1):
time A B transition
----- --- --- ----------
0 0 0 none
1 0 0 none
2 1 0 none
2.5 1 1 none
3 1 0 none
4 1 1 yes
Or, does the timer for the delay only start and continue after both the A==1 and B==1 conditions are satisfied? In which case, we get the following result for when(A==1 && delay(1.0) && B==1):
time A B transition
----- --- --- ----------
0 0 0 none
1 0 0 none
2 1 0 none
2.5 1 1 none
3 1 0 none
4 1 1 none
5 1 1 yes
Or does the timer for the delay start as soon as the state containing the when statement becomes active and just continue? In this case, the results would be as follows for when(A==1 && delay(1.0) && B==1).
time A B transition
----- --- --- ----------
0 0 0 none
1 0 0 none
2 1 0 none
2.5 1 1 yes
I will test these different situations out, but I wanted to understand the underlying logic intent so that my SNL implementation will not break with future software versions.
Cheers,
Jay Steele
Xradia Corporation
The information in this email, including any attachments, is confidential and intended only for the recipient(s) listed. Any use of this email for any other purpose is prohibited. If you have received this email in error,
please notify me immediately by reply email, delete this email, and do not disclose its contents to anyone.
|