Porovnávané verzie

Kľúč

  • Tento riadok sa pridal
  • Riadok je odstránený.
  • Formátovanie sa zmenilo.

...

Protokol B&R PVI Interface slúži na komunikáciu s PLC B&R pomocou rozhrania PVI od firmy Bernecker & Rainer. Podporené sú Podporená je nasledovná fukncionalita:

...

  • čítanie aj zápis

...

  • meraných bodov,
  • čítanie a zápis jednoduchých typov (i8, i16, i32, i64, u8, u16, u32, u64, boolean, string, wstring, time, dt, date, tod)

...

  • ,
  • práca s položkami (ktoré sú jednoduchých typov) štruktúrovaných premenných

...

  • ,
  • čítanie polí do štruktúrovaných meraných body s nakonfigurovaným cieľovým stĺpcom štruktúry.

Zatiaľ nie je podporená práca s dátovým typom "data".

Komunikácia bola testovaná voči virtuálnemu aj fyzickému B&R PLC s PVI verziami:

  • Automation Net PVI V4.0
  • Automation Net PVI V4.2
  • Automation Net PVI V4.3
  • Automation Net PVI V4.7

Hierarchia objektov PVI

...

ccccCleanup commandCleanup timeout10
NázovPopisJednotkaNáhradná hodnota
--- PVI Parameters ---

Kotva
ct
ct
Communication timeout

Parameter pre funkciu PviXInitialize (inicializácia PVI rozhrania).
Časový limit komunikácie pre komunikáciu klient/server (aplikácia / PVI Manager) v sekundách. Hodnota zadaná v tomto parametre slúži ako predvolené nastavenie inicializačného parametra COMT. Ak nie je požadované žiadne prednastavenie, mala by sa zadať predvolená hodnota 0.
sec0

Kotva
rt
rt
Retry time

Parameter pre funkciu PviXInitialize (inicializácia PVI rozhrania).
Čas opakovania pre užívateľské správy PVICOM v sekundách. Hodnota zadaná v tomto argumente funkcie slúži ako predvolené nastavenie inicializačného parametra RETR. Ak nie je požadované žiadne prednastavenie, mala by sa zadať predvolená hodnota 0.
sec0

Kotva
seqt
seqt
Initialization parameter string

Parameter pre funkciu PviXInitialize (inicializácia PVI rozhrania).
Reťazec s inicializačnými parametrami. Podľa dokumentácie PVI sú podporené tieto parametre:

ParameterDescription
COMTCommunication timeout for the client/server (application/PVI Manager) communication in seconds
The timeout also defines the time for the life sign monitor. An additional period is needed to detect a disruption in the client/server connection. To determine the total time where a communication disruption would be detected (at the latest), the timeout value specified here has to be doubled. If the timeout is 5, then an interruption in the connection can be detected as early as 5 seconds and as late as 10 seconds. Connection interrupts are not recognized as such by the PVICOM interface if they occur within the timeout period. Data transfer simply continues once the connection is reestablished. Often used values are 3 - 10 seconds for local communication and 5 - 30 seconds for remote communication.
Value: 1 - 3600, = 0 ... Default value of 30 s used.
The value specified in the function argument "Timeout" serves as a presetting for this parameter.
RETRRetry time for PVICOM user messages is seconds.
The default setting ("RetryTime=0") should normally be used for this parameter. See the User Message Operations section for more information about this parameter.
Value: 1 - 3600, <= 0 ... no repetition.
The value specified in the function argument "RetryTime" serves as a presetting for this parameter.
LMLimit on user messages. Default: "LM=1".
PVICOM applications basically do not need to change the default setting of this parameter. However, if an application is able to respond quickly to PVICOM user messages, then a higher limit value ("LM=100", "LM=500") can speed up user message execution. See the User Message Operations section for more information about this parameter.
Value: 1 - 65535, <= 0 -> No limiting.
PTProcess timeout in seconds. Default: "PT=0".
This timeout can be used to monitor the time between requests and responses. This parameter is only intended for PVICOM applications that carry out particular tasks. Standard applications do not need to be monitored and should use the default setting (no timeout monitoring).
Value: 1 - 3600, <=0 -> No timeout monitoring
IPTCP/IP address or hostname.
If the IP initialization parameter is specified, then the Remote communication type is used for PVICOM communication. Either the TCP/IP address (e.g. "IP=10.43.50.62") or the hostname ("IP=SystemPC1") of the server (PVI Manager) is specified with this parameter. If the hostname is given, then the IP address assigned to the name is determined by the system
PNTCP/IP port number. Default: "PN=20000".
This parameter is only required in conjunction with the IP parameter. The port number assigned to the PVI Manager needs to be specified here (PVI Manager Properties).
Value: 1024 - 32767.
AS

Auto-Start (only for the local communication type).
1 ... PVI Manager is started (default).
0 ... PVI Manager is not started automatically and must be started already when the function is called.
More information about the startup procedure can be found in the PVI Manager section.


--

Kotva
l
l
Line object definition

Parameter ObjectDescriptor pre funkciu PviXCreate pri vytváraní objektu Line.
Parameter udáva popis linky. Prednastavená hodnota CD=LnIna2 vytvorí linku INA2000, ktorá sa používa na komunikáciu s riadiacimi jednotkami B&R SG3, SGC a SG4 prostredníctvom protokolu INA2000 (Industrial Network Architecture).

-CD=LnIna2

Kotva
d
d
Device object definition

Parameter ObjectDescriptor pre funkciu PviXCreate pri vytváraní objektu Device.
Parameter udáva popis zariadenia. Prednastavená hodnota CD="/IF=tcpip /SA=1" vytvorí spojenie s použitím TCP/IP (UDP), zdrojová adresa (adresa D2000 KOM-u) bude 1. Dokumentácia PVI popisuje parametre pre jednotlivé typy zaríadení (Serial, Ethernet UDP, Modem, CAN device, Profibus FDL device).
sec30
--- Other Parameters ---

Kotva
bt
bt
Browse tasks

Parameter ovplyvňuje rozsah browsovania využívaného pri konfigurácii meraných bodov.
Ak je parameter nastavený na hodnotu YES, tak pri browsovaní meraných bodov budú prehľadávané globálne premenné, všetky objekty typu Task definované v rámci CPU, ako aj všetky lokálne premenné definované vo všetkých taskoch. Ak je parameter nastavený na hodnotu NO, sú prehľadávané globálne premenné a lokálne premenné tasku definovaného parametrom protokolu Task object definition.
Poznámka: táto funkcionalita je vypnutá z dvoch dôvodov. Po prvé, pre zatiaľ nezistené dôvody spôsobí použitie tejto funkcionality pád D2000 KOM procesu po niekoľkonásobnom opakovaní browsovania (refresh). Po druhé, na stanici má zmysel nakonfigurovať iba globálne , pretože na stanici má zmysel nakonfigurovať iba globálne premenné a lokálne premenné tasku definovaného parametrom protokolu Task object definition. Lokálne premenné iných taskov nebudú funkčné.

YES/NONO

Kotva

it

it
Inactivity timeout

Ak je hodnota parametra nenulová, tak v rámci periodického čítania hodnôt v rámci stanice sa kontroluje, či za posledných "Inactivity timeout" sekúnd bola prijatá nejaká hodnota ľubovolnou stanicu na linke. Ak nie, bude spojenie s PVI Managerom rozpojené a znovu nadviazané.
Pozn: parameter sa dá použiť na zrýchlenie detekcie komunikačných problémov. Pokiaľ chodia hodnoty meraných bodov zriedkavo, odporúčame vytvoriť výstupný meraný bod, do ktorého bude každých niekoľko sekúnd zapisovaná hodnota.
sec0

Kotva
cc
cc
Cleanup command

Parameter umožňuje spustenie dávkového súboru pri (re)štarte komunikácie. Tento dávkový súbor môže napr. reštartovať proces PVI Parameter umožňuje spustenie dávkového súboru pri (re)štarte komunikácie. Tento dávkový súbor môže napr. reštartovať proces PVI Manager (PviMan.exe) - napr. pomocou utility pskill.exe alebo pomocou Windows utility "sc", ak je PVI Manager spustený ako servisPVI Manager spustený ako servis. Reštartovanie pomáha, ak sa napríklad PVI Manager dostane do stavu "Locked".
V názve dávkového súboru môže byť použitá symbolická konštanta #APPDIR#, ktorá udáva aplikačný adresár, napr. #APPDIR#cleanup.bat
--
Kotva
ctoctoČas v sekundách, do ktorého musí dávkový súbor zadaný parametrom Cleanup command skončiť. Po uplynutí tohto timeoutu bude dávkový súbor ukončený.sec, napr. #APPDIR#cleanup.bat--

Kotva
cto
cto
Cleanup timeout

Čas v sekundách, do ktorého musí dávkový súbor zadaný parametrom Cleanup command skončiť. Po uplynutí tohto timeoutu bude dávkový súbor ukončený.sec10

Kotva
pcd
pcd
Post create delay

Oneskorenie po vytvorení každého objektu. Tento parameter slúži na spomalenie nábehu komunikácie kvôli ladeniu a diagnostike.sec0,0

Kotva
awc
awc
Asynchronous write/create

Parameter určuje spôsob komunikácie s PVI Managerom pri vytváraní objektov a pri zápise hodnôt. Odporučaný je asynchrónny spôsob, synchrónny je implementovaný iba kvôli ladeniu a diagnostike. Synchrónny spôsob práce je navyše nepodporený PVI Managerom z viacerých threadov, preto ho je možné použiť iba pri jedinej linke B&R.YES/NOYES

Kotva
vd
vd
Value Debug

Zapnutie výpisu čítaných a zapisovaných hodnôt a názvov meraných bodov.YES/NONO

Kotva
fd
fd
Full Debug

Výpis dodatočných ladiacich informácií o komunikácii na linke.YES/NONO

...

ParameterDescription
CD

Connection description

EVDefinition of the enable mask for events. Default: "EV=ed".
  • "e": Change in error state
  • "d": Change in data
  • "f": Change in data format
  • "c": Change in the connection description
  • "p": Progress information about active requests
  • "s": Status changes
  • 'u': Change in the user tag string
  • 'l': Special line events
Example: "EV=edfc"
If no events should be enabled, then specify "EV=".
ATObject attributes. Default: "AT=rw"
  • "r": Allows read access
  • "w": Allows write access
  • "e": PLC event operation
  • "h": Immediate write echo if access type POBJ_ACC_DATA
  • "d": Direct event trigger for the POBJ_EVENT_DATA event
RFRefresh rate in ms. Default: "RF=1000".
  • =-1: Cyclic data refresh is turned off
  • = 0: Data refresh is only carried out once
  • > 0: Cyclic data refresh is carried out with the specified refresh rate
VTVariable type (Data format description). Default in the process object: "VT=i32"
  • "i8", "i16", "i32", "i64": 8 to 64-bit signed integer
  • "u8", "u16", "u32", "u64": 8 to 64-bit unsigned integer
  • "f32", "f64": 32/64-bit floating point
  • "boolean": Flag with element length of 1 byte
  • "string": String with 8-bit character size
  • "wstring": String with 16-bit character size
  • "struct": Structure
  • "time": 32-bit time in ms since midnight
  • "dt": 32-bit date and time in seconds since 1/1/1968
  • "date": 32-bit date,
  • "tod". 32-bit time of day,
  • "datedata": General variable type with 1-byte element length
VLVariable length in bytes (data format description). This parameter can only be specified together with the VT parameter.
For single variables, the variable length corresponds to the process data length. For array variables, the variable length is defined as the element length. This parameter does not need to be specified when used in conjunction with variable types which have a fixed variable length (e.g. VT=i32 always has a variable length of 4 bytes).
VNThe number of elements in array variables (data format description). Default: VN=1. This parameter can only be specified together with the VT parameter.
VS

Optional additional specification of the variable type (Data format description). This parameter can only be specified together with the VT parameter.

The VS parameter provides additional information about the variable type (VT parameter), and does not affect how data is handled (data functions, type changes, etc.) in PVI. Each additional specification consists of one or more specification IDs ('a' - 'z'). The individual specification IDs are separated by semicolons (';'). The following additional specifications are currently defined: 'a' ... array variable, 'b' ... bit string, 'e' ... enumeration, 'v' ... derived data type.

ALStructure alignment. Default: "AL=1".
This parameter only takes effect in connection with variable type "VT=struct". Alignment values 1, 2, 4, 8, or 16 can be defined.
CMMode for type casting (cast mode). Default: "CM=0".
The mode is defined as a bit list and controls type casting between link and process objects.
  • Bit 0: String variable for PG2000 or AS 1.3
  • Bit 1: String contents are interpreted as a decimal number
  • Bit 2: Value range is monitored
  • Bit 3: Rounding takes place when casting type from a float to an integer
  • Bit 4: Strings are always terminated with 0 (null).
VAVariable addressing. Default: No variable addressing
Using variable addressing, link objects can address subsets from the process data of a variable object.
DVThe default value for single variables (process data).
This parameter can be used to assign a default data value to process variable objects of type Integer, Floating Point, Boolean, or String. If this parameter is specified, then a data format also has to be defined in the object description. This default value is only written to the process image but is not transferred to the PLC.
Examples: DV=123,  DV=2.561e10,  DV="string format"
HYAssigned event hysteresis. Default: No hysteresis
Definition of event hysteresis for single variables or array variables of type Integer or Floating Point. Event hysteresis is specified as a hysteresis value.
Examples: HY=10, HY=2.5
FSAssigned data function. Default: No function
Definition of a data function for single variables or array variables of type Integer or Floating Point. The data function is specified as a function description.
UTA user tag. With user tags, PVI applications can assign a private user code or specific user data to a process object (module, task, or variable object) in the form of a string. User tags are only managed by PVI, not evaluated.

...

  • CD=gByte VT=u8 RF=10 - 1-bajtová premenná gByte bez znamienka, 10 ms refresh rate
  • CD=gMyInt VT=i16 HY=5 - 2-bajtová premenná gByte so znamienkom, s hysteréziou 5 (menšia zmena ako 5 nebude reportovaná)
  • CD=gDate RF=250 AT=rw VT=date - premenná gDate typu dátum, prístup na čítanie a zápis, 250 ms refresh rate
  • CD=gmArrInt VT=i16 VN=6 - premenná gmArrInt typu pole 16-bitových integerov, bude čítaných prvých 6 položiek poľa
    Pozn: Aby malo zmysel čítanie viac ako jednej položky poľa, je nutné nakonfigurovať cieľový stĺpec štruktúry.
    Pozn: Takáto premenná je určená iba na čítanie. Ak je potrebný zápis, je nutné nakonfigurovať každú položku poľa ako samostatný meraný bod (viď ďalší príklad).
  • CD=gmArrInt[0] VT=i16 - nultá položka poľa 16-bitových integerov gmArrInt (polia v B&R PLC štandardne začínajú nultou položkou podobne ako v jazyku C)
  • CD=string_arr RF=250 AT=rw VT=string VL=6 VN=5 - premenná string_arr typu pole 6-bajtových reťazcov, bude čítaných prvých 5 položiek poľa, 250 ms refresh rate
    Pozn: Ak má reťazec typu string 6 bajtov, zmestí sa doň iba 5 znakov (posledný bajt je ukončovacia nula).
  • CD=wstring_arr VT=wstring VL=42 VN=4 - premenná wstring_arr typu pole širokých (2-bajtových) reťazcov, budú čítané prvé 4 položky poľa
    Pozn: Ak má reťazec typu wstring 42 bajtov, zmestí sa doň iba 20 2-bajtových znakov (posledné 2 bajty je ukončovacia nula).
  • CD=Controll.cmd.SetPoint VT=f32 VL=4 VN=1 - položka SetPoint podštruktúry cmd štruktúrovanej premennej Controll je 32-bitové reálne číslo.

...

View file
namePviBase.chm
height150
 PVI Base system - B&R documentation


Info
titleBlog

O protokole B&R PVI protocol si môžete prečítať aj blog:

Kotva
zmeny_upravy
zmeny_upravy
Zmeny a úpravy

...