Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sequencer-2-2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
epics-modules
sequencer-2-2
Commits
46896090
Commit
46896090
authored
12 years ago
by
benjamin.franksen
Browse files
Options
Downloads
Patches
Plain Diff
docs: improved documentation of pvAssign
parent
4e0ce795
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
documentation/Reference.txt
+25
-11
25 additions, 11 deletions
documentation/Reference.txt
with
25 additions
and
11 deletions
documentation/Reference.txt
+
25
−
11
View file @
46896090
...
@@ -1327,39 +1327,53 @@ pvAssign
...
@@ -1327,39 +1327,53 @@ pvAssign
.. c:function::
.. c:function::
pvStat pvAssign(assigned_var, process_variable_name)
pvStat pvAssign(assigned_var, process_variable_name)
Assigns or re-assigns the SNL variable ``var`` to
Assigns or re-assigns the SNL variable ``var`` to
``process_variable_name``.
``process_variable_name``.
If ``process_variable_name`` is an empty
If ``process_variable_name`` is an empty
string then ``assigned_var`` is
string then ``assigned_var`` is
de-assigned (not associated with any process
de-assigned (not associated with any process
variable). In :ref:`safe mode`,
variable). In :ref:`safe mode`,
it causes assignment to an anonymous PV.
it causes assignment to an anonymous PV.
As usual, ``assigned_var`` can also be an array element.
As usual, ``assigned_var`` can also be an array element.
Note that pvAsssign is *asynchronous*: it sends a request to search for and
connect to the given ``process_variable_name``, but it does not wait for a
response, similar to ``pvGet(var,ASYNC)``. Calling pvAssign *does* have one
immediate effect, namely de-assigning the variable from any PV it currently
is assigned to. In order to make sure that it has connected to the new PV,
you can use the :c:func:`pvConnected` built-in function inside a :token:`when`
clause.
.. todo::
Add an optional argument, so users can make pvAssign wait for the
connection to be established (or some timeout).
See also :token:`assign` clause.
See also :token:`assign` clause.
A better name for this function would be ``pvReassign``.
A better name for this function would be ``pvReassign``.
.. note::
.. note::
:c:func:
`pvAssign` can only be called on variables (or array elements)
`
`pvAssign`
`
can only be called on variables (or array elements)
that have been statically marked as process variables using the
that have been statically marked as process variables using the
:token:`assign` syntax. An empty string may be used for the initial
:token:`assign` syntax. An empty string may be used for the initial
assignment, or (from version 2.1. onward) the simplified form
assignment, or (from version 2.1. onward) the simplified form
``assign var``.
``assign var``.
.. note:: If a variable gets de-assigned from a non-empty to an empty
.. warning::
If a variable gets de-assigned from a non-empty to an empty
name, the corresponding channel is destroyed, which means that
name, the corresponding channel is destroyed, which means that
dynamically allocated memory gets freed. If your
dynamically allocated memory gets freed. If your
system cannot handle dynamic memory allocation without fragmentation,
system cannot handle dynamic memory allocation without fragmentation,
care should be taken that assignment and de-assignment do not
care should be taken that assignment and de-assignment do not
alternate too often.
alternate too often.
..note:: If you want to assign array elements to separate PVs, you cannot
.. note::
If you want to assign array elements to separate PVs, you cannot
currently do this with a single call (in contrast to doing it in an
currently do this with a single call (in contrast to doing it in an
:token:`assign` clause. Instead, you must call
:c:func:
`pvAssign`
:token:`assign` clause. Instead, you must call
`
`pvAssign`
`
for each array element individually.
for each array element individually.
This might change in a future release.
..todo:: Implement multiple assign for arrays.
pvMonitor
pvMonitor
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment