Commit 2185a17a authored by Claes Sjofors's avatar Claes Sjofors

Doc changes, rt_net added to PRM and other

parent 3469f060
......@@ -2170,6 +2170,34 @@ Supervision takes place in the same way as for DSup objects with the exception t
choose whether the alarm will be released when the value is above or below the supervision
limit.
<h1>Execute order
The execute order is determined by the how the function objects are coupled together. An object
which output is connected to the input of another object, is executed before the object it
is connected to. You can see the execute order by activating 'View/Show Execute Order' in the
plc editor menu. For objects and nets that are not coupled together, the execute order is
determined by the position. Object higher up is execute first.
If you want to influence the execute order between two objects, you can draw a special execute
order connection beween the objects. This is choosen in the connection palette and has an
arrow in one end. The object that the connection is pointing at will be executed after the
object that the connection emanates from.
If a net contains a feedback connection, the execute order can't be determined and the error
'Amigous execute order' is messaged. You then have to exchange one connection to a feedback
connection, ie a connection that doesn't determine the execute order. The feedback connection is
dashed and is selected in the tool panel or in the connection palette.
<h1>I/O copying
If a signal is used in several places in a net of function objects, there is a chance that
the signal value will be changed during the execution which can result in lockings and other
fenomena that is hard to predict. Therefor a mechanism called I/O copying is used. The
signal values for signals of type Ai, Ao, Av, Di, Do, Dv, Ii, Io, Iv, Co, Bo and Bi are
gathered in special area objects. Before a plc thread starts to execute, a copy of the area
objects are made, and during the execution all the readings are made from the copy, while
writings are made into the original area objects. This ensures that this kind of fenomena is
avoided, but also that you can get delays. If a signal value is set, and then read in the same
plc thread, the modification will not be registred until the next scan.
<h1>Compile the plcpgm
Before starting to compile, you have to state on which platform (or platforms) the volume of
the plc should run. Open the volume attributes editor from the navigator menu:
......
......@@ -2152,6 +2152,35 @@ Supervisory), som finns under mappen 'Analog' i paletten.
Övervakningen sker på liknande sätt som för en DSup, med undantaget att man kan välja om
larmet ska utlösas om gränsvärdet underskrids eller överskrids.
<h1>Exekveringsordning
Exekveringsordningen bestäms normalt efter hur funktionsobjekten är sammankopplade. Ett
objekt vars utgång är kopplad till en ingång på ett annat objekt, exekverar före det objekt
det är kopplat till. Man kan se exekveringordningen genom att aktivera 'View/Show
Execute Order' i plc-editorns meny. För objekt och nät som inte är sammankopplade exekveras
bestämmer koordinaterna exekveringsordningen. Objekt som ligger högre upp exekveras först.
Om man vill påverka exekveringsordningen mellan två objekt kan man koppla en speciell
exekveringsordnings koppling mellan objekten. Denna väljs i kopplings-paletten och har en
pil i ena ändan. Den fungerar så att objektet som kopplingen pekar på exekverar efter objektet
som kopplingen utgår från.
Om ett nät innehåller en återkoppling, kan exekeveringordningen inte bestämmas och man får
felet 'Ambigous execute order'. Man måste då byta ut en koppling mot en feedback koppling, dvs
en koppling som inte bestämmer exekveringsordningen, så att exekveringsordningen blir
entydigt bestämd. Feedback-kopplingen är sträckad och väljs i verktygs-panelen eller i
kopplings-paletten.
<h1>I/O kopiering
Om en signal används på flera ställen i ett nät av funktions-objekt, och det finns risk att
signalens värde ändras under exekveringen kan man få låsningar och andra fenomen som är
svåra att förutse. Därför används en mekanism som kallas I/O kopiering. Signalvärdena för
signaler av typen Ai, Ao, Av, Di, Do, Dv, Ii, Io, Iv, Co, Bo och Bi, är samlade i speciella
area-objekt. Innan en plc-tråd börjar exekvera tar man en kopia av areaobjekten, och under
exekveringen görs alla läsningar från kopian, medan skrivningar görs i area-objekten.
Det innebär dels att man undviker den här typen av fenomen, men också att man kan få
fördröjningar. Om man sätter värdet på en signal, och sedan läser det i samma plc-tråd, kommer
förändringen inte att registreras förrän i nästa skan.
<h1>Kompilera plcprogrammet
Innan man börjar kompilera, måste man ange vilken platform (eller vilka plattformar) som
plcprogrammets volym ska exekvera på. Öppna volymsattribut-editorn från konfiguratören,
......
......@@ -26,6 +26,7 @@ This manual will give a description of the following API's
- Sevcli Storage environment client interface.
- NMps Interface to NMps Cell objects.
- AProc Application process interface.
- Net Network conversion functions.
- rt_appl A base class for applications i c++.
*/
......@@ -340,6 +341,11 @@ This manual will give a description of the following API's
This module contains functions to handle application processes.
*/
/*! \defgroup Net Net Network conversion functions
\ingroup PRM
This module contains functions for network conversion.
*/
/*! \defgroup rt rt_appl Base class for applications
\ingroup PRM
rt_appl is a base class for c++ applications.
......
......@@ -571,6 +571,7 @@ INPUT = $(pwre_sroot)/doc/prm/src/doxygen.dx \
$(pwre_croot)/nmps/lib/nmps/src/nmps_appl.h \
$(pwre_sroot)/lib/rt/src/rt_aproc.h \
$(pwre_sroot)/lib/rt/src/rt_aproc.c \
$(pwre_sroot)/lib/rt/src/rt_net.c \
$(pwre_sroot)/lib/rt/src/rt_appl.h \
$(pwre_sroot)/lib/rt/src/rt_appl.cpp \
$(pwre_sroot)/lib/co/src/co_time.c \
......
......@@ -75,6 +75,9 @@
#include "rt_net_msg.h"
#include "rt_net.h"
/** @addtogroup Net */
/*@{*/
/* The following variables are the interface between the net_*
routines and the NetThread. The requestor must first
aquire ownership of the l_mutex mutex, then fill in the
......@@ -767,6 +770,10 @@ net_Connect (
}
/**
* @brief Convert a net time to a time.
* @return pwr_tTime
*/
pwr_tTime net_NetTimeToTime( const net_sTime *nt)
{
pwr_tTime t;
......@@ -776,6 +783,10 @@ pwr_tTime net_NetTimeToTime( const net_sTime *nt)
return t;
}
/**
* @brief Convert a time to a net time.
* @return net_sTime
*/
net_sTime net_TimeToNetTime( const pwr_tTime *t)
{
net_sTime nt;
......@@ -786,7 +797,11 @@ net_sTime net_TimeToNetTime( const pwr_tTime *t)
}
/* Note! Only for positive deltatimes */
/**
* @brief Convert a net time to a delta time.
* Note! Only for positive deltatimes.
* @return pwr_tDeltaTime
*/
pwr_tDeltaTime net_NetTimeToDeltaTime( const net_sTime *nt)
{
pwr_tDeltaTime t;
......@@ -796,7 +811,10 @@ pwr_tDeltaTime net_NetTimeToDeltaTime( const net_sTime *nt)
return t;
}
/* Note! Only for positive deltatimes */
/**
* @brief Convert a delta time to a net time.
* @return pwr_tDeltaTime
*/
net_sTime net_DeltaTimeToNetTime( const pwr_tDeltaTime *t)
{
net_sTime nt;
......@@ -806,6 +824,10 @@ net_sTime net_DeltaTimeToNetTime( const pwr_tDeltaTime *t)
return nt;
}
/**
* @brief Get the current time as a net time.
* @return int
*/
int net_GetTime( net_sTime *nt)
{
int sts;
......@@ -849,3 +871,5 @@ int net_StringToAddr( char *str, struct in_addr *naddr)
}
return 1;
}
/** @} */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment