snl

Generate EPICS SNL state machines with PV operations and event flags.

1|1|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/BCDA-APS/opencode-skills --skill snl
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: snl
Source: https://github.com/BCDA-APS/opencode-skills/tree/main/snl
Command: npx skills add https://github.com/BCDA-APS/opencode-skills --skill snl

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you author EPICS State Notation Language (SNL) programs that coordinate concurrent state machines and reliably react to Process Variable (PV) changes.

Core Features & Use Cases

  • State machine authoring for EPICS: Define program, one or more ss (state sets), state, entry/exit blocks, and when(...) transitions for deterministic control flows.
  • PV interaction patterns: Connect variables to PVs with assign, keep them updated with monitor, and synchronize transitions using sync/syncq with evflag.
  • Async communication and integration: Perform pvGet/pvPut operations (including queued monitoring and completion checks) and embed C helpers via SNL escaped C code.
  • Use Case: Implement an IOC-side controller that monitors operator commands and sensor limits, raises safety states on threshold violations, and performs coordinated initialization via event-flag synchronization across multiple state sets.

Quick Start

Ask the AI to generate an SNL .st program named "interlockControl" that monitors {prefix}:start, {prefix}:fault, and {prefix}:status, uses an evflag to gate transitions, and includes embedded C code to compute a derived status string before updating a PV.

Frequently Asked Questions about snl

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write an EPICS state machine to coordinate concurrent control logic?

You write an EPICS state machine using State Notation Language (SNL) to define programs, state sets, and transition conditions for deterministic, concurrent control flows reacting to Process Variable (PV) changes.

What is the best way to monitor EPICS Process Variables and trigger state transitions?

The best way to monitor EPICS Process Variables is using SNL assign and monitor commands, then utilizing sync or syncq with event flags to reliably trigger state transitions when PV values update.

How do I embed C code inside an EPICS sequencer program?

You embed C code inside an EPICS sequencer program by using SNL escaped C code blocks, allowing you to integrate custom C helpers and compute derived values directly within your state machine logic.

Can I handle queued event handling and timed delays in EPICS SNL?

Yes, you can handle queued event handling and timed delays in EPICS SNL by utilizing syncq patterns for event queues and the delay() function for managing timed state transitions.

How do I synchronize multiple state sets in an EPICS sequencer?

You synchronize multiple EPICS sequencer state sets by using event flags (evflag) with sync or syncq declarations to coordinate initialization and gate transitions across concurrent state sets.