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
462c8a54
Commit
462c8a54
authored
11 years ago
by
benjamin.franksen
Browse files
Options
Downloads
Patches
Plain Diff
docs: minor cleanups in reference
parent
c9b820ef
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
+28
-27
28 additions, 27 deletions
documentation/Reference.txt
with
28 additions
and
27 deletions
documentation/Reference.txt
+
28
−
27
View file @
462c8a54
...
...
@@ -22,7 +22,7 @@ Comments
comment: "/*" <anything> "*/"
C-style comments may be placed anywhere in the program. They are
treated as white space
by *snc*
. As in C, comments cannot be nested.
treated as white space. As in C, comments cannot be nested.
Identifiers
^^^^^^^^^^^
...
...
@@ -78,7 +78,7 @@ Line Markers
line_number: <non-empty sequence of decimals>
file_name: <like string_literal, without automatic string concatenation>
Line markers are interpreted
by *snc*
exactly as in C, i.e. they indicate
Line markers are interpreted exactly as in C, i.e. they indicate
that the following symbols are really located in the given source file (if
any) at the given line.
...
...
@@ -322,7 +322,7 @@ See :ref:`EventFlags`.
Foreign Entities
~~~~~~~~~~~~~~~~
The pseudo type
"
foreign
"
is used to declare any number of C variables
The pseudo type
``
foreign
``
is used to declare any number of C variables
or struct tags or *cpp* macros that have been defined outside the SNL
program. No warning will be issued if such a variable, struct tag, or
macro is used in the program even if warnings are enabled.
...
...
@@ -2042,8 +2042,8 @@ Escape to C Code
Because the SNL does not support the full C language, C code may be
escaped in the program. The escaped code is not compiled by *snc*,
but is passed
literally to the
C compiler
. There are two
escape
methods
allowed
:
instead it is
literally
copied
to the
generated C code
. There are two
escape
methods:
#. Any code between ``%%`` and the next newline character is escaped.
Example::
...
...
@@ -2134,27 +2134,28 @@ SNL program is if your function accesses global SNL variables.
Calling pvGet etc. from C
^^^^^^^^^^^^^^^^^^^^^^^^^
The built-in SNL functions such as :c:func:`pvGet` cannot be directly used
in user-supplied functions. However, most of the built-in functions
have a C language equivalent with the same name, except that the prefix ``seq_``
is added (e.g. ``pvGet`` becomes ``seq_pvGet``). These C functions expect an
additional first argument identifying the calling state set, which is
available in action code under the name ``ssId``. If a process
variable name is required, the index of that variable must
be supplied. This index is obtained via the :c:func:`pvIndex` function
(which must be called from SNL code, not C code, to work).
If the program is compiled with the :option:`+r` option, user functions
cannot directly access SNL variables, not even global ones. Instead,
variables (or their address) should be passed to user functions as
arguments. Alternatively, you can pass the ``pVar`` variable of type
``USER_VAR*`` and access SNL variables as structure members of ``pVar``.
See next section for details and an example.
The prototypes for the C functions corresponding to the built-in SNL functions
as well as additional supporting macros and type definitions can be found
in the header file ``seqCom.h``. This header file is always included by
the generated C code.
The built-in SNL functions such as :c:func:`pvGet` cannot be directly
used in user-supplied functions. However, most of the built-in
functions have a C language equivalent with the same name, except
that the prefix ``seq_`` is added (e.g. ``pvGet`` becomes
``seq_pvGet``). These C functions expect an additional first argument
identifying the calling state set, which is available in action code
under the name ``ssId``. If a process variable name is required, the
index of that variable must be supplied. This index is obtained via
the :c:func:`pvIndex` function (which must be called from SNL code,
not C code, to work).
If the program is compiled with the :option:`+r` option, user
functions cannot directly access SNL variables, not even global ones.
Instead, variables (or their address) should be passed to user
functions as arguments. Alternatively, you can pass the ``pVar``
variable of type ``USER_VAR*`` and access SNL variables as structure
members of ``pVar``. See next section for details and an example.
The prototypes for the C functions corresponding to the built-in SNL
functions as well as additional supporting macros and type
definitions can be found in the header file ``seqCom.h``. This header
file is always included by the generated C code.
.. _reentrant option:
...
...
@@ -2188,7 +2189,7 @@ Reference to variable ``sw1`` is made as ::
pVar->sw1
This conversion is automatically performed by
the
*snc* for all SNL
This conversion is automatically performed by *snc* for all SNL
statements, but you will have to handle escaped C code yourself.
.. note::
...
...
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