epics state notation language and sequencer
play

EPICS State Notation Language and Sequencer Limitations Whats New - PowerPoint PPT Presentation

Sequencer 2.1 Ben Franksen Introduction SNL in a Nutshell EPICS State Notation Language and Sequencer Limitations Whats New Version 2.1 Overview Scoped Variables Safe Mode Problem Ben Franksen Solution Next Steps Summary


  1. What is SNL? Sequencer 2.1 a domain specific language Ben Franksen for programming control applications Introduction SNL in a Nutshell in co-operation with an EPICS database Limitations What’s New typically used when control flow gets more complex than Overview Scoped Variables can be easily achieved with records and links Safe Mode Problem a (small) subset of the C language, plus features for Solution specifying finite state machines (state sets, keyword ss ) Next Steps binding program variables to PVs ( assign ) Summary specifying that such variables are to be automatically updated whenever the PV changes ( monitor ) explicit interaction with PVs ( pvPut , pvGet ) compiler translates SNL to C internally PVs are accessed via Channel Access

  2. What is SNL? Sequencer 2.1 a domain specific language Ben Franksen for programming control applications Introduction SNL in a Nutshell in co-operation with an EPICS database Limitations What’s New typically used when control flow gets more complex than Overview Scoped Variables can be easily achieved with records and links Safe Mode Problem a (small) subset of the C language, plus features for Solution specifying finite state machines (state sets, keyword ss ) Next Steps binding program variables to PVs ( assign ) Summary specifying that such variables are to be automatically updated whenever the PV changes ( monitor ) explicit interaction with PVs ( pvPut , pvGet ) compiler translates SNL to C internally PVs are accessed via Channel Access

  3. What is SNL? Sequencer 2.1 a domain specific language Ben Franksen for programming control applications Introduction SNL in a Nutshell in co-operation with an EPICS database Limitations What’s New typically used when control flow gets more complex than Overview Scoped Variables can be easily achieved with records and links Safe Mode Problem a (small) subset of the C language, plus features for Solution specifying finite state machines (state sets, keyword ss ) Next Steps binding program variables to PVs ( assign ) Summary specifying that such variables are to be automatically updated whenever the PV changes ( monitor ) explicit interaction with PVs ( pvPut , pvGet ) compiler translates SNL to C internally PVs are accessed via Channel Access

  4. Example Sequencer 2.1 skip animation program level check Ben Franksen declare variables float v; assign v to "Input voltage"; Introduction connect them to monitor v; SNL in a Nutshell EPICS PV names Limitations short light; What’s New assign light to "Indicator light"; automatically Overview update v to the Scoped Variables ss volt check { PV’s value Safe Mode state light off { Problem when (v > 5.0) { define a state set Solution /* turn light on */ light = 1; Next Steps if in this state pvPut(light); Summary } state light on ... and this } condition holds state light on { when (v < 5.0) { ... then execute /* turn light off */ these actions light = 0; pvPut(light); ... and switch to } state light off new state } }

  5. Example Sequencer 2.1 program level check Ben Franksen declare variables float v; assign v to "Input voltage"; connect them to Introduction monitor v; EPICS PV names SNL in a Nutshell Limitations short light; automatically What’s New assign light to "Indicator light"; update v to the Overview Scoped Variables ss volt check { PV’s value Safe Mode state light off { Problem when (v > 5.0) { define a state set Solution /* turn light on */ light = 1; if in this state Next Steps pvPut(light); Summary } state light on ... and this } condition holds state light on { ... then execute when (v < 5.0) { these actions /* turn light off */ light = 0; ... and switch to pvPut(light); } state light off new state } }

  6. Example Sequencer 2.1 program level check Ben Franksen declare variables float v; assign v to "Input voltage"; connect them to Introduction monitor v; EPICS PV names SNL in a Nutshell Limitations short light; automatically What’s New assign light to "Indicator light"; update v to the Overview Scoped Variables ss volt check { PV’s value Safe Mode state light off { Problem when (v > 5.0) { define a state set Solution /* turn light on */ light = 1; if in this state Next Steps pvPut(light); Summary } state light on ... and this } condition holds state light on { ... then execute when (v < 5.0) { these actions /* turn light off */ light = 0; ... and switch to pvPut(light); } state light off new state } }

  7. Example Sequencer 2.1 program level check Ben Franksen declare variables float v; assign v to "Input voltage"; connect them to Introduction monitor v; EPICS PV names SNL in a Nutshell Limitations short light; automatically What’s New assign light to "Indicator light"; update v to the Overview Scoped Variables ss volt check { PV’s value Safe Mode state light off { Problem when (v > 5.0) { define a state set Solution /* turn light on */ light = 1; if in this state Next Steps pvPut(light); Summary } state light on ... and this } condition holds state light on { ... then execute when (v < 5.0) { these actions /* turn light off */ light = 0; ... and switch to pvPut(light); } state light off new state } }

  8. Example Sequencer 2.1 program level check Ben Franksen declare variables float v; assign v to "Input voltage"; connect them to Introduction monitor v; EPICS PV names SNL in a Nutshell Limitations short light; automatically What’s New assign light to "Indicator light"; update v to the Overview Scoped Variables ss volt check { PV’s value Safe Mode state light off { Problem when (v > 5.0) { define a state set Solution /* turn light on */ light = 1; if in this state Next Steps pvPut(light); Summary } state light on ... and this } condition holds state light on { ... then execute when (v < 5.0) { these actions /* turn light off */ light = 0; ... and switch to pvPut(light); } state light off new state } }

  9. Example Sequencer 2.1 program level check Ben Franksen declare variables float v; assign v to "Input voltage"; connect them to Introduction monitor v; EPICS PV names SNL in a Nutshell Limitations short light; automatically What’s New assign light to "Indicator light"; update v to the Overview Scoped Variables ss volt check { PV’s value Safe Mode state light off { Problem when (v > 5.0) { define a state set Solution /* turn light on */ light = 1; if in this state Next Steps pvPut(light); Summary } state light on ... and this } condition holds state light on { ... then execute when (v < 5.0) { these actions /* turn light off */ light = 0; ... and switch to pvPut(light); } state light off new state } }

  10. Example Sequencer 2.1 program level check Ben Franksen declare variables float v; assign v to "Input voltage"; connect them to Introduction monitor v; EPICS PV names SNL in a Nutshell Limitations short light; automatically What’s New assign light to "Indicator light"; update v to the Overview Scoped Variables ss volt check { PV’s value Safe Mode state light off { Problem when (v > 5.0) { define a state set Solution /* turn light on */ light = 1; if in this state Next Steps pvPut(light); Summary } state light on ... and this } condition holds state light on { ... then execute when (v < 5.0) { these actions /* turn light off */ light = 0; ... and switch to pvPut(light); } state light off new state } }

  11. Example Sequencer 2.1 program level check Ben Franksen declare variables float v; assign v to "Input voltage"; connect them to Introduction monitor v; EPICS PV names SNL in a Nutshell Limitations short light; automatically What’s New assign light to "Indicator light"; update v to the Overview Scoped Variables ss volt check { PV’s value Safe Mode state light off { Problem when (v > 5.0) { define a state set Solution /* turn light on */ light = 1; if in this state Next Steps pvPut(light); Summary } state light on ... and this } condition holds state light on { ... then execute when (v < 5.0) { these actions /* turn light off */ light = 0; ... and switch to pvPut(light); } state light off new state } }

  12. Example Sequencer 2.1 program level check Ben Franksen declare variables float v; assign v to "Input voltage"; connect them to Introduction monitor v; EPICS PV names SNL in a Nutshell Limitations short light; automatically What’s New assign light to "Indicator light"; update v to the Overview Scoped Variables ss volt check { PV’s value Safe Mode state light off { Problem when (v > 5.0) { define a state set Solution /* turn light on */ light = 1; if in this state Next Steps pvPut(light); Summary } state light on ... and this } condition holds state light on { ... then execute when (v < 5.0) { these actions /* turn light off */ light = 0; ... and switch to pvPut(light); } state light off new state } }

  13. Example Sequencer 2.1 program level check Ben Franksen declare variables float v; assign v to "Input voltage"; connect them to Introduction monitor v; EPICS PV names SNL in a Nutshell Limitations short light; automatically What’s New assign light to "Indicator light"; update v to the Overview Scoped Variables ss volt check { PV’s value Safe Mode state light off { Problem when (v > 5.0) { define a state set Solution /* turn light on */ light = 1; if in this state Next Steps pvPut(light); Summary } state light on ... and this } condition holds state light on { ... then execute when (v < 5.0) { these actions /* turn light off */ light = 0; ... and switch to pvPut(light); } state light off new state } }

  14. Example Sequencer 2.1 program level check Ben Franksen declare variables float v; assign v to "Input voltage"; connect them to Introduction monitor v; EPICS PV names SNL in a Nutshell Limitations short light; automatically What’s New assign light to "Indicator light"; update v to the Overview Scoped Variables ss volt check { PV’s value Safe Mode state light off { Problem when (v > 5.0) { define a state set Solution /* turn light on */ light = 1; if in this state Next Steps pvPut(light); Summary } state light on ... and this } condition holds state light on { ... then execute when (v < 5.0) { these actions /* turn light off */ light = 0; ... and switch to pvPut(light); } state light off new state } }

  15. Example Sequencer 2.1 program level check Ben Franksen declare variables float v; assign v to "Input voltage"; connect them to Introduction monitor v; EPICS PV names SNL in a Nutshell Limitations short light; automatically What’s New assign light to "Indicator light"; update v to the Overview Scoped Variables ss volt check { PV’s value Safe Mode state light off { Problem when (v > 5.0) { define a state set Solution /* turn light on */ light = 1; if in this state Next Steps pvPut(light); Summary } state light on ... and this } condition holds state light on { ... then execute when (v < 5.0) { these actions /* turn light off */ light = 0; ... and switch to pvPut(light); } state light off new state } }

  16. Example Sequencer 2.1 program level check Ben Franksen declare variables float v; assign v to "Input voltage"; connect them to Introduction monitor v; EPICS PV names SNL in a Nutshell Limitations short light; automatically What’s New assign light to "Indicator light"; update v to the Overview Scoped Variables ss volt check { PV’s value Safe Mode state light off { Problem when (v > 5.0) { define a state set Solution /* turn light on */ light = 1; if in this state Next Steps pvPut(light); Summary } state light on ... and this } condition holds state light on { ... then execute when (v < 5.0) { these actions /* turn light off */ light = 0; ... and switch to pvPut(light); } state light off new state } }

  17. Outline Sequencer 2.1 Ben Franksen Introduction 1 Introduction SNL in a Nutshell SNL in a Nutshell Limitations Limitations What’s New Overview What’s New Scoped Variables 2 Safe Mode Overview Problem Solution Scoped Variables Next Steps Safe Mode Summary Next Steps 3 Summary 4

  18. Traditional Limitations of SNL Sequencer 2.1 Ben Franksen No type definitions Introduction SNL in a Nutshell No procedures or other abstraction facilities Limitations What’s New Only global variables, no initialization Overview Scoped Variables Restricted set of data types, roughly corresponding to Safe Mode Problem EPICS field types: Solution char , short , int , long (and unsigned versions) Next Steps float , double Summary string (synonym for char[MAX STRING SIZE] ) one or two dimensional arrays of above Escape to C code often used as work-around

  19. Traditional Limitations of SNL Sequencer 2.1 Ben Franksen No type definitions Introduction SNL in a Nutshell No procedures or other abstraction facilities Limitations What’s New Only global variables, no initialization Overview Scoped Variables Restricted set of data types, roughly corresponding to Safe Mode Problem EPICS field types: Solution char , short , int , long (and unsigned versions) Next Steps float , double Summary string (synonym for char[MAX STRING SIZE] ) one or two dimensional arrays of above Escape to C code often used as work-around

  20. Traditional Limitations of SNL Sequencer 2.1 Ben Franksen No type definitions Introduction SNL in a Nutshell No procedures or other abstraction facilities Limitations What’s New Only global variables, no initialization Overview Scoped Variables Restricted set of data types, roughly corresponding to Safe Mode Problem EPICS field types: Solution char , short , int , long (and unsigned versions) Next Steps float , double Summary string (synonym for char[MAX STRING SIZE] ) one or two dimensional arrays of above Escape to C code often used as work-around

  21. Traditional Limitations of SNL Sequencer 2.1 Ben Franksen No type definitions Introduction SNL in a Nutshell No procedures or other abstraction facilities Limitations What’s New Only global variables, no initialization Overview Scoped Variables Restricted set of data types, roughly corresponding to Safe Mode Problem EPICS field types: Solution char , short , int , long (and unsigned versions) Next Steps float , double Summary string (synonym for char[MAX STRING SIZE] ) one or two dimensional arrays of above Escape to C code often used as work-around

  22. Traditional Limitations of SNL Sequencer 2.1 Ben Franksen No type definitions Introduction SNL in a Nutshell No procedures or other abstraction facilities Limitations What’s New Only global variables, no initialization Overview Scoped Variables Restricted set of data types, roughly corresponding to Safe Mode Problem EPICS field types: Solution char , short , int , long (and unsigned versions) Next Steps float , double Summary string (synonym for char[MAX STRING SIZE] ) one or two dimensional arrays of above Escape to C code often used as work-around

  23. Traditional Limitations of SNL Sequencer 2.1 Ben Franksen No type definitions Introduction SNL in a Nutshell No procedures or other abstraction facilities Limitations What’s New Only global variables, no initialization Overview Scoped Variables Restricted set of data types, roughly corresponding to Safe Mode Problem EPICS field types: Solution char , short , int , long (and unsigned versions) Next Steps float , double Summary string (synonym for char[MAX STRING SIZE] ) one or two dimensional arrays of above Escape to C code often used as work-around

  24. Outline Sequencer 2.1 Ben Franksen Introduction 1 Introduction SNL in a Nutshell SNL in a Nutshell Limitations Limitations What’s New Overview What’s New Scoped Variables 2 Safe Mode Overview Problem Solution Scoped Variables Next Steps Safe Mode Summary Next Steps 3 Summary 4

  25. What’s new in 2.1? Syntactic restrictions lifted Sequencer 2.1 allow local variables in all blocks Ben Franksen support more variable types Introduction declarations with multiple variables and initialization SNL in a Nutshell Additions: you can now Limitations What’s New jump to a new state from action code: state new state; Overview exit program instead of transition to a new state: Scoped Variables Safe Mode when(...) { ... } exit Problem avoid ”used but not defined” warnings by declaring Solution Next Steps foreign identifiers (variables, macros, whatever) Safe Mode: avoid race conditions for global variables Summary Improved documentation Started adding automated regression tests (no complete coverage yet) Many bugs fixed, general code cleanup Deep refactorings may have introduced new bugs (but hopefully only shallow ones)

  26. What’s new in 2.1? Syntactic restrictions lifted Sequencer 2.1 allow local variables in all blocks Ben Franksen support more variable types Introduction declarations with multiple variables and initialization SNL in a Nutshell Additions: you can now Limitations What’s New jump to a new state from action code: state new state; Overview exit program instead of transition to a new state: Scoped Variables Safe Mode when(...) { ... } exit Problem avoid ”used but not defined” warnings by declaring Solution Next Steps foreign identifiers (variables, macros, whatever) Safe Mode: avoid race conditions for global variables Summary Improved documentation Started adding automated regression tests (no complete coverage yet) Many bugs fixed, general code cleanup Deep refactorings may have introduced new bugs (but hopefully only shallow ones)

  27. What’s new in 2.1? Syntactic restrictions lifted Sequencer 2.1 allow local variables in all blocks Ben Franksen support more variable types Introduction declarations with multiple variables and initialization SNL in a Nutshell Additions: you can now Limitations What’s New jump to a new state from action code: state new state; Overview exit program instead of transition to a new state: Scoped Variables Safe Mode when(...) { ... } exit Problem avoid ”used but not defined” warnings by declaring Solution Next Steps foreign identifiers (variables, macros, whatever) Safe Mode TM : avoid race conditions for global variables Summary Improved documentation Started adding automated regression tests (no complete coverage yet) Many bugs fixed, general code cleanup Deep refactorings may have introduced new bugs (but hopefully only shallow ones)

  28. What’s new in 2.1? Syntactic restrictions lifted Sequencer 2.1 allow local variables in all blocks Ben Franksen support more variable types Introduction declarations with multiple variables and initialization SNL in a Nutshell Additions: you can now Limitations What’s New jump to a new state from action code: state new state; Overview exit program instead of transition to a new state: Scoped Variables Safe Mode when(...) { ... } exit Problem avoid ”used but not defined” warnings by declaring Solution Next Steps foreign identifiers (variables, macros, whatever) Safe Mode: avoid race conditions for global variables Summary Improved documentation Started adding automated regression tests (no complete coverage yet) Many bugs fixed, general code cleanup Deep refactorings may have introduced new bugs (but hopefully only shallow ones)

  29. What’s new in 2.1? Syntactic restrictions lifted Sequencer 2.1 allow local variables in all blocks Ben Franksen support more variable types Introduction declarations with multiple variables and initialization SNL in a Nutshell Additions: you can now Limitations What’s New jump to a new state from action code: state new state; Overview exit program instead of transition to a new state: Scoped Variables Safe Mode when(...) { ... } exit Problem avoid ”used but not defined” warnings by declaring Solution Next Steps foreign identifiers (variables, macros, whatever) Safe Mode: avoid race conditions for global variables Summary Improved documentation Started adding automated regression tests (no complete coverage yet) Many bugs fixed, general code cleanup Deep refactorings may have introduced new bugs (but hopefully only shallow ones)

  30. What’s new in 2.1? Syntactic restrictions lifted Sequencer 2.1 allow local variables in all blocks Ben Franksen support more variable types Introduction declarations with multiple variables and initialization SNL in a Nutshell Additions: you can now Limitations What’s New jump to a new state from action code: state new state; Overview exit program instead of transition to a new state: Scoped Variables Safe Mode when(...) { ... } exit Problem avoid ”used but not defined” warnings by declaring Solution Next Steps foreign identifiers (variables, macros, whatever) Safe Mode: avoid race conditions for global variables Summary Improved documentation Started adding automated regression tests (no complete coverage yet) Many bugs fixed, general code cleanup Deep refactorings may have introduced new bugs (but hopefully only shallow ones)

  31. What’s new in 2.1? Syntactic restrictions lifted Sequencer 2.1 allow local variables in all blocks Ben Franksen support more variable types Introduction declarations with multiple variables and initialization SNL in a Nutshell Additions: you can now Limitations What’s New jump to a new state from action code: state new state; Overview exit program instead of transition to a new state: Scoped Variables Safe Mode when(...) { ... } exit Problem avoid ”used but not defined” warnings by declaring Solution Next Steps foreign identifiers (variables, macros, whatever) Safe Mode: avoid race conditions for global variables Summary Improved documentation Started adding automated regression tests (no complete coverage yet) Many bugs fixed, general code cleanup Deep refactorings may have introduced new bugs (but hopefully only shallow ones)

  32. Outline Sequencer 2.1 Ben Franksen Introduction 1 Introduction SNL in a Nutshell SNL in a Nutshell Limitations Limitations What’s New Overview What’s New Scoped Variables 2 Safe Mode Overview Problem Solution Scoped Variables Next Steps Safe Mode Summary Next Steps 3 Summary 4

  33. Scoped Variables Sequencer 2.1 Ben Franksen Variables can be declared on all levels Introduction SNL in a Nutshell They come in two variants Limitations nested anywhere inside action blocks (state transition, What’s New entry, exit) Overview Scoped Variables temporary, like local ( auto ) variables in C Safe Mode Problem no assign to PVs allowed Solution at the start of states and state set blocks Next Steps persistent until program ends, like C static variables Summary but reentrant (if option +r is active) and statically scoped, i.e. invisible to code outside the block can be assign ed, monitor ed, etc. like globals

  34. Scoped Variables Sequencer 2.1 Ben Franksen Variables can be declared on all levels Introduction SNL in a Nutshell They come in two variants Limitations nested anywhere inside action blocks (state transition, What’s New entry, exit) Overview Scoped Variables temporary, like local ( auto ) variables in C Safe Mode Problem no assign to PVs allowed Solution at the start of states and state set blocks Next Steps persistent until program ends, like C static variables Summary but reentrant (if option +r is active) and statically scoped, i.e. invisible to code outside the block can be assign ed, monitor ed, etc. like globals

  35. Scoped Variables Sequencer 2.1 Ben Franksen Variables can be declared on all levels Introduction SNL in a Nutshell They come in two variants Limitations nested anywhere inside action blocks (state transition, What’s New entry, exit) Overview Scoped Variables temporary, like local ( auto ) variables in C Safe Mode Problem no assign to PVs allowed Solution at the start of states and state set blocks Next Steps persistent until program ends, like C static variables Summary but reentrant (if option +r is active) and statically scoped, i.e. invisible to code outside the block can be assign ed, monitor ed, etc. like globals

  36. Scoped Variables Sequencer 2.1 Ben Franksen Variables can be declared on all levels Introduction SNL in a Nutshell They come in two variants Limitations nested anywhere inside action blocks (state transition, What’s New entry, exit) Overview Scoped Variables temporary, like local ( auto ) variables in C Safe Mode Problem no assign to PVs allowed Solution at the start of states and state set blocks Next Steps persistent until program ends, like C static variables Summary but reentrant (if option +r is active) and statically scoped, i.e. invisible to code outside the block can be assign ed, monitor ed, etc. like globals

  37. Scoped Variables Sequencer 2.1 Ben Franksen Variables can be declared on all levels Introduction SNL in a Nutshell They come in two variants Limitations nested anywhere inside action blocks (state transition, What’s New entry, exit) Overview Scoped Variables temporary, like local ( auto ) variables in C Safe Mode Problem no assign to PVs allowed Solution at the start of states and state set blocks Next Steps persistent until program ends, like C static variables Summary but reentrant (if option +r is active) and statically scoped, i.e. invisible to code outside the block can be assign ed, monitor ed, etc. like globals

  38. Scoped Variables Sequencer 2.1 Ben Franksen Variables can be declared on all levels Introduction SNL in a Nutshell They come in two variants Limitations nested anywhere inside action blocks (state transition, What’s New entry, exit) Overview Scoped Variables temporary, like local ( auto ) variables in C Safe Mode Problem no assign to PVs allowed Solution at the start of states and state set blocks Next Steps persistent until program ends, like C static variables Summary but reentrant (if option +r is active) and statically scoped, i.e. invisible to code outside the block can be assign ed, monitor ed, etc. like globals

  39. Scoped Variables Sequencer 2.1 Ben Franksen Variables can be declared on all levels Introduction SNL in a Nutshell They come in two variants Limitations nested anywhere inside action blocks (state transition, What’s New entry, exit) Overview Scoped Variables temporary, like local ( auto ) variables in C Safe Mode Problem no assign to PVs allowed Solution at the start of states and state set blocks Next Steps persistent until program ends, like C static variables Summary but reentrant (if option +r is active) and statically scoped, i.e. invisible to code outside the block can be assign ed, monitor ed, etc. like globals

  40. Scoped Variables Sequencer 2.1 Ben Franksen Variables can be declared on all levels Introduction SNL in a Nutshell They come in two variants Limitations nested anywhere inside action blocks (state transition, What’s New entry, exit) Overview Scoped Variables temporary, like local ( auto ) variables in C Safe Mode Problem no assign to PVs allowed Solution at the start of states and state set blocks Next Steps persistent until program ends, like C static variables Summary but reentrant (if option +r is active) and statically scoped, i.e. invisible to code outside the block can be assign ed, monitor ed, etc. like globals

  41. Scoped Variables Sequencer 2.1 Ben Franksen Variables can be declared on all levels Introduction SNL in a Nutshell They come in two variants Limitations nested anywhere inside action blocks (state transition, What’s New entry, exit) Overview Scoped Variables temporary, like local ( auto ) variables in C Safe Mode Problem no assign to PVs allowed Solution at the start of states and state set blocks Next Steps persistent until program ends, like C static variables Summary but reentrant (if option +r is active) and statically scoped, i.e. invisible to code outside the block can be assign ed, monitor ed, etc. like globals

  42. Scoped Variables Sequencer 2.1 Ben Franksen Variables can be declared on all levels Introduction SNL in a Nutshell They come in two variants Limitations nested anywhere inside action blocks (state transition, What’s New entry, exit) Overview Scoped Variables temporary, like local ( auto ) variables in C Safe Mode Problem no assign to PVs allowed Solution at the start of states and state set blocks Next Steps persistent until program ends, like C static variables Summary but reentrant (if option +r is active) and statically scoped, i.e. invisible to code outside the block can be assign ed, monitor ed, etc. like globals

  43. Outline Sequencer 2.1 Ben Franksen Introduction 1 Introduction SNL in a Nutshell SNL in a Nutshell Limitations Limitations What’s New Overview What’s New Scoped Variables 2 Safe Mode Overview Problem Solution Scoped Variables Next Steps Safe Mode Summary Next Steps 3 Summary 4

  44. Motivation Sequencer 2.1 Ben Franksen Introduction SNL in a Nutshell From the SNL mission statement: Limitations What’s New The state notation language allows programming Overview Scoped Variables sequential operations that interact with EPICS Safe Mode process variables without the usual complexity Problem Solution involved with task scheduling, semaphores, event Next Steps handling, and I/O programming. [...] Summary

  45. Motivation Sequencer 2.1 Ben Franksen Introduction SNL in a Nutshell From the SNL mission statement: Limitations What’s New The state notation language allows programming Overview Scoped Variables sequential operations that interact with EPICS Safe Mode process variables without the usual complexity Problem Solution involved with task scheduling, semaphores, event Next Steps handling, and I/O programming. [...] Summary

  46. Motivation Sequencer 2.1 Ben Franksen Introduction SNL in a Nutshell From the SNL mission statement: Limitations What’s New The state notation language allows programming Overview Scoped Variables sequential operations that interact with EPICS Safe Mode process variables without the usual complexity Problem Solution involved with task scheduling, semaphores, event Next Steps handling, and I/O programming. [...] Summary Unfortunately this is not the case.

  47. The Problem Sequencer 2.1 Ben Franksen SNL variables are not protected from concurrent access Introduction Threads involved SNL in a Nutshell Limitations one or more state sets that access a variable What’s New the CA callback thread, performing the variable updates Overview Scoped Variables (monitor, get completion) Safe Mode Problem Variables can become corrupted if access is non-atomic Solution Next Steps Resulting failures are extremely difficult to debug Summary There is no reliable work-around for the SNL programmer CA updates can intervene at any time A serious bug that has to be fixed But how?

  48. The Problem Sequencer 2.1 Ben Franksen SNL variables are not protected from concurrent access Introduction Threads involved SNL in a Nutshell Limitations one or more state sets that access a variable What’s New the CA callback thread, performing the variable updates Overview Scoped Variables (monitor, get completion) Safe Mode Problem Variables can become corrupted if access is non-atomic Solution Next Steps Resulting failures are extremely difficult to debug Summary There is no reliable work-around for the SNL programmer CA updates can intervene at any time A serious bug that has to be fixed But how?

  49. The Problem Sequencer 2.1 Ben Franksen SNL variables are not protected from concurrent access Introduction Threads involved SNL in a Nutshell Limitations one or more state sets that access a variable What’s New the CA callback thread, performing the variable updates Overview Scoped Variables (monitor, get completion) Safe Mode Problem Variables can become corrupted if access is non-atomic Solution Next Steps Resulting failures are extremely difficult to debug Summary There is no reliable work-around for the SNL programmer CA updates can intervene at any time A serious bug that has to be fixed But how?

  50. The Problem Sequencer 2.1 Ben Franksen SNL variables are not protected from concurrent access Introduction Threads involved SNL in a Nutshell Limitations one or more state sets that access a variable What’s New the CA callback thread, performing the variable updates Overview Scoped Variables (monitor, get completion) Safe Mode Problem Variables can become corrupted if access is non-atomic Solution Next Steps Resulting failures are extremely difficult to debug Summary There is no reliable work-around for the SNL programmer CA updates can intervene at any time A serious bug that has to be fixed But how?

  51. The Problem Sequencer 2.1 Ben Franksen SNL variables are not protected from concurrent access Introduction Threads involved SNL in a Nutshell Limitations one or more state sets that access a variable What’s New the CA callback thread, performing the variable updates Overview Scoped Variables (monitor, get completion) Safe Mode Problem Variables can become corrupted if access is non-atomic Solution Next Steps Resulting failures are extremely difficult to debug Summary There is no reliable work-around for the SNL programmer CA updates can intervene at any time A serious bug that has to be fixed But how?

  52. The Problem Sequencer 2.1 Ben Franksen SNL variables are not protected from concurrent access Introduction Threads involved SNL in a Nutshell Limitations one or more state sets that access a variable What’s New the CA callback thread, performing the variable updates Overview Scoped Variables (monitor, get completion) Safe Mode Problem Variables can become corrupted if access is non-atomic Solution Next Steps Resulting failures are extremely difficult to debug Summary There is no reliable work-around for the SNL programmer CA updates can intervene at any time A serious bug that has to be fixed But how?

  53. The Problem Sequencer 2.1 Ben Franksen SNL variables are not protected from concurrent access Introduction Threads involved SNL in a Nutshell Limitations one or more state sets that access a variable What’s New the CA callback thread, performing the variable updates Overview Scoped Variables (monitor, get completion) Safe Mode Problem Variables can become corrupted if access is non-atomic Solution Next Steps Resulting failures are extremely difficult to debug Summary There is no reliable work-around for the SNL programmer CA updates can intervene at any time A serious bug that has to be fixed But how?

  54. The Problem Sequencer 2.1 Ben Franksen SNL variables are not protected from concurrent access Introduction Threads involved SNL in a Nutshell Limitations one or more state sets that access a variable What’s New the CA callback thread, performing the variable updates Overview Scoped Variables (monitor, get completion) Safe Mode Problem Variables can become corrupted if access is non-atomic Solution Next Steps Resulting failures are extremely difficult to debug Summary There is no reliable work-around for the SNL programmer CA updates can intervene at any time A serious bug that has to be fixed But how?

  55. The Problem Sequencer 2.1 Ben Franksen SNL variables are not protected from concurrent access Introduction Threads involved SNL in a Nutshell Limitations one or more state sets that access a variable What’s New the CA callback thread, performing the variable updates Overview Scoped Variables (monitor, get completion) Safe Mode Problem Variables can become corrupted if access is non-atomic Solution Next Steps Resulting failures are extremely difficult to debug Summary There is no reliable work-around for the SNL programmer CA updates can intervene at any time A serious bug that has to be fixed But how?

  56. Solution Sequencer 2.1 Each state set operates on its own copy of each variable Ben Franksen Aynchronous CA updates operate on yet another copy State sets are completely isolated from each other and Introduction SNL in a Nutshell from asynchronous variable updates Limitations Synchronization (exchange of data) happens only outside What’s New Overview user visible (SNL) code: Scoped Variables Safe Mode for monitored variables: immediately before Problem when -conditions are checked Solution for all assigned variables: inside pvGet / pvPut and Next Steps related built-in functions (but only the synchronous Summary versions that actually access the variable) Nice side effect: conditions established in when(...) clauses are never invalidated except explicitly by the invoked action code Not completely backwards compatible, therefore must be enabled with an option +s . Implies re-entrant mode.

  57. Solution Sequencer 2.1 Each state set operates on its own copy of each variable Ben Franksen Aynchronous CA updates operate on yet another copy State sets are completely isolated from each other and Introduction SNL in a Nutshell from asynchronous variable updates Limitations Synchronization (exchange of data) happens only outside What’s New Overview user visible (SNL) code: Scoped Variables Safe Mode for monitored variables: immediately before Problem when -conditions are checked Solution for all assigned variables: inside pvGet / pvPut and Next Steps related built-in functions (but only the synchronous Summary versions that actually access the variable) Nice side effect: conditions established in when(...) clauses are never invalidated except explicitly by the invoked action code Not completely backwards compatible, therefore must be enabled with an option +s . Implies re-entrant mode.

  58. Solution Sequencer 2.1 Each state set operates on its own copy of each variable Ben Franksen Aynchronous CA updates operate on yet another copy State sets are completely isolated from each other and Introduction SNL in a Nutshell from asynchronous variable updates Limitations Synchronization (exchange of data) happens only outside What’s New Overview user visible (SNL) code: Scoped Variables Safe Mode for monitored variables: immediately before Problem when -conditions are checked Solution for all assigned variables: inside pvGet / pvPut and Next Steps related built-in functions (but only the synchronous Summary versions that actually access the variable) Nice side effect: conditions established in when(...) clauses are never invalidated except explicitly by the invoked action code Not completely backwards compatible, therefore must be enabled with an option +s . Implies re-entrant mode.

  59. Solution Sequencer 2.1 Each state set operates on its own copy of each variable Ben Franksen Aynchronous CA updates operate on yet another copy State sets are completely isolated from each other and Introduction SNL in a Nutshell from asynchronous variable updates Limitations Synchronization (exchange of data) happens only outside What’s New Overview user visible (SNL) code: Scoped Variables Safe Mode for monitored variables: immediately before Problem when -conditions are checked Solution for all assigned variables: inside pvGet / pvPut and Next Steps related built-in functions (but only the synchronous Summary versions that actually access the variable) Nice side effect: conditions established in when(...) clauses are never invalidated except explicitly by the invoked action code Not completely backwards compatible, therefore must be enabled with an option +s . Implies re-entrant mode.

  60. Solution Sequencer 2.1 Each state set operates on its own copy of each variable Ben Franksen Aynchronous CA updates operate on yet another copy State sets are completely isolated from each other and Introduction SNL in a Nutshell from asynchronous variable updates Limitations Synchronization (exchange of data) happens only outside What’s New Overview user visible (SNL) code: Scoped Variables Safe Mode for monitored variables: immediately before Problem when -conditions are checked Solution for all assigned variables: inside pvGet / pvPut and Next Steps related built-in functions (but only the synchronous Summary versions that actually access the variable) Nice side effect: conditions established in when(...) clauses are never invalidated except explicitly by the invoked action code Not completely backwards compatible, therefore must be enabled with an option +s . Implies re-entrant mode.

  61. Solution Sequencer 2.1 Each state set operates on its own copy of each variable Ben Franksen Aynchronous CA updates operate on yet another copy State sets are completely isolated from each other and Introduction SNL in a Nutshell from asynchronous variable updates Limitations Synchronization (exchange of data) happens only outside What’s New Overview user visible (SNL) code: Scoped Variables Safe Mode for monitored variables: immediately before Problem when -conditions are checked Solution for all assigned variables: inside pvGet / pvPut and Next Steps related built-in functions (but only the synchronous Summary versions that actually access the variable) Nice side effect: conditions established in when(...) clauses are never invalidated except explicitly by the invoked action code Not completely backwards compatible, therefore must be enabled with an option +s . Implies re-entrant mode.

  62. Solution Sequencer 2.1 Each state set operates on its own copy of each variable Ben Franksen Aynchronous CA updates operate on yet another copy State sets are completely isolated from each other and Introduction SNL in a Nutshell from asynchronous variable updates Limitations Synchronization (exchange of data) happens only outside What’s New Overview user visible (SNL) code: Scoped Variables Safe Mode for monitored variables: immediately before Problem when -conditions are checked Solution for all assigned variables: inside pvGet / pvPut and Next Steps related built-in functions (but only the synchronous Summary versions that actually access the variable) Nice side effect: conditions established in when(...) clauses are never invalidated except explicitly by the invoked action code Not completely backwards compatible, therefore must be enabled with an option +s . Implies re-entrant mode.

  63. Solution Sequencer 2.1 Each state set operates on its own copy of each variable Ben Franksen Aynchronous CA updates operate on yet another copy State sets are completely isolated from each other and Introduction SNL in a Nutshell from asynchronous variable updates Limitations Synchronization (exchange of data) happens only outside What’s New Overview user visible (SNL) code: Scoped Variables Safe Mode for monitored variables: immediately before Problem when -conditions are checked Solution for all assigned variables: inside pvGet / pvPut and Next Steps related built-in functions (but only the synchronous Summary versions that actually access the variable) Nice side effect: conditions established in when(...) clauses are never invalidated except explicitly by the invoked action code Not completely backwards compatible, therefore must be enabled with an option +s . Implies re-entrant mode.

  64. Anonymous Pvs Sequencer 2.1 Safe mode prevents state sets from communicating via Ben Franksen global variables Introduction Event flags work but can communicate only booleans SNL in a Nutshell Limitations For other data types: use Anonymous PVs What’s New Overview Syntax: global variable assigned to "" , short form: Scoped Variables Safe Mode assign x; (scalars) Problem Solution assign x {} ; (arrays) Next Steps Use pvPut , pvGet , and monitor like with normal Summary (named) PVs Named and anononymous PVs can be freely exchanged, all built-in functions behave in the the same way event flag ≡ anonymous boolean PV (modulo sync )

  65. Anonymous Pvs Sequencer 2.1 Safe mode prevents state sets from communicating via Ben Franksen global variables Introduction Event flags work but can communicate only booleans SNL in a Nutshell Limitations For other data types: use Anonymous PVs What’s New Overview Syntax: global variable assigned to "" , short form: Scoped Variables Safe Mode assign x; (scalars) Problem Solution assign x {} ; (arrays) Next Steps Use pvPut , pvGet , and monitor like with normal Summary (named) PVs Named and anononymous PVs can be freely exchanged, all built-in functions behave in the the same way event flag ≡ anonymous boolean PV (modulo sync )

  66. Anonymous Pvs Sequencer 2.1 Safe mode prevents state sets from communicating via Ben Franksen global variables Introduction Event flags work but can communicate only booleans SNL in a Nutshell Limitations For other data types: use Anonymous PVs TM What’s New Overview Syntax: global variable assigned to "" , short form: Scoped Variables Safe Mode assign x; (scalars) Problem Solution assign x {} ; (arrays) Next Steps Use pvPut , pvGet , and monitor like with normal Summary (named) PVs Named and anononymous PVs can be freely exchanged, all built-in functions behave in the the same way event flag ≡ anonymous boolean PV (modulo sync )

  67. Anonymous Pvs Sequencer 2.1 Safe mode prevents state sets from communicating via Ben Franksen global variables Introduction Event flags work but can communicate only booleans SNL in a Nutshell Limitations For other data types: use Anonymous PVs What’s New Overview Syntax: global variable assigned to "" , short form: Scoped Variables Safe Mode assign x; (scalars) Problem Solution assign x {} ; (arrays) Next Steps Use pvPut , pvGet , and monitor like with normal Summary (named) PVs Named and anononymous PVs can be freely exchanged, all built-in functions behave in the the same way event flag ≡ anonymous boolean PV (modulo sync )

  68. Anonymous Pvs Sequencer 2.1 Safe mode prevents state sets from communicating via Ben Franksen global variables Introduction Event flags work but can communicate only booleans SNL in a Nutshell Limitations For other data types: use Anonymous PVs What’s New Overview Syntax: global variable assigned to "" , short form: Scoped Variables Safe Mode assign x; (scalars) Problem Solution assign x {} ; (arrays) Next Steps Use pvPut , pvGet , and monitor like with normal Summary (named) PVs Named and anononymous PVs can be freely exchanged, all built-in functions behave in the the same way event flag ≡ anonymous boolean PV (modulo sync )

  69. Anonymous Pvs Sequencer 2.1 Safe mode prevents state sets from communicating via Ben Franksen global variables Introduction Event flags work but can communicate only booleans SNL in a Nutshell Limitations For other data types: use Anonymous PVs What’s New Overview Syntax: global variable assigned to "" , short form: Scoped Variables Safe Mode assign x; (scalars) Problem Solution assign x {} ; (arrays) Next Steps Use pvPut , pvGet , and monitor like with normal Summary (named) PVs Named and anononymous PVs can be freely exchanged, all built-in functions behave in the the same way event flag ≡ anonymous boolean PV (modulo sync )

  70. Anonymous Pvs Sequencer 2.1 Safe mode prevents state sets from communicating via Ben Franksen global variables Introduction Event flags work but can communicate only booleans SNL in a Nutshell Limitations For other data types: use Anonymous PVs What’s New Overview Syntax: global variable assigned to "" , short form: Scoped Variables Safe Mode assign x; (scalars) Problem Solution assign x {} ; (arrays) Next Steps Use pvPut , pvGet , and monitor like with normal Summary (named) PVs Named and anononymous PVs can be freely exchanged, all built-in functions behave in the the same way event flag ≡ anonymous boolean PV (modulo sync )

  71. Anonymous Pvs Sequencer 2.1 Safe mode prevents state sets from communicating via Ben Franksen global variables Introduction Event flags work but can communicate only booleans SNL in a Nutshell Limitations For other data types: use Anonymous PVs What’s New Overview Syntax: global variable assigned to "" , short form: Scoped Variables Safe Mode assign x; (scalars) Problem Solution assign x {} ; (arrays) Next Steps Use pvPut , pvGet , and monitor like with normal Summary (named) PVs Named and anononymous PVs can be freely exchanged, all built-in functions behave in the the same way event flag ≡ anonymous boolean PV (modulo sync )

  72. Anonymous Pvs Sequencer 2.1 Safe mode prevents state sets from communicating via Ben Franksen global variables Introduction Event flags work but can communicate only booleans SNL in a Nutshell Limitations For other data types: use Anonymous PVs What’s New Overview Syntax: global variable assigned to "" , short form: Scoped Variables Safe Mode assign x; (scalars) Problem Solution assign x {} ; (arrays) Next Steps Use pvPut , pvGet , and monitor like with normal Summary (named) PVs Named and anononymous PVs can be freely exchanged, all built-in functions behave in the the same way event flag ≡ anonymous boolean PV (modulo sync ) Rationale

  73. Outline Sequencer 2.1 Ben Franksen Introduction 1 Introduction SNL in a Nutshell SNL in a Nutshell Limitations Limitations What’s New Overview What’s New Scoped Variables 2 Safe Mode Overview Problem Solution Scoped Variables Next Steps Safe Mode Summary Next Steps 3 Summary 4

  74. Next Steps Sequencer 2.1 Integrate code from DESY to support redundant IOCs Ben Franksen Add more regression tests Introduction Remove stuff that is ugly and obsolete SNL in a Nutshell Limitations PV layer (a C++ wrapper around CA or other protocols) What’s New devSequencer (device support for monitoring seq’s internal Overview state) Scoped Variables Safe Mode Lift further restrictions Problem Solution allow foreign (C) types to be used in declarations Next Steps define data types (e.g. struct ) in SNL? Summary New notation for assign , monitor , sync , etc. all extra attributes of a variable in one place obviate the need for user defined CPP macros need a good idea for the syntax Add some kind of abstraction facility parameterizable state sets (a.k.a. procedures) explain details

  75. Next Steps Sequencer 2.1 Integrate code from DESY to support redundant IOCs Ben Franksen Add more regression tests Introduction Remove stuff that is ugly and obsolete SNL in a Nutshell Limitations PV layer (a C++ wrapper around CA or other protocols) What’s New devSequencer (device support for monitoring seq’s internal Overview state) Scoped Variables Safe Mode Lift further restrictions Problem Solution allow foreign (C) types to be used in declarations Next Steps define data types (e.g. struct ) in SNL? Summary New notation for assign , monitor , sync , etc. all extra attributes of a variable in one place obviate the need for user defined CPP macros need a good idea for the syntax Add some kind of abstraction facility parameterizable state sets (a.k.a. procedures) explain details

  76. Next Steps Sequencer 2.1 Integrate code from DESY to support redundant IOCs Ben Franksen Add more regression tests Introduction Remove stuff that is ugly and obsolete SNL in a Nutshell Limitations PV layer (a C++ wrapper around CA or other protocols) What’s New devSequencer (device support for monitoring seq’s internal Overview state) Scoped Variables Safe Mode Lift further restrictions Problem Solution allow foreign (C) types to be used in declarations Next Steps define data types (e.g. struct ) in SNL? Summary New notation for assign , monitor , sync , etc. all extra attributes of a variable in one place obviate the need for user defined CPP macros need a good idea for the syntax Add some kind of abstraction facility parameterizable state sets (a.k.a. procedures) explain details

  77. Next Steps Sequencer 2.1 Integrate code from DESY to support redundant IOCs Ben Franksen Add more regression tests Introduction Remove stuff that is ugly and obsolete SNL in a Nutshell Limitations PV layer (a C++ wrapper around CA or other protocols) What’s New devSequencer (device support for monitoring seq’s internal Overview state) Scoped Variables Safe Mode Lift further restrictions Problem Solution allow foreign (C) types to be used in declarations Next Steps define data types (e.g. struct ) in SNL? Summary New notation for assign , monitor , sync , etc. all extra attributes of a variable in one place obviate the need for user defined CPP macros need a good idea for the syntax Add some kind of abstraction facility parameterizable state sets (a.k.a. procedures) explain details

  78. Next Steps Sequencer 2.1 Integrate code from DESY to support redundant IOCs Ben Franksen Add more regression tests Introduction Remove stuff that is ugly and obsolete SNL in a Nutshell Limitations PV layer (a C++ wrapper around CA or other protocols) What’s New devSequencer (device support for monitoring seq’s internal Overview state) Scoped Variables Safe Mode Lift further restrictions Problem Solution allow foreign (C) types to be used in declarations Next Steps define data types (e.g. struct ) in SNL? Summary New notation for assign , monitor , sync , etc. all extra attributes of a variable in one place obviate the need for user defined CPP macros need a good idea for the syntax Add some kind of abstraction facility parameterizable state sets (a.k.a. procedures) explain details

  79. Next Steps Sequencer 2.1 Integrate code from DESY to support redundant IOCs Ben Franksen Add more regression tests Introduction Remove stuff that is ugly and obsolete SNL in a Nutshell Limitations PV layer (a C++ wrapper around CA or other protocols) What’s New devSequencer (device support for monitoring seq’s internal Overview state) Scoped Variables Safe Mode Lift further restrictions Problem Solution allow foreign (C) types to be used in declarations Next Steps define data types (e.g. struct ) in SNL? Summary New notation for assign , monitor , sync , etc. all extra attributes of a variable in one place obviate the need for user defined CPP macros need a good idea for the syntax Add some kind of abstraction facility parameterizable state sets (a.k.a. procedures) explain details

  80. Summary Sequencer 2.1 Ben Franksen Introduction SNL in a Nutshell For a long time the Sequencer suffered from neglect. Limitations This has changed, it is again actively maintained, new What’s New Overview features are being added, bugs are getting fixed, even deep Scoped Variables Safe Mode and difficult ones. Problem Solution The 2.1.x releases prove that many of the traditional Next Steps limitations and restrictions in SNL can be overcome with Summary reasonable effort by suitable re-engineering. Expect further improvements in version 2.2.

  81. Summary Sequencer 2.1 Ben Franksen Introduction SNL in a Nutshell For a long time the Sequencer suffered from neglect. Limitations This has changed, it is again actively maintained, new What’s New Overview features are being added, bugs are getting fixed, even deep Scoped Variables Safe Mode and difficult ones. Problem Solution The 2.1.x releases prove that many of the traditional Next Steps limitations and restrictions in SNL can be overcome with Summary reasonable effort by suitable re-engineering. Expect further improvements in version 2.2.

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend