Files
epics_training_webpages/tutorials/caClientLessons/index.html
T
2026-05-29 14:34:44 +00:00

1482 lines
38 KiB
HTML

<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="description" content="This is the collection of all EPICS Training webpages at PSI provided by the section Controls in AEK.
">
<meta name="author" content="Paul Scherrer Institute">
<link rel="canonical" href="https://epics_training.pages.psi.ch/epics_training_webpages/tutorials/caClientLessons/">
<link rel="prev" href="../cooler_simulation/">
<link rel="next" href="../../stepbystep/">
<link rel="icon" href="../../assets/images/favicon.png">
<meta name="generator" content="zensical-0.0.11">
<title>Lessons on Channel Access Client Programming - EPICS Training at PSI</title>
<link rel="stylesheet" href="../../assets/stylesheets/modern/main.bd6182e7.min.css">
<link rel="stylesheet" href="../../assets/stylesheets/modern/palette.dfe2e883.min.css">
<style>:root{}</style>
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inter:300,300i,400,400i,500,500i,700,700i%7CJetBrains+Mono:400,400i,700,700i&display=fallback">
<style>:root{--md-text-font:"Inter";--md-code-font:"JetBrains Mono"}</style>
<script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce(((e,t)=>(e<<5)-e+t.charCodeAt(0)),0),__md_get=(e,t=localStorage,a=__md_scope)=>JSON.parse(t.getItem(a.pathname+"."+e)),__md_set=(e,t,a=localStorage,_=__md_scope)=>{try{a.setItem(_.pathname+"."+e,JSON.stringify(t))}catch(e){}},document.documentElement.setAttribute("data-platform",navigator.platform)</script>
</head>
<body dir="ltr" data-md-color-scheme="default" data-md-color-primary="indigo" data-md-color-accent="indigo">
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
<div data-md-component="skip">
<a href="#lessons-on-channel-access-client-programming" class="md-skip">
Skip to content
</a>
</div>
<div data-md-component="announce">
</div>
<header class="md-header md-header--shadow md-header--lifted" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
<a href="../.." title="EPICS Training at PSI" class="md-header__button md-logo" aria-label="EPICS Training at PSI" data-md-component="logo">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="lucide lucide-rocking-chair" viewBox="0 0 24 24"><path d="m3.5 2 3 10.5H18M9.5 12.5l-4 7.5M15 12.5l3.5 7.5M2.75 18a13 13 0 0 0 18.5 0"/></svg>
</a>
<label class="md-header__button md-icon" for="__drawer">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="lucide lucide-menu" viewBox="0 0 24 24"><path d="M4 5h16M4 12h16M4 19h16"/></svg>
</label>
<div class="md-header__title" data-md-component="header-title">
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
EPICS Training at PSI
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
Lessons on Channel Access Client Programming
</span>
</div>
</div>
</div>
<form class="md-header__option" data-md-component="palette">
<input class="md-option" data-md-color-media="none" data-md-color-scheme="default" data-md-color-primary="indigo" data-md-color-accent="indigo" aria-label="Switch to dark mode" type="radio" name="__palette" id="__palette_0">
<label class="md-header__button md-icon" title="Switch to dark mode" for="__palette_1" hidden>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="lucide lucide-sun" viewBox="0 0 24 24"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41"/></svg>
</label>
<input class="md-option" data-md-color-media="none" data-md-color-scheme="slate" data-md-color-primary="indigo" data-md-color-accent="indigo" aria-label="Switch to light mode" type="radio" name="__palette" id="__palette_1">
<label class="md-header__button md-icon" title="Switch to light mode" for="__palette_0" hidden>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="lucide lucide-moon" viewBox="0 0 24 24"><path d="M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"/></svg>
</label>
</form>
<script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent")}for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script>
<label class="md-header__button md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="lucide lucide-search" viewBox="0 0 24 24"><path d="m21 21-4.34-4.34"/><circle cx="11" cy="11" r="8"/></svg>
</label>
<div class="md-search" data-md-component="search" role="dialog" aria-label="Search">
<button type="button" class="md-search__button">
Search
</button>
</div>
<div class="md-header__source">
<a href="https://gitea.psi.ch/epics_training/epics_training_webpages" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4.209 4.603c-.247 0-.525.02-.84.088-.333.07-1.28.283-2.054 1.027C-.403 7.25.035 9.685.089 10.052c.065.446.263 1.687 1.21 2.768 1.749 2.141 5.513 2.092 5.513 2.092s.462 1.103 1.168 2.119c.955 1.263 1.936 2.248 2.89 2.367 2.406 0 7.212-.004 7.212-.004s.458.004 1.08-.394c.535-.324 1.013-.893 1.013-.893s.492-.527 1.18-1.73c.21-.37.385-.729.538-1.068 0 0 2.107-4.471 2.107-8.823-.042-1.318-.367-1.55-.443-1.627-.156-.156-.366-.153-.366-.153s-4.475.252-6.792.306c-.508.011-1.012.023-1.512.027v4.474l-.634-.301c0-1.39-.004-4.17-.004-4.17-1.107.016-3.405-.084-3.405-.084s-5.399-.27-5.987-.324c-.187-.011-.401-.032-.648-.032zm.354 1.832h.111s.271 2.269.6 3.597C5.549 11.147 6.22 13 6.22 13s-.996-.119-1.641-.348c-.99-.324-1.409-.714-1.409-.714s-.73-.511-1.096-1.52C1.444 8.73 2.021 7.7 2.021 7.7s.32-.859 1.47-1.145c.395-.106.863-.12 1.072-.12m8.33 2.554c.26.003.509.127.509.127l.868.422-.529 1.075a.69.69 0 0 0-.614.359.69.69 0 0 0 .072.756l-.939 1.924a.69.69 0 0 0-.66.527.69.69 0 0 0 .347.763.686.686 0 0 0 .867-.206.69.69 0 0 0-.069-.882l.916-1.874a.7.7 0 0 0 .237-.02.66.66 0 0 0 .271-.137 9 9 0 0 1 1.016.512.76.76 0 0 1 .286.282c.073.21-.073.569-.073.569-.087.29-.702 1.55-.702 1.55a.69.69 0 0 0-.676.477.681.681 0 1 0 1.157-.252c.073-.141.141-.282.214-.431.19-.397.515-1.16.515-1.16.035-.066.218-.394.103-.814-.095-.435-.48-.638-.48-.638-.467-.301-1.116-.58-1.116-.58s0-.156-.042-.27a.7.7 0 0 0-.148-.241l.516-1.062 2.89 1.401s.48.218.583.619c.073.282-.019.534-.069.657-.24.587-2.1 4.317-2.1 4.317s-.232.554-.748.588a1.1 1.1 0 0 1-.393-.045l-.202-.08-4.31-2.1s-.417-.218-.49-.596c-.083-.31.104-.691.104-.691l2.073-4.272s.183-.37.466-.497a.9.9 0 0 1 .35-.077"/></svg>
</div>
<div class="md-source__repository">
Gitea
</div>
</a>
</div>
</nav>
<nav class="md-tabs" aria-label="Tabs" data-md-component="tabs">
<div class="md-grid">
<ul class="md-tabs__list">
<li class="md-tabs__item">
<a href="../.." class="md-tabs__link">
Home
</a>
</li>
<li class="md-tabs__item md-tabs__item--active">
<a href="../" class="md-tabs__link">
Tutorials
</a>
</li>
<li class="md-tabs__item">
<a href="../../stepbystep/" class="md-tabs__link">
Recipes and Guides
</a>
</li>
<li class="md-tabs__item">
<a href="../../reference/" class="md-tabs__link">
References
</a>
</li>
<li class="md-tabs__item">
<a href="../../explanation/" class="md-tabs__link">
Explanations
</a>
</li>
</ul>
</div>
</nav>
</header>
<div class="md-container" data-md-component="container">
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary md-nav--lifted" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href="../.." title="EPICS Training at PSI" class="md-nav__button md-logo" aria-label="EPICS Training at PSI" data-md-component="logo">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="lucide lucide-rocking-chair" viewBox="0 0 24 24"><path d="m3.5 2 3 10.5H18M9.5 12.5l-4 7.5M15 12.5l3.5 7.5M2.75 18a13 13 0 0 0 18.5 0"/></svg>
</a>
EPICS Training at PSI
</label>
<div class="md-nav__source">
<a href="https://gitea.psi.ch/epics_training/epics_training_webpages" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4.209 4.603c-.247 0-.525.02-.84.088-.333.07-1.28.283-2.054 1.027C-.403 7.25.035 9.685.089 10.052c.065.446.263 1.687 1.21 2.768 1.749 2.141 5.513 2.092 5.513 2.092s.462 1.103 1.168 2.119c.955 1.263 1.936 2.248 2.89 2.367 2.406 0 7.212-.004 7.212-.004s.458.004 1.08-.394c.535-.324 1.013-.893 1.013-.893s.492-.527 1.18-1.73c.21-.37.385-.729.538-1.068 0 0 2.107-4.471 2.107-8.823-.042-1.318-.367-1.55-.443-1.627-.156-.156-.366-.153-.366-.153s-4.475.252-6.792.306c-.508.011-1.012.023-1.512.027v4.474l-.634-.301c0-1.39-.004-4.17-.004-4.17-1.107.016-3.405-.084-3.405-.084s-5.399-.27-5.987-.324c-.187-.011-.401-.032-.648-.032zm.354 1.832h.111s.271 2.269.6 3.597C5.549 11.147 6.22 13 6.22 13s-.996-.119-1.641-.348c-.99-.324-1.409-.714-1.409-.714s-.73-.511-1.096-1.52C1.444 8.73 2.021 7.7 2.021 7.7s.32-.859 1.47-1.145c.395-.106.863-.12 1.072-.12m8.33 2.554c.26.003.509.127.509.127l.868.422-.529 1.075a.69.69 0 0 0-.614.359.69.69 0 0 0 .072.756l-.939 1.924a.69.69 0 0 0-.66.527.69.69 0 0 0 .347.763.686.686 0 0 0 .867-.206.69.69 0 0 0-.069-.882l.916-1.874a.7.7 0 0 0 .237-.02.66.66 0 0 0 .271-.137 9 9 0 0 1 1.016.512.76.76 0 0 1 .286.282c.073.21-.073.569-.073.569-.087.29-.702 1.55-.702 1.55a.69.69 0 0 0-.676.477.681.681 0 1 0 1.157-.252c.073-.141.141-.282.214-.431.19-.397.515-1.16.515-1.16.035-.066.218-.394.103-.814-.095-.435-.48-.638-.48-.638-.467-.301-1.116-.58-1.116-.58s0-.156-.042-.27a.7.7 0 0 0-.148-.241l.516-1.062 2.89 1.401s.48.218.583.619c.073.282-.019.534-.069.657-.24.587-2.1 4.317-2.1 4.317s-.232.554-.748.588a1.1 1.1 0 0 1-.393-.045l-.202-.08-4.31-2.1s-.417-.218-.49-.596c-.083-.31.104-.691.104-.691l2.073-4.272s.183-.37.466-.497a.9.9 0 0 1 .35-.077"/></svg>
</div>
<div class="md-source__repository">
Gitea
</div>
</a>
</div>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_1" >
<div class="md-nav__link md-nav__container">
<a href="../.." class="md-nav__link ">
<span class="md-ellipsis">
Home
</span>
</a>
<label class="md-nav__link " for="__nav_1" id="__nav_1_label" tabindex="0">
<span class="md-nav__icon md-icon"></span>
</label>
</div>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_1_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_1">
<span class="md-nav__icon md-icon"></span>
Home
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../anouncements/" class="md-nav__link">
<span class="md-ellipsis">
Anouncements
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--active md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2" checked>
<div class="md-nav__link md-nav__container">
<a href="../" class="md-nav__link ">
<span class="md-ellipsis">
Tutorials
</span>
</a>
<label class="md-nav__link " for="__nav_2" id="__nav_2_label" tabindex="">
<span class="md-nav__icon md-icon"></span>
</label>
</div>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_2_label" aria-expanded="true">
<label class="md-nav__title" for="__nav_2">
<span class="md-nav__icon md-icon"></span>
Tutorials
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../cooler_simulation/" class="md-nav__link">
<span class="md-ellipsis">
Cooler Simulation
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--active">
<input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
<label class="md-nav__link md-nav__link--active" for="__toc">
<span class="md-ellipsis">
caClient Lessons
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<a href="./" class="md-nav__link md-nav__link--active">
<span class="md-ellipsis">
caClient Lessons
</span>
</a>
<nav class="md-nav md-nav--secondary" aria-label="On this page">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
On this page
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#contents" class="md-nav__link">
<span class="md-ellipsis">
Contents
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#audience" class="md-nav__link">
<span class="md-ellipsis">
Audience
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#references" class="md-nav__link">
<span class="md-ellipsis">
References
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#lessons" class="md-nav__link">
<span class="md-ellipsis">
Lessons
</span>
</a>
<nav class="md-nav" aria-label="Lessons">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#lesson1" class="md-nav__link">
<span class="md-ellipsis">
caLesson1
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#lesson2" class="md-nav__link">
<span class="md-ellipsis">
caLesson2
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#lesson3" class="md-nav__link">
<span class="md-ellipsis">
caLesson3
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#lesson4" class="md-nav__link">
<span class="md-ellipsis">
caLesson4
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#lesson5" class="md-nav__link">
<span class="md-ellipsis">
caLesson5
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#lesson6" class="md-nav__link">
<span class="md-ellipsis">
caLesson6
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3" >
<div class="md-nav__link md-nav__container">
<a href="../../stepbystep/" class="md-nav__link ">
<span class="md-ellipsis">
Recipes and Guides
</span>
</a>
</div>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3">
<span class="md-nav__icon md-icon"></span>
Recipes and Guides
</label>
<ul class="md-nav__list" data-md-scrollfix>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_4" >
<div class="md-nav__link md-nav__container">
<a href="../../reference/" class="md-nav__link ">
<span class="md-ellipsis">
References
</span>
</a>
<label class="md-nav__link " for="__nav_4" id="__nav_4_label" tabindex="0">
<span class="md-nav__icon md-icon"></span>
</label>
</div>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_4_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_4">
<span class="md-nav__icon md-icon"></span>
References
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="https://docs.epics-controls.org/projects/base/en/latest/ComponentReference.html" class="md-nav__link">
<span class="md-ellipsis">
Record Reference
</span>
</a>
</li>
<li class="md-nav__item">
<a href="https://caqtdm.github.io/documentation.html" class="md-nav__link">
<span class="md-ellipsis">
caQtDM
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5" >
<div class="md-nav__link md-nav__container">
<a href="../../explanation/" class="md-nav__link ">
<span class="md-ellipsis">
Explanations
</span>
</a>
<label class="md-nav__link " for="__nav_5" id="__nav_5_label" tabindex="0">
<span class="md-nav__icon md-icon"></span>
</label>
</div>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_5">
<span class="md-nav__icon md-icon"></span>
Explanations
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../explanation/EPICS-IOC/" class="md-nav__link">
<span class="md-ellipsis">
EPICS IOC
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../explanation/EPICS-Hosts/" class="md-nav__link">
<span class="md-ellipsis">
EPICS Host at PSI
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary" aria-label="On this page">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
On this page
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#contents" class="md-nav__link">
<span class="md-ellipsis">
Contents
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#audience" class="md-nav__link">
<span class="md-ellipsis">
Audience
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#references" class="md-nav__link">
<span class="md-ellipsis">
References
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#lessons" class="md-nav__link">
<span class="md-ellipsis">
Lessons
</span>
</a>
<nav class="md-nav" aria-label="Lessons">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#lesson1" class="md-nav__link">
<span class="md-ellipsis">
caLesson1
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#lesson2" class="md-nav__link">
<span class="md-ellipsis">
caLesson2
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#lesson3" class="md-nav__link">
<span class="md-ellipsis">
caLesson3
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#lesson4" class="md-nav__link">
<span class="md-ellipsis">
caLesson4
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#lesson5" class="md-nav__link">
<span class="md-ellipsis">
caLesson5
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#lesson6" class="md-nav__link">
<span class="md-ellipsis">
caLesson6
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content" data-md-component="content">
<article class="md-content__inner md-typeset">
<a href="https://gitea.psi.ch/epics_training/epics_training_webpages/_edit/master/docs/tutorials/caClientLessons.md" title="Edit this page" class="md-content__button md-icon" rel="edit">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="lucide lucide-file-pen" viewBox="0 0 24 24"><path d="M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5"/><path d="M14 2v4a2 2 0 0 0 2 2h4M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z"/></svg>
</a>
<h1 id="lessons-on-channel-access-client-programming">Lessons on Channel Access Client Programming<a class="headerlink" href="#lessons-on-channel-access-client-programming" title="Permanent link">&para;</a></h1>
<p><font color="red"> - <strong>OLD and maybe Obsolete</strong> - </font></p>
<p>Written by Dirk Zimoch <a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#100;&#105;&#114;&#107;&#46;&#122;&#105;&#109;&#111;&#99;&#104;&#64;&#112;&#115;&#105;&#46;&#99;&#104;">&#100;&#105;&#114;&#107;&#46;&#122;&#105;&#109;&#111;&#99;&#104;&#64;&#112;&#115;&#105;&#46;&#99;&#104;</a></p>
<p>This lessons should qualify a C-programmer to make efficient use
of the Channel Access client libraries and to write his/her own
EPICS client applications in C.
Special attention is directed to network traffic and possible pitfalls.</p>
<p>This tutorial is not yet complete.
Whenever I have some time, I will add more lessons.</p>
<h2 id="contents">Contents<a class="headerlink" href="#contents" title="Permanent link">&para;</a></h2>
<ul>
<li><a href="#audience">Audience</a></li>
<li><a href="#references">References</a></li>
<li><a href="#lessons">Lessons</a><ul>
<li><a href="#lesson1">caLesson 1</a> - simple read access</li>
<li><a href="#lesson2">caLesson 2</a> - getting more infos from EPICS</li>
<li><a href="#lesson3">caLesson 3</a> - channel access data types</li>
<li><a href="#lesson4">caLesson 4</a> - monitors and version differences</li>
<li><a href="#lesson5">caLesson 5</a> - write and wait</li>
</ul>
</li>
</ul>
<h2 id="audience">Audience<a class="headerlink" href="#audience" title="Permanent link">&para;</a></h2>
<p>The lessons are directed to all users of EPICS who want to write
their own Channel Access client applications in C.
They are recommend for all programmers who are new to Channel Access,
not only to members of the PSI controls section.</p>
<p>You should be experienced with C.
I will not try to explain how the C compiler, preprocessor, or linker
works and what Makefiles are.
If this is new to you, I recommend to get some programming practice first.
For some lesson, experience with multi-threading is recommended.</p>
<p>If you don't have experience with EPICS yet, you should participate in
some EPICS trainig, here at PSI
or at some other EPICS site.
I expect that you know what the terms <em>IOC</em>, <em>record</em> and
<em>processing</em> mean in the EPICS world.</p>
<p><font color="red">Obsolete!</font>
Experience with <em>medm</em> or other existing Channel Access clients is
also helpful.</p>
<h2 id="references">References<a class="headerlink" href="#references" title="Permanent link">&para;</a></h2>
<p>See the EPICS home page <a href="https://epics-controls.org/">https://epics-controls.org/</a> for
everything about EPICS. And the documentation page <a href="https://docs.epics-controls.org/en/latest/">https://docs.epics-controls.org/en/latest/</a>
for references.
Especially read the
<a href="http://www.aps.anl.gov/epics/EpicsDocumentation/EpicsGeneral/epics_overview.html#channelaccess">chaper about Channel Access</a>.</p>
<p><font color="red">Obsolete!</font>
Today, two major releases of Channel Access are in use: R3.12 (which is still used
in EPICS release R3.13) and R3.14.
On the EPICS home page you can find the (very thin)
<a href="http://www.aps.anl.gov/epics/EpicsDocumentation/AppDevManuals/ChannelAccess/cadoc_1.htm"><em>EPICS R3.12 Channel Access Reference Manual</em></a>
and the much more detailled
<a href="http://www.aps.anl.gov/epics/base/R3-14/8-docs/CAref.html"><em>EPICS R3.14 Channel Access Reference Manual</em></a>.</p>
<p>APS provides many lectures in their
<a href="http://www.aps.anl.gov/epics/docs/GSWE.php"><em>Getting Started with Epics</em> series</a>.
You should definitely read the
<em>Introduction to Channel Access Clients</em> provided there.</p>
<p><font color="red">Obsolete?</font>
Much valueable information can be found in header files.
If you work at a standard SLS Linux PC, have a look at:</p>
<blockquote>
<p>/usr/local/epics/base/include/cadef.h</p>
</blockquote>
<p>Otherwise find this file in your local EPICS installation.</p>
<h2 id="lessons">Lessons<a class="headerlink" href="#lessons" title="Permanent link">&para;</a></h2>
<p>The lessons are provided in the gitea repository <a href="https://gitea.psi.ch/epics_training/caClientLessons">https://gitea.psi.ch/epics_training/caClientLessons</a>. </p>
<p>Check it out anywhere in
your home directory. Each lesson is in its own directory.
The lesson itself is contained in the comments in the C files.
Read them carefully.
Some lessons contain README files. Read them first.</p>
<p>The provided Makefiles are tailored to the SLS installation of EPICS.
It should not be too difficult to modify them for other installations.
You may use them as a starting point for your own Channel Access clients.</p>
<p><font color="red">Obsolete!</font>
The environment variable <code>EPICS_HOST_ARCH</code> must be defined.
I have tested all programs on Scientific Linux 3, where we have
<code>EPICS_HOST_ARCH=SL3-x86</code> at the SLS.
Other installation will most probably use different values.</p>
<p>The used record names exist at the SLS. If you are in the machine network
or in a beamline network, you will see real life data. From the SLS
office, you will either see simulations or you can
connect to the machine network with the <code>cam</code> command.
In some lessons, we will write to records.
Depending on the relative location of you and the record, you may
be allowed to write to real components of the machine!
<strong>This is not a game!</strong></p>
<p>If you are not at SLS, you should change the record names so something
which exists at your site. Probably use a so called <em>softioc</em>
to provide some records to play with.</p>
<h3 id="lesson1">caLesson1<a class="headerlink" href="#lesson1" title="Permanent link">&para;</a></h3>
<p>This lesson shows how to write a very simple CA client program.
It connects to some channels, reads them, prints them and exits.</p>
<h3 id="lesson2">caLesson2<a class="headerlink" href="#lesson2" title="Permanent link">&para;</a></h3>
<p>Here you will learn how to read more than a bare number from a channel.
This is very useful to format a value correctly or to know the physical
units of a value.
In fact, it is this additional information that makes the difference
between a value and a bare number.</p>
<p>You will also see one way to get your data a bit more structured.
There are many ways to achive the same result, of course.
You should know how macros work in C to understand this lesson.</p>
<h3 id="lesson3">caLesson3<a class="headerlink" href="#lesson3" title="Permanent link">&para;</a></h3>
<p>In this lesson, you will learn about different data types in Channel Access.
You will also see the difference between "static" and "dynamic" data of a
channel and how use this to reduce network traffic when reading data
repeatedly.</p>
<h3 id="lesson4">caLesson4<a class="headerlink" href="#lesson4" title="Permanent link">&para;</a></h3>
<p>This lesson introduces "monitors".
When you install a monitor, a user-defined callback function is called
by the Channel Access library whenever a channel has new values available.
This is much more "network friendly" than high rate polling.</p>
<p><font color="red">Obsolete?</font>
You will also see the differences beween the Channel Access APIs of EPICS
R3.13 and R3.14.
In R3.14, you can still use the R3.13 API and Channel Access clients written
for EPICS R3.13 should work without modifications with EPICS R3.14.
Anyway, to be able to understand other people's code, you should know
both flavours and only R3.14 is designed for multi-threading.</p>
<h3 id="lesson5">caLesson5<a class="headerlink" href="#lesson5" title="Permanent link">&para;</a></h3>
<p>In this lesson we will write to a device for the first time.
We will use a "put-wait" method, that does not return before the device has
understood and executed the written value.
This method is best suited for GUI-less programs which can block.
(In later lessons, we will learn a different way to write values.)</p>
<p>After the value is written, we will wait unil the device has finished
using a monitor on a done flag.
This is much more efficient than polling a done flag in a loop.</p>
<h3 id="lesson6">caLesson6<a class="headerlink" href="#lesson6" title="Permanent link">&para;</a></h3>
<p>An unfinished work in progress.</p>
</article>
</div>
<script>var tabs=__md_get("__tabs");if(Array.isArray(tabs))e:for(var set of document.querySelectorAll(".tabbed-set")){var labels=set.querySelector(".tabbed-labels");for(var tab of tabs)for(var label of labels.getElementsByTagName("label"))if(label.innerText.trim()===tab){var input=document.getElementById(label.htmlFor);input.checked=!0;continue e}}</script>
<script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
</div>
<button type="button" class="md-top md-icon" data-md-component="top" hidden>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="lucide lucide-circle-arrow-up" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><path d="m16 12-4-4-4 4M12 16V8"/></svg>
Back to top
</button>
</main>
<footer class="md-footer">
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-copyright">
<div class="md-copyright__highlight">
Copyright &copy; 2026 Paul Scherrer Institute
</div>
Made with
<a href="https://zensical.org/" target="_blank" rel="noopener">
Zensical
</a>
</div>
</div>
</div>
</footer>
</div>
<div class="md-dialog" data-md-component="dialog">
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"annotate":null,"base":"../..","features":["announce.dismiss","content.action.edit","content.code.annotate","content.code.copy","content.code.select","content.footnote.tooltips","content.tabs.link","navigation.tabs","navigation.tabs.sticky","content.tooltips","navigation.indexes","navigation.instant","navigation.instant.prefetch","navigation.path","search.highlight","navigation.top","navigation.tracking"],"search":"../../assets/javascripts/workers/search.5df7522c.min.js","tags":null,"translations":{"clipboard.copied":"Copied to clipboard","clipboard.copy":"Copy to clipboard","search.result.more.one":"1 more on this page","search.result.more.other":"# more on this page","search.result.none":"No matching documents","search.result.one":"1 matching document","search.result.other":"# matching documents","search.result.placeholder":"Type to start searching","search.result.term.missing":"Missing","select.version":"Select version"},"version":null}</script>
<script src="../../assets/javascripts/bundle.21aa498e.min.js"></script>
</body>
</html>