Commit 4027f76c authored by Claes Sjofors's avatar Claes Sjofors

Wb script function GetVersion() added

parent 52f6e20b
......@@ -9997,6 +9997,8 @@ GetVolumeClass() <LINK> getvolumeclass()
GetVolumeList() <LINK> getvolumelist()
SetAttribute() <LINK> setattribute()
CreateObject() <LINK> createobject()
RenameObject() <LINK> renameobject()
MoveObject() <LINK> moveobject()
OpenPlcPgm() <LINK> openplcpgm()
CreatePlcObject() <LINK> createplcobject()
CreatePlcConnection() <LINK> createplcconnection()
......@@ -10030,6 +10032,7 @@ CloseGraph() <LINK> closegraph()
SetSubwindow() <LINK> setsubwindow()
GetIoDeviceData() <LINK> getiodevicedata()
SetIoDeviceData() <LINK> setiodevicedata()
GetVersion() <LINK> getversion()
pwr_get_config() <LINK> pwr_get_config()
get_node_name() <LINK> get_node_name()
......@@ -10993,7 +10996,9 @@ GetRootList() <t>Get first object in root list. <LINK> getrootlist()
GetVolumeClass() <t>Get class of a volume. <LINK> getvolumeclass()
GetVolumeList() <t>Get fist volume. <LINK> getvolumelist()
SetAttribute() <t>Set attribute value. <LINK> setattribute()
CreateObject() <t>Create an object session. <LINK> createobject()
CreateObject() <t>Create an object. <LINK> createobject()
RenameObject() <t>Change name of an object. <LINK> renameobject()
MoveObject() <t>Move an object. <LINK> moveobject()
OpenPlcPgm() <t>Open a PlcPgm. <LINK> openplcpgm()
CreatePlcObject() <t>Create a plc object. <LINK> createplcobject()
CreatePlcConnection() <t>Create a plc connection. <LINK> createplcconnection()
......@@ -11416,6 +11421,49 @@ int <t>destcode <t>destination code. 1 first child, 2 last ch
<c> CreateObject( "Temperature", "BaseTempSensor", "Pump-V1", 2);
</TOPIC>
<TOPIC> renameobject() <style> function
RenameObject()
int RenameObject( string name, string newname)
<b>Description
Change the name of an object.
Returns the status of the operation.
<b>Argument
string <t>name <t>old name with path.
string <t>newname <t>new name without path.
<b>Example
<c> RenameObject( "H1-Zon1-Temp2", "PT2");
</TOPIC>
<TOPIC> moveobject() <style> function
MoveObject()
int MoveObject( string name, string destination, int destcode)
<b>Description
Move an object.
Returns the status of the operation.
<b>Argument
string <t>name <t>name with path.
string <t>destination <t>destination object. A father or sibling to the object
<t><t>in the new position.
int <t>destcode <t>destination code. 1 first child, 2 last child,
<t><t>3 after, 4 before.
<b>Example
<c> MoveObject( "H1-Zon1-Temp2", "H1-Zon2", 1);
</TOPIC>
<TOPIC> openplcpgm() <style> function
OpenPlcPgm()
......@@ -11621,6 +11669,7 @@ CloseGraph() <t>Close a Ge graph. <LINK> closegraph()
SetSubwindow() <t>Open a graph in a window object. <LINK> setsubwindow()
GetIoDeviceData() <t>Get data from IO configuration. <LINK> getiodevicedata()
SetIoDeviceData() <t>Set data in IO configuration. <LINK> setiodevicedata()
GetVersion() <t>Get Proview version. <LINK> getversion()
pwr_get_config() <t>Get configuration values. <LINK> pwr_get_config()
get_node_name() <t>Get node name. <LINK> get_node_name()
</TOPIC>
......@@ -12053,6 +12102,25 @@ string <t>value <t>Value to set.
<c> sts = SetIoDeviceData( "Nodes-MyNode-PN-D1", "NetworkSettings-DeviceName", "ET200M-D1");
</TOPIC>
<TOPIC> getversion() <style> function
GetVersion()
int GetVersion()
<b>Description
Get the Proview version for the current release.
Returns an integer value that is 10000 * major + 100 * minor + release.
For example V5.3.1 returns 50301.
<b>Example
<c> if ( GetVersion() > 50300)
<c> # Only for versions larger than V5.3.0
<c> ...
<c> endif
</TOPIC>
</headerlevel>
......
......@@ -9863,6 +9863,14 @@ GetRootList() <LINK> getrootlist()
GetVolumeClass() <LINK> getvolumeclass()
GetVolumeList() <LINK> getvolumelist()
SetAttribute() <LINK> setattribute()
CreateObject() <LINK> createobject()
RenameObject() <LINK> renameobject()
MoveObject() <LINK> moveobject()
OpenPlcPgm() <LINK> openplcpgm()
CreatePlcObject() <LINK> createplcobject()
CreatePlcConnection() <LINK> createplcconnection()
SetPlcObjectAttr() <LINK> setplcobjectattr()
PlcConnect() <LINK> plcconnect()
<h2>System funktioner
exit() <LINK> exit()
......@@ -10846,6 +10854,14 @@ GetRootList() <t>H
GetVolumeClass() <t>Hämta klassen för en volym. <LINK> getvolumeclass()
GetVolumeList() <t>Hämta första volymen. <LINK> getvolumelist()
SetAttribute() <t>Sätt värde på ett attribut. <LINK> setattribute()
CreateObject() <t>Skapa ett objekt. <LINK> createobject()
RenameObject() <t>Ändra namn på ett objekt. <LINK> renameobject()
MoveObject() <t>Flytta ett objekt. <LINK> moveobject()
OpenPlcPgm() <t>Öppna ett PlcPgm. <LINK> openplcpgm()
CreatePlcObject() <t>Skapa ett plc-objekt. <LINK> createplcobject()
CreatePlcConnection() <t>Skapa en plc-koppling. <LINK> createplcconnection()
SetPlcObjectAttr() <t>Sätt värde på ett attribut i ett plc-objekt. <LINK> setplcobjectattr()
PlcConnect() <t>Koppla ett plc-objekt. <LINK> plcconnect()
</TOPIC>
<headerlevel>
......
......@@ -85,7 +85,7 @@
#if (pwr_dHost_byteOrder == pwr_dLittleEndian)
# define SET_VERSION(a, b, c, d) ((pwr_tVersion)((d << 24) + (c << 16) + (b << 8) + a))
#else
# define SET_VERSION(a, b, c, d) ((pwr_tVersion)((a << 24) + (a << 16) + (a << 8) + a))
# define SET_VERSION(a, b, c, d) ((pwr_tVersion)((a << 24) + (b << 16) + (c << 8) + d))
#endif
#define pwrv_cBuildTimeStr "17-OCT-2014 12:00:00"
......@@ -96,4 +96,15 @@
#define pwrv_cWbdbVersionShortStr "V53"
#define pwrv_cPwrCopyright "Copyright (C) 2005-2015 SSAB EMEA AB"
#if (pwr_dHost_byteOrder == pwr_dLittleEndian)
# define PWRV_VERSION_MAJOR (0xFF & (pwrv_cPwrVersion >> 8))
# define PWRV_VERSION_MINOR (0xFF & (pwrv_cPwrVersion >> 16))
# define PWRV_VERSION_RELEASE (0xFF & (pwrv_cPwrVersion >> 24))
#else
# define PWRV_VERSION_MAJOR (0xFF & (pwrv_cPwrVersion >> 16))
# define PWRV_VERSION_MINOR (0xFF & (pwrv_cPwrVersion >> 8))
# define PWRV_VERSION_RELEASE (0xFF & (pwrv_cPwrVersion >> 0))
#endif
#endif
......@@ -41,6 +41,7 @@
#include <string.h>
#include "pwr.h"
#include "pwr_version.h"
#include "pwr_class.h"
#include "pwr_baseclasses.h"
#include "co_time.h"
......@@ -1360,6 +1361,24 @@ static int wccm_getopsys_func(
return 1;
}
static int wccm_getversion_func(
void *filectx,
ccm_sArg *arg_list,
int arg_count,
int *return_decl,
ccm_tFloat *return_float,
ccm_tInt *return_int,
char *return_string)
{
if ( arg_count != 0)
return CCM__ARGMISM;
*return_int = 10000 * PWRV_VERSION_MAJOR + 100 * PWRV_VERSION_MINOR + PWRV_VERSION_RELEASE;
*return_decl = CCM_DECL_INT;
return 1;
}
static int wccm_gethardware_func(
void *filectx,
ccm_sArg *arg_list,
......@@ -2053,6 +2072,8 @@ int wccm_register(
if ( EVEN(sts)) return sts;
sts = ccm_register_function( "GetOpSys", wccm_getopsys_func);
if ( EVEN(sts)) return sts;
sts = ccm_register_function( "GetVersion", wccm_getversion_func);
if ( EVEN(sts)) return sts;
sts = ccm_register_function( "CreateObject", wccm_createobject_func);
if ( EVEN(sts)) return sts;
sts = ccm_register_function( "OpenPlcPgm", wccm_openplcpgm_func);
......
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