Commit a43e6737 authored by claes's avatar claes

Merge branch 'master' of 62.20.65.89:/data1/git/pwr

parents fff60e6b 0a59cb5c
......@@ -41,7 +41,7 @@
#include <map>
#include <sys/socket.h>
#include <net/if.h>
#include <net/if_arp.h>
// #include <net/if_arp.h>
#include <pthread.h>
#include <float.h>
......
......@@ -278,7 +278,11 @@ pwr_tStatus time_AtoOPCAscii (pwr_tTime *tp, char *buf, int bufsize)
time_t sec = tp->tv_sec;
tmpTm = localtime(&sec);
#if defined OS_CYGWIN
tzone = 0;
#else
tzone = tmpTm->tm_gmtoff / 3600;
#endif
strftime(buf, bufsize, "%Y-%m-%dT%H:%M:%S", tmpTm);
sprintf(tmpStr, ".%07d%s%02d:00", (int)(tp->tv_nsec / 100), tzone >= 0 ? "+" : "", tzone);
......
......@@ -125,7 +125,7 @@ static pwr_tStatus IoCardInit( io_tCtx ctx,
int map_found = 0;
int name_found = 0;
for ( i = 0; i < IO_CHANLIST_SIZE; i++) {
for ( i = 0; i < cp->ChanListSize; i++) {
if ( cp->chanlist[i].sop) {
switch ( cp->chanlist[i].ChanClass) {
case pwr_cClass_ChanAi: {
......
......@@ -29,4 +29,5 @@
110328 cs profinet Profinet configurator, choice wether to clear or keep data when gsdml file is changed.
110429 cs profibus Profibus gsd Bit and BitArea syntax fix for space between Bit and (
110531 cs profinet Recall buffer added to profinet configurator.
110531 cs profinet Script functions GetIoDeviceData and SetIoDeviceData to modify profinet configuration added.
\ No newline at end of file
110531 cs profinet Script functions GetIoDeviceData and SetIoDeviceData to modify profinet configuration added.
110909 rk profinet Added functionality for acyclic write to a device
\ No newline at end of file
......@@ -48,6 +48,7 @@
#include "netinet/in.h"
#include "arpa/inet.h"
#include "pwr_profibusclasses.h"
#ifndef rt_pn_iface_h
# include "rt_pn_iface.h"
#endif
......
......@@ -50,8 +50,8 @@
# include "rt_io_base.h"
#ifndef rt_io_pn_locals_h
# include "rt_io_pn_locals.h"
#ifndef rt_io_pnak_locals_h
# include "rt_io_pnak_locals.h"
#endif
#ifndef rt_pn_gsdml_data_h
......
......@@ -1577,6 +1577,8 @@ int GsdmlAttrNav::save( const char *filename)
continue;
}
ssd->api = vsd->Body.API;
if ( !vsd->IOData)
continue;
......@@ -1656,6 +1658,8 @@ int GsdmlAttrNav::save( const char *filename)
continue;
}
ssd->api = vsd->Body.API;
if ( !vsd->IOData)
continue;
......
......@@ -220,6 +220,7 @@ static pwr_tStatus IoAgentInit (
pn_subslot_data = new PnSubmoduleData;
pn_subslot_data->subslot_number = dev_data->slot_data[jj]->subslot_data[kk]->subslot_number;
pn_subslot_data->ident_number = dev_data->slot_data[jj]->subslot_data[kk]->submodule_ident_number;
pn_subslot_data->api = dev_data->slot_data[jj]->subslot_data[kk]->api;
if (dev_data->slot_data[jj]->subslot_data[kk]->io_input_length > 0) {
pn_subslot_data->io_in_data_length = dev_data->slot_data[jj]->subslot_data[kk]->io_input_length;
pn_subslot_data->type = PROFINET_IO_SUBMODULE_TYPE_INPUT ;
......@@ -261,7 +262,7 @@ static pwr_tStatus IoAgentInit (
sts = pnak_send_service_req_res(0, &local->service_req_res);
if (sts == PNAK_OK) {
sts = handle_service_con(local, ap);
sts = wait_service_con(local, ap);
if (sts == PNAK_OK) {
/* Loop through devices and calculate offset for io */
......@@ -324,7 +325,7 @@ static pwr_tStatus IoAgentInit (
sts = pnak_send_service_req_res(0, &local->service_req_res);
if (sts == PNAK_OK) {
sts = handle_service_con(local, ap);
sts = wait_service_con(local, ap);
}
/* Set mode online */
......@@ -393,7 +394,7 @@ static pwr_tStatus IoAgentInit (
sts = pnak_send_service_req_res(0, &local->service_req_res);
if (sts == PNAK_OK) {
sts = handle_service_con(local, ap);
sts = wait_service_con(local, ap);
}
}
......@@ -484,6 +485,8 @@ static pwr_tStatus IoAgentWrite (
unsigned char *io_datap;
unsigned char *clean_io_datap;
PnSubmoduleData *submodule;
io_sRack *slave_list;
pwr_sClass_PnDevice *sp;
unsigned short data_length, ii, jj, kk, ll;
unsigned char *status_datap;
......@@ -492,6 +495,9 @@ static pwr_tStatus IoAgentWrite (
/* Write i/o for all devices fetch it first from clean io data area */
/* Iterate over the slaves. */
slave_list = ap->racklist;
for (ii = 1; ii < local->device_data.size(); ii++) {
if (local->device_data[ii]->device_state == PNAK_DEVICE_STATE_CONNECTED) {
......@@ -520,6 +526,36 @@ static pwr_tStatus IoAgentWrite (
sts = pnak_set_iocr_data(0, pn_iocr_data->identifier, pn_iocr_data->io_data, pn_iocr_data->io_data_length);
}
}
if (slave_list != NULL) {
sp = (pwr_sClass_PnDevice *) slave_list->op;
slave_list = slave_list->next;
/* Check if there is a write request pending ?? */
if (sp->WriteReq.SendReq) {
if ((sp->WriteReq.Length > 0) && (sp->WriteReq.Length <= sizeof(sp->WriteReq.Data))) {
for (jj = 0; jj < local->device_data[ii]->module_data.size(); jj++) {
if (local->device_data[ii]->module_data[jj]->slot_number == sp->WriteReq.SlotNumber) {
for (kk = 0; kk < local->device_data[ii]->module_data[jj]->submodule_data.size(); kk++) {
if (local->device_data[ii]->module_data[jj]->submodule_data[kk]->subslot_number == sp->WriteReq.SubslotNumber) {
if (local->device_data[ii]->module_data[jj]->submodule_data[kk]->api > 0) {
sp->WriteReq.Api = local->device_data[ii]->module_data[jj]->submodule_data[kk]->api;
}
pack_write_req(&local->service_req_res, local->device_data[ii]->device_ref, &sp->WriteReq);
sts = pnak_send_service_req_res(0, &local->service_req_res);
break;
}
}
break;
}
}
}
sp->WriteReq.SendReq = 0;
}
}
}
}
......
......@@ -74,7 +74,7 @@ class PnIOCRData {
class PnSubmoduleData {
public:
PnSubmoduleData() : subslot_number(0), subslot_idx(0), type(0), state(0), ident_number(0), phys_ident_number(0) {}
PnSubmoduleData() : subslot_number(0), subslot_idx(0), type(0), state(0), ident_number(0), phys_ident_number(0), api(0) {}
unsigned short subslot_number;
unsigned short subslot_idx;
......@@ -82,6 +82,7 @@ class PnSubmoduleData {
unsigned short state;
unsigned int ident_number;
unsigned int phys_ident_number;
unsigned int api;
unsigned short io_in_data_length; // bytes of pure io-data
unsigned short offset_io_in; // offset in io-data area for this iocr
......
......@@ -63,6 +63,8 @@ void pack_set_identification_req(T_PNAK_SERVICE_REQ_RES *ServiceReqRes);
void pack_get_device_state_req(T_PNAK_SERVICE_REQ_RES *ServiceReqRes, unsigned short device_ref);
void pack_write_req(T_PNAK_SERVICE_REQ_RES *ServiceReqRes, unsigned short device_ref, pwr_sClass_PnWriteReq *wr_req);
void pack_get_los_req(T_PNAK_SERVICE_REQ_RES *ServiceReqRes);
void pack_get_alarm_req(T_PNAK_SERVICE_REQ_RES *ServiceReqRes, unsigned short ref);
......@@ -71,6 +73,8 @@ void pack_alarm_ack_req(T_PNAK_SERVICE_REQ_RES *ServiceReqRes, unsigned short re
void pack_download_req(T_PNAK_SERVICE_REQ_RES *ServiceReqRes, GsdmlDeviceData *dev_data, unsigned short device_ref);
int unpack_write_con(T_PNAK_SERVICE_DESCRIPTION* pSdb, io_sAgentLocal *local);
int unpack_get_los_con(T_PNAK_SERVICE_DESCRIPTION* pSdb, io_sAgentLocal *local);
int unpack_get_alarm_con(T_PNAK_SERVICE_DESCRIPTION* pSdb, io_sAgentLocal *local, io_sAgent *ap);
......@@ -80,6 +84,8 @@ int unpack_download_con(T_PNAK_SERVICE_DESCRIPTION* pSdb, io_sAgentLocal *local)
int handle_service_con(io_sAgentLocal *local, io_sAgent *ap);
int wait_service_con(io_sAgentLocal *local, io_sAgent *ap);
void handle_exception (io_sAgentLocal *local);
void handle_state_changed (io_sAgentLocal *local);
......
......@@ -94,6 +94,7 @@ int GsdmlSubslotData::print( ofstream& fp)
" <Subslot SubslotNumber=\"" << subslot_number << "\"" << endl <<
" SubmoduleEnumNumber=\"" << submodule_enum_number << "\"" << endl <<
" SubmoduleIdentNumber=\"" << submodule_ident_number << "\"" << endl <<
" API=\"" << api << "\"" << endl <<
" IOInputLength=\"" << io_input_length << "\"" << endl <<
" IOOutputLength=\"" << io_output_length << "\" >" << endl;
......@@ -555,6 +556,8 @@ int GsdmlDataReader::tag_attribute( const char *name, const char *value)
sscanf( value, "%u", &sd->subslot_number);
else if ( strcmp( name, "SubmoduleIdentNumber") == 0)
sscanf( value, "%u", &sd->submodule_ident_number);
else if ( strcmp( name, "API") == 0)
sscanf( value, "%u", &sd->api);
else if ( strcmp( name, "SubmoduleEnumNumber") == 0)
sscanf( value, "%d", &sd->submodule_enum_number);
else if ( strcmp( name, "IOInputLength") == 0)
......
......@@ -83,13 +83,14 @@ class GsdmlIOCRData {
class GsdmlSubslotData {
public:
GsdmlSubslotData() : subslot_number(0), subslot_idx(0), submodule_enum_number(0),
submodule_ident_number(0), io_input_length(0), io_output_length(0) {}
submodule_ident_number(0), api(0), io_input_length(0), io_output_length(0) {}
vector<GsdmlDataRecord *> data_record;
unsigned int subslot_number;
unsigned int subslot_idx;
unsigned int submodule_enum_number;
unsigned int submodule_ident_number;
unsigned int api;
unsigned int io_input_length;
unsigned int io_output_length;
......
Volume Profibus $ClassVolume 0.0.250.7
Body SysBody 05-SEP-2005 17:51:40.00
Attr NextOix = "_X209"
Attr NextCix = "_X19"
Attr NextCix = "_X20"
Attr NextTix[0] = "_X12"
EndBody
Object Type $TypeHier 55 16-JAN-2006 10:07:43.21
......@@ -2695,7 +2695,7 @@ Volume Profibus $ClassVolume 0.0.250.7
!
! Furthermore, manufacturer specific alarms may be used and alarms
! are reserved for profile specific definitions.
!
!
!*/
Object Type $Attribute 1 10-JUN-2010 10:53:19.20
Body SysBody 21-OCT-2010 08:59:53.40
......@@ -2803,12 +2803,103 @@ Volume Profibus $ClassVolume 0.0.250.7
EndObject
EndObject
!/**
! Sends an acyclic write request to a device
! for a certain slot and subslot.
!*/
Object PnWriteReq $ClassDef 19 07-SEP-2011 08:49:46.86
Body SysBody 07-SEP-2011 08:49:30.59
Attr Editor = 0
Attr Method = 0
Attr Flags = 16
EndBody
Object RtBody $ObjBodyDef 1 07-SEP-2011 08:49:53.46
Body SysBody 07-SEP-2011 08:49:53.46
Attr StructName = "PnWriteReq"
Attr NextAix = "_X8"
EndBody
!/**
! Application Process Identifier, usually 0 but can be
! defined to other by a device profile.
!*/
Object Api $Attribute 1 07-SEP-2011 08:50:09.27
Body SysBody 07-SEP-2011 08:50:29.19
Attr PgmName = "Api"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
!/**
! Number of slot to write to.
!*/
Object SlotNumber $Attribute 2 07-SEP-2011 08:50:58.89
Body SysBody 07-SEP-2011 08:50:58.89
Attr PgmName = "SlotNumber"
Attr Flags = 1024
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!/**
! Number of subslot to write to.
!*/
Object SubslotNumber $Attribute 3 07-SEP-2011 08:50:58.89
Body SysBody 07-SEP-2011 08:50:58.89
Attr PgmName = "SubslotNumber"
Attr Flags = 1024
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!/**
! Unique ID of record data object to write to.
!*/
Object Index $Attribute 4 07-SEP-2011 08:51:20.46
Body SysBody 07-SEP-2011 08:51:21.42
Attr PgmName = "Index"
Attr Flags = 1024
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!/**
! Bytes of data to write.
!*/
Object Length $Attribute 5 07-SEP-2011 08:55:25.16
Body SysBody 07-SEP-2011 08:55:25.53
Attr PgmName = "Length"
Attr Flags = 1024
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
!/**
! The data to write.
!*/
Object Data $Attribute 6 07-SEP-2011 08:56:03.58
Body SysBody 07-SEP-2011 08:56:48.30
Attr PgmName = "Data"
Attr Flags = 1026
Attr Elements = 256
Attr TypeRef = "pwrs:Type-$UInt8"
EndBody
EndObject
!/**
! Send the write request.
!*/
Object SendReq $Attribute 7 07-SEP-2011 09:13:01.58
Body SysBody 07-SEP-2011 09:13:16.75
Attr PgmName = "SendReq"
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
EndObject
Object Template PnWriteReq 2152693760 01-JAN-1970 01:00:00.00
Body RtBody 01-JAN-1970 01:00:00.00
EndBody
EndObject
EndObject
!/**
! @Author Robert Karlsson
! @Version 1.0
! @Group IO
! @Summary Defines that a Profinet controller stack is installed.
! Configures a Profinet controller stack.
!
!
! @b See also
! @classlink PnDevice profibus_pndevice.html
!*/
......@@ -2915,7 +3006,7 @@ Volume Profibus $ClassVolume 0.0.250.7
! @Group IO
! @Summary Configures one Profinet device.
! Configures one Profinet device.
!
!
! @b See also
! @classlink PnControllerSoftingPNAK profibus_pncontrollersoftingpnak.html
! @classlink Hilscher_cifX_PnController otherio_hilscher_cifx_pncontroller.html
......@@ -2929,7 +3020,7 @@ Volume Profibus $ClassVolume 0.0.250.7
Object RtBody $ObjBodyDef 1 21-APR-2009 13:41:08.17
Body SysBody 21-APR-2009 13:41:08.17
Attr StructName = "PnDevice"
Attr NextAix = "_X105"
Attr NextAix = "_X106"
EndBody
!/**
! Description.
......@@ -3107,6 +3198,16 @@ Volume Profibus $ClassVolume 0.0.250.7
Attr TypeRef = "Profibus:Class-PnAlarm"
EndBody
EndObject
!/**
! Request to write data to a subslot
!*/
Object WriteReq $Attribute 105 07-SEP-2011 10:24:03.67
Body SysBody 07-SEP-2011 10:24:13.69
Attr PgmName = "WriteReq"
Attr Flags = 16908288
Attr TypeRef = "Profibus:Class-PnWriteReq"
EndBody
EndObject
EndObject
Object ConfiguratorPosnn $Menu 122 21-APR-2009 13:41:08.17
Object Pointed $Menu 123 21-APR-2009 13:41:08.17
......
......@@ -422,9 +422,9 @@ int CnvWblToHtml::close()
}
#endif
char cmd[400];
sprintf( cmd, "cat %s/*.jsf %s/../../orm_menu.js > %s/menu.js", ctx->dir,
ctx->dir, ctx->dir);
char cmd[600];
snprintf( cmd, sizeof(cmd), "if [ -e %s/../../orm_menu.js ]; then cat %s/*.jsf %s/../../orm_menu.js > %s/menu.js; fi",
ctx->dir, ctx->dir, ctx->dir, ctx->dir);
system( cmd);
return 1;
......
......@@ -110,15 +110,23 @@ int main( int argc, char *argv[])
#if defined OS_LINUX
char os[] = "OS_LINUX";
char dos[] = "-DOS_LINUX -DOS_POSIX";
char cflags[] = "";
#elif defined OS_MACOS
char os[] = "OS_MACOS";
char dos[] = "-DOS_MACOS -DOS_POSIX";
char cflags[] = "";
#elif defined OS_FREEBSD
char os[] = "OS_FREEBSD";
char dos[] = "-DOS_FREEBSD -DOS_POSIX";
char cflags[] = "";
#elif defined OS_OPENBSD
char os[] = "OS_OPENBSD";
char dos[] = "-DOS_OPENBSD -DOS_POSIX";
char cflags[] = "";
#elif defined OS_CYGWIN
char os[] = "OS_CYGWIN";
char dos[] = "-DOS_CYGWIN -DOS_POSIX";
char cflags[] = "-I/usr/include/tirpc";
#endif
if ( argc < 4) {
usage();
......@@ -280,10 +288,10 @@ int main( int argc, char *argv[])
dcli_translate_filename( incdir, "$pwr_einc");
switch ( mtype) {
case merge_eMtype_WbBase:
snprintf( cmd, sizeof(cmd), "%s -c -I%s %s -o %s %s", pwre_cxx, incdir, dos, ofile, cfile);
snprintf( cmd, sizeof(cmd), "%s -c %s -I%s %s -o %s %s", pwre_cxx, cflags, incdir, dos, ofile, cfile);
break;
default:
snprintf( cmd, sizeof(cmd), "%s -c -I%s %s -o %s %s", pwre_cc, incdir, dos, ofile, cfile);
snprintf( cmd, sizeof(cmd), "%s -c %s -I%s %s -o %s %s", pwre_cc, cflags, incdir, dos, ofile, cfile);
}
if ( arg_verbose)
printf( "co_merge: %s\n", cmd);
......
......@@ -196,20 +196,19 @@ int rt_sevhistmon::init_objects()
ODD(sts);
sts = gdh_GetNextAttrRef( pwr_cClass_SevHist, &h_aref, &h_aref)) {
sev_sevhist h;
pwr_sClass_SevHist *h_p;
int hs_idx;
m_sts = gdh_AttrRefToPointer( &h_aref, (void **)&h_p);
m_sts = gdh_DLRefObjectInfoAttrref( &h_aref, (void **)&h.hsp, &h.hs_refid);
if ( EVEN(m_sts)) throw co_error(m_sts);
h.aref = h_p->Attribute;
h.aref = h.hsp->Attribute;
m_sts = gdh_AttrrefToName( &h_aref, hname, sizeof(hname), cdh_mName_volumeStrict);
if ( EVEN(m_sts)) throw co_error(m_sts);
hs_idx = -1;
for ( int i = 0; i < (int) m_hs.size(); i++) {
if ( cdh_ObjidIsEqual( h_p->ThreadObject, m_hs[i].oid)) {
if ( cdh_ObjidIsEqual( h.hsp->ThreadObject, m_hs[i].oid)) {
hs_idx = i;
break;
}
......@@ -219,7 +218,7 @@ int rt_sevhistmon::init_objects()
continue;
}
m_sts = gdh_GetAttributeCharAttrref( &h_p->Attribute, &a_tid, &a_size, &a_offset, &a_dim);
m_sts = gdh_GetAttributeCharAttrref( &h.hsp->Attribute, &a_tid, &a_size, &a_offset, &a_dim);
if ( EVEN(m_sts)) {
errh_Error( "Invalid SevHist Attribute %s", hname);
continue;
......@@ -227,14 +226,14 @@ int rt_sevhistmon::init_objects()
h.sevid.nid = m_nodes[0].nid;
h.sevid.rix = m_next_rix++;
h.storagetime = h_p->StorageTime;
h.deadband = h_p->DeadBand;
h.options = h_p->Options;
h.disabled = h_p->Disable;
strncpy( h.description, h_p->Description, sizeof(h.description));
h.storagetime = h.hsp->StorageTime;
h.deadband = h.hsp->DeadBand;
h.options = h.hsp->Options;
h.disabled = h.hsp->Disable;
strncpy( h.description, h.hsp->Description, sizeof(h.description));
// Get unit from attribute object
sts = gdh_ArefANameToAref( &h_p->Attribute, "Unit", &uaref);
sts = gdh_ArefANameToAref( &h.hsp->Attribute, "Unit", &uaref);
if ( ODD(sts)) {
sts = gdh_GetObjectInfoAttrref( &uaref, &h.unit, sizeof(h.unit));
if ( EVEN(sts))
......@@ -252,7 +251,7 @@ int rt_sevhistmon::init_objects()
continue;
}
m_sts = gdh_AttrrefToName( &h_p->Attribute, h.aname, sizeof(h.aname), cdh_mName_volumeStrict);
m_sts = gdh_AttrrefToName( &h.hsp->Attribute, h.aname, sizeof(h.aname), cdh_mName_volumeStrict);
if ( EVEN(m_sts)) throw co_error(m_sts);
m_sts = gdh_RefObjectInfo( h.aname, &h.datap, &h.refid, h.size);
......@@ -284,20 +283,19 @@ int rt_sevhistmon::init_sevhistobjects()
ODD(sts);
sts = gdh_GetNextAttrRef( pwr_cClass_SevHistObject, &h_aref, &h_aref)) {
sev_sevhistobject h;
pwr_sClass_SevHistObject *h_p;
int hs_idx;
m_sts = gdh_AttrRefToPointer( &h_aref, (void **)&h_p);
m_sts = gdh_DLRefObjectInfoAttrref( &h_aref, (void **)&h.hsp, &h.hs_refid);
if ( EVEN(m_sts)) throw co_error(m_sts);
h.aref = h_p->Object;
h.aref = h.hsp->Object;
m_sts = gdh_AttrrefToName( &h_aref, hname, sizeof(hname), cdh_mName_volumeStrict);
if ( EVEN(m_sts)) throw co_error(m_sts);
hs_idx = -1;
for ( int i = 0; i < (int) m_hs.size(); i++) {
if ( cdh_ObjidIsEqual( h_p->ThreadObject, m_hs[i].oid)) {
if ( cdh_ObjidIsEqual( h.hsp->ThreadObject, m_hs[i].oid)) {
hs_idx = i;
break;
}
......@@ -307,17 +305,17 @@ int rt_sevhistmon::init_sevhistobjects()
continue;
}
m_sts = gdh_GetAttributeCharAttrref( &h_p->Object, &a_tid, &a_size, &a_offset, &a_dim);
m_sts = gdh_GetAttributeCharAttrref( &h.hsp->Object, &a_tid, &a_size, &a_offset, &a_dim);
if ( EVEN(m_sts)) {
errh_Error( "Invalid SevHistObject Attribute %s", hname);
continue;
}
h.storagetime = h_p->StorageTime;
h.deadband = h_p->DeadBand;
h.options = h_p->Options;
h.disabled = h_p->Disable;
strncpy( h.description, h_p->Description, sizeof(h.description));
h.storagetime = h.hsp->StorageTime;
h.deadband = h.hsp->DeadBand;
h.options = h.hsp->Options;
h.disabled = h.hsp->Disable;
strncpy( h.description, h.hsp->Description, sizeof(h.description));
h.scantime = m_hs[hs_idx].scantime;
......@@ -325,7 +323,7 @@ int rt_sevhistmon::init_sevhistobjects()
h.sevid.rix = m_next_rix++;
//Time to fetch all attributes for the object and put them into a list
m_sts = gdh_AttrrefToName( &h_p->Object, hname, sizeof(hname), cdh_mName_volumeStrict);
m_sts = gdh_AttrrefToName( &h.hsp->Object, hname, sizeof(hname), cdh_mName_volumeStrict);
if ( EVEN(m_sts)) throw co_error(m_sts);
strcpy(h.aname, hname);
get_sevhistobjectattributes(hname, &h.sevhistobjectattrlist, hs_idx, true);
......@@ -580,8 +578,10 @@ bool rt_sevhistmon::correct_histtype(const pwr_eType type)
int rt_sevhistmon::close_objects()
{
for ( unsigned int i = 0; i < m_hs.size(); i++) {
for ( unsigned int j = 0; j < m_hs[i].sevhistlist.size(); j++)
gdh_UnrefObjectInfo( m_hs[i].sevhistlist[j].refid);
for ( unsigned int j = 0; j < m_hs[i].sevhistlist.size(); j++) {
gdh_UnrefObjectInfo( m_hs[i].sevhistlist[j].hs_refid);
gdh_UnrefObjectInfo( m_hs[i].sevhistlist[j].refid);
}
gdh_UnrefObjectInfo( m_hs[i].refid);
}
m_hs.clear();
......@@ -637,7 +637,13 @@ int rt_sevhistmon::send_data()
dp = (sev_sHistData *) &msg->Data;
for ( unsigned int j = 0; j < m_hs[i].sevhistlist.size(); j++) {
if ( !m_hs[i].sevhistlist[j].disabled) {
if ( !m_hs[i].sevhistlist[j].hsp->Disable) {
if ( m_hs[i].sevhistlist[j].hsp->Options & pwr_mSevOptionsMask_Event &&
m_hs[i].sevhistlist[j].hsp->Trigger)
m_hs[i].sevhistlist[j].hsp->Trigger = 0;
else
continue;
dp->sevid = m_hs[i].sevhistlist[j].sevid;
dp->type = m_hs[i].sevhistlist[j].type;
dp->size = m_hs[i].sevhistlist[j].size;
......@@ -648,11 +654,17 @@ int rt_sevhistmon::send_data()
void *dpp;
for ( unsigned int j = 0; j < m_hs[i].sevhistobjectlist.size(); j++) {
dp->sevid = m_hs[i].sevhistobjectlist[j].sevid;
dp->size = m_hs[i].sevhistobjectlist[j].datasize;
dpp = &(dp->data);
for ( unsigned int k = 0; k < m_hs[i].sevhistobjectlist[j].sevhistobjectattrlist.size(); k++) {
if ( !m_hs[i].sevhistobjectlist[j].disabled) {
if ( !m_hs[i].sevhistobjectlist[j].hsp->Disable) {
if ( m_hs[i].sevhistobjectlist[j].hsp->Options & pwr_mSevOptionsMask_Event &&
m_hs[i].sevhistobjectlist[j].hsp->Trigger)
m_hs[i].sevhistobjectlist[j].hsp->Trigger = 0;
else
continue;
dp->sevid = m_hs[i].sevhistobjectlist[j].sevid;
dp->size = m_hs[i].sevhistobjectlist[j].datasize;
dpp = &(dp->data);
for ( unsigned int k = 0; k < m_hs[i].sevhistobjectlist[j].sevhistobjectattrlist.size(); k++) {
//dp->type = m_hs[i].sevhistobjectlist[j].sevhistobjectattrlist[k].type;
//printf("sevhistobj[%d].attrlist[%d].aname: %s size:%d\n", j, k, m_hs[i].sevhistobjectlist[j].sevhistobjectattrlist[k].aname, m_hs[i].sevhistobjectlist[j].sevhistobjectattrlist[k].size);
//if( m_hs[i].sevhistobjectlist[j].sevhistobjectattrlist[k].type == pwr_eType_String ) {
......@@ -661,8 +673,8 @@ int rt_sevhistmon::send_data()
memcpy( dpp, m_hs[i].sevhistobjectlist[j].sevhistobjectattrlist[k].datap, m_hs[i].sevhistobjectlist[j].sevhistobjectattrlist[k].size);
dpp = (sev_sHistData *)((char *)dpp + m_hs[i].sevhistobjectlist[j].sevhistobjectattrlist[k].size);
}
dp = (sev_sHistData *)((char *)dp + sizeof( *dp) - sizeof(dp->data) + dp->size);
}
dp = (sev_sHistData *)((char *)dp + sizeof( *dp) - sizeof(dp->data) + dp->size);
}
tgt.nid = m_hs[i].nid;
......@@ -869,15 +881,14 @@ int rt_sevhistmon::send_itemlist( pwr_tNid nid)
for ( unsigned int i = 0; i < m_hs.size(); i++) {
if ( m_hs[i].configerror)
continue;
if ( nid == m_hs[i].nid)
{
item_cnt += m_hs[i].sevhistlist.size();
attr_cnt += m_hs[i].sevhistlist.size();
objectitem_cnt += m_hs[i].sevhistobjectlist.size();
for( size_t j = 0; j < m_hs[i].sevhistobjectlist.size(); j++ ) {
attr_cnt += m_hs[i].sevhistobjectlist[j].sevhistobjectattrlist.size();
histobjectsize += (m_hs[i].sevhistobjectlist[j].sevhistobjectattrlist.size() * sizeof(sev_sHistAttr));
}
if ( nid == m_hs[i].nid) {
item_cnt += m_hs[i].sevhistlist.size();
attr_cnt += m_hs[i].sevhistlist.size();
objectitem_cnt += m_hs[i].sevhistobjectlist.size();
for( size_t j = 0; j < m_hs[i].sevhistobjectlist.size(); j++ ) {
attr_cnt += m_hs[i].sevhistobjectlist[j].sevhistobjectattrlist.size();
histobjectsize += (m_hs[i].sevhistobjectlist[j].sevhistobjectattrlist.size() * sizeof(sev_sHistAttr));
}
}
}
......
......@@ -46,6 +46,8 @@ class sev_sevhist {
public:
pwr_tAttrRef aref;
pwr_tAName aname;
pwr_sClass_SevHist *hsp;
pwr_tRefId hs_refid;
pwr_tRefId refid;
void *datap;
pwr_tDeltaTime storagetime;
......@@ -76,6 +78,8 @@ class sev_sevhistobject {
public:
pwr_tAttrRef aref;
pwr_tAName aname;
pwr_sClass_SevHistObject *hsp;
pwr_tRefId hs_refid;
pwr_tDeltaTime storagetime;
pwr_tFloat32 deadband;
pwr_tMask options;
......
......@@ -39,7 +39,7 @@
#include <fstream>
#include <sys/socket.h>
#include <net/if.h>
#include <net/if_arp.h>
// #include <net/if_arp.h>
#include <pthread.h>
#include <unistd.h>
......
#!/bin/bash
#
# Proview Open Source Process Control.
# Copyright (C) 2005-2011 SSAB Oxelosund AB.
#
# This file is part of Proview.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Proview. If not, see <http://www.gnu.org/licenses/>
#
# Linking Proview statically or dynamically with other modules is
# making a combined work based on Proview. Thus, the terms and
# conditions of the GNU General Public License cover the whole
# combination.
#
# In addition, as a special exception, the copyright holders of
# Proview give you permission to, from the build function in the
# Proview Configurator, combine Proview with modules generated by the
# Proview PLC Editor to a PLC program, regardless of the license
# terms of these modules. You may copy and distribute the resulting
# combined work under the terms of your choice, provided that every
# copy of the combined work is accompanied by a complete copy of
# the source code of Proview (the version used to produce the
# combined work), being distributed under the terms of the GNU
# General Public License plus this exception.
#
#
#
function=$1
src_file=$2
systemname=$3
if [ $function == "java_web" ]; then
jarfile="$pwrp_web/pwrp_"$systemname"_web.jar"
if javac -d $pwrp_web -classpath $pwr_lib/pwr_rt.jar:$pwr_lib/pwr_jop.jar:$pwr_lib/pwr_jopc.jar:$jarfile $pwrp_pop/$src_file
then
echo "-- $src_file compiled"
if [ ! -e $jarfile ]; then
cd $pwrp_web
jar -cf $jarfile ${src_file%.java}.class
rm ${src_file%.java}.class
else
cd $pwrp_web
jar -uf $jarfile ${src_file%.java}.class
rm ${src_file%.java}.class
fi
files=`ls $pwrp_web/${src_file%.java}\\$*.class 2>&-`
if [ ! -z "$files" ]; then
# echo "Insert in archive $jarfile"
jar -uf $jarfile ${src_file%.java}\$*.class
rm ${src_file%.java}\$*.class
fi
files=`ls $pwrp_pop/*.gif 2>&-`
if [ ! -z "$files" ]; then
cd $pwrp_pop
jar -uf $jarfile *.gif
fi
files=`ls $pwrp_pop/*.jpg 2>&-`
if [ ! -z "$files" ]; then
cd $pwrp_pop
jar -uf $jarfile *.jpg
fi
fi
fi
if [ $function == "java" ]; then
jarfile="$pwrp_lib/pwrp_"$systemname".jar"
jarfileweb="$pwrp_web/pwrp_"$systemname"_web.jar"
if javac -d $pwrp_web -classpath $pwr_lib/pwr_rt.jar:$pwr_lib/pwr_jop.jar:$pwr_lib/pwr_jopc.jar:$jarfile $pwrp_pop/$src_file
then
echo "-- $src_file compiled"
if [ ! -e $jarfile ]; then
cd $pwrp_web
jar -cf $jarfile ${src_file%.java}.class
else
cd $pwrp_web
jar -uf $jarfile ${src_file%.java}.class
fi
if [ ! -e $jarfileweb ]; then
cd $pwrp_web
jar -cf $jarfileweb ${src_file%.java}.class
else
cd $pwrp_web
jar -uf $jarfileweb ${src_file%.java}.class
fi
rm ${src_file%.java}.class
files=`ls $pwrp_web/${src_file%.java}\\$*.class 2>&-`
if [ ! -z "$files" ]; then
# echo "Insert in archive $jarfile"
jar -uf $jarfile ${src_file%.java}\$*.class
jar -uf $jarfileweb ${src_file%.java}\$*.class
rm ${src_file%.java}\$*.class
fi
files=`ls $pwrp_pop/*.gif 2>&-`
if [ ! -z "$files" ]; then
cd $pwrp_pop
jar -uf $jarfile *.gif
jar -uf $jarfileweb *.gif
fi
files=`ls $pwrp_pop/*.jpg 2>&-`
if [ ! -z "$files" ]; then
cd $pwrp_pop
jar -uf $jarfile *.jpg
jar -uf $jarfileweb *.jpg
fi
fi
fi
if [ $function == "html" ]; then
cp $pwrp_pop/$src_file $pwrp_web/
fi
#!/bin/bash
#
# Proview Open Source Process Control.
# Copyright (C) 2005-2011 SSAB Oxelosund AB.
#
# This file is part of Proview.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Proview. If not, see <http://www.gnu.org/licenses/>
#
# Linking Proview statically or dynamically with other modules is
# making a combined work based on Proview. Thus, the terms and
# conditions of the GNU General Public License cover the whole
# combination.
#
# In addition, as a special exception, the copyright holders of
# Proview give you permission to, from the build function in the
# Proview Configurator, combine Proview with modules generated by the
# Proview PLC Editor to a PLC program, regardless of the license
# terms of these modules. You may copy and distribute the resulting
# combined work under the terms of your choice, provided that every
# copy of the combined work is accompanied by a complete copy of
# the source code of Proview (the version used to produce the
# combined work), being distributed under the terms of the GNU
# General Public License plus this exception.
#
echo "Here in jop start"
#export LD_LIBRARY_PATH=$pwr_exe
#echo $LD_LIBRARY_PATH
#export CLASSPATH=$pwr_lib/pwr_rt.jar:$pwr_lib/pwr_jop.jar
java jpwr.jop.JopSpider $1
#!/bin/bash
# Get systemname from bootfile
zero="0000"
nname=`eval uname -n`
nname=${nname%%.*}
bootfile=$pwrp_load/ld_boot_${nname}_${zero:0:4-${#PWR_BUS_ID}}${PWR_BUS_ID}.dat
if [ ! -e "$bootfile" ]; then
echo "Unable to find bootfile: $bootfile"
return;
fi
let i=0
while read line; do
if [ $i -eq 1 ]; then
systemname=$line
break;
fi
let i=$i+1
done < $bootfile
echo $systemname
export CLASSPATH=$pwr_lib/pwr_rt.jar:$pwr_lib/pwr_jop.jar:$pwr_lib/pwr_jopc.jar:$pwr_lib/pwr_bcomp.jar:$pwr_lib/pwr_bcompfc.jar:$pwr_lib/pwr_abb.jar:$pwrp_lib/pwrp_$systemname.jar
export LD_LIBRARY_PATH=$pwr_exe
$jdk/bin/java jpwr.jop.JopOp
#!/bin/bash
#
# Proview Open Source Process Control.
# Copyright (C) 2005-2011 SSAB Oxelosund AB.
#
# This file is part of Proview.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Proview. If not, see <http://www.gnu.org/licenses/>
#
# Linking Proview statically or dynamically with other modules is
# making a combined work based on Proview. Thus, the terms and
# conditions of the GNU General Public License cover the whole
# combination.
#
# In addition, as a special exception, the copyright holders of
# Proview give you permission to, from the build function in the
# Proview Configurator, combine Proview with modules generated by the
# Proview PLC Editor to a PLC program, regardless of the license
# terms of these modules. You may copy and distribute the resulting
# combined work under the terms of your choice, provided that every
# copy of the combined work is accompanied by a complete copy of
# the source code of Proview (the version used to produce the
# combined work), being distributed under the terms of the GNU
# General Public License plus this exception.
#
#
# pwr_cleanup.sh
#
# NOTE! This file removes all IPC objects for the user.
# If you have other program which creates IPC objects,
# then do not use this script
#
# remove semaphores
eval `ipcs -s|grep ^0x|grep "[ \t]$USER[ \t]"|awk '{printf "ipcrm sem %s;", $2}'`
# remove message queues
eval `ipcs -q|grep ^0x|grep "[ \t]$USER[ \t]"|awk '{printf "ipcrm msg %s;", $2}'`
# remove shared memory
eval `ipcs -m|grep ^0x|grep "[ \t]$USER[ \t]"|awk '{printf "ipcrm shm %s;", $2}'`
rm /tmp/pwr*$PWR_BUS_ID
#!/bin/bash
#
# Proview Open Source Process Control.
# Copyright (C) 2005-2011 SSAB Oxelosund AB.
#
# This file is part of Proview.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Proview. If not, see <http://www.gnu.org/licenses/>
#
# Linking Proview statically or dynamically with other modules is
# making a combined work based on Proview. Thus, the terms and
# conditions of the GNU General Public License cover the whole
# combination.
#
# In addition, as a special exception, the copyright holders of
# Proview give you permission to, from the build function in the
# Proview Configurator, combine Proview with modules generated by the
# Proview PLC Editor to a PLC program, regardless of the license
# terms of these modules. You may copy and distribute the resulting
# combined work under the terms of your choice, provided that every
# copy of the combined work is accompanied by a complete copy of
# the source code of Proview (the version used to produce the
# combined work), being distributed under the terms of the GNU
# General Public License plus this exception.
#
pkg_install_func ()
{
pkg_remove_func "force"
if [ $1 == ${1##*/} ]; then
# Add path
pkg="$HOME/$1"
else
pkg=$1
fi
if [ ! -e "$pkg" ]; then
echo "No package $pkg"
exit 1
fi
echo "-- Installing package $1"
cd /tmp
if ! tar -xzf $pkg pkg_unpack.sh; then
echo "Package $1 incomplete"
exit 1
fi
chmod a+x pkg_unpack.sh
./pkg_unpack.sh $pkg
}
pkg_list_func ()
{
if [ -z $1 ]; then
# List installed package
if [ ! -e $pwrp_load/pwr_pkg.dat ]; then
echo "-- No package installed"
exit 1
fi
datfile=$pwrp_load/pwr_pkg.dat
else
# Extract datfile from package
if [ $1 == ${1##*/} ]; then
# Add path
pkg="$HOME/$1"
else
pkg=$1
fi
if [ ! -e $pkg ]; then
echo "-- No such package"
exit 1
fi
echo "-- Opening file $pkg"
cd /tmp
if ! tar -xzf $pkg pwr_pkg.dat; then
echo "Package $1 incomplete"
exit 1
fi
datfile=/tmp/pwr_pkg.dat
fi
{
let printout=0
while read line; do
if [ "$line" = "%Description:" ]; then
printout=1
else
if [ "$line" = "%Files:" ]; then
break
fi
if [ $printout -eq 1 ]; then
echo $line
fi
fi
done
} < $datfile
}
pkg_listfiles_func ()
{
if [ -z $1 ]; then
# List installed package
if [ ! -e $pwrp_load/pwr_pkg.dat ]; then
echo "-- No package installed"
exit 1
fi
datfile=$pwrp_load/pwr_pkg.dat
else
# Extract datfile from package
if [ $1 == ${1##*/} ]; then
# Add path
pkg="$HOME/$1"
else
pkg=$1
fi
if [ ! -e $pkg ]; then
echo "-- No such package"
exit 1
fi
echo "-- Opening file $pkg"
cd /tmp
if ! tar -xzf $pkg pwr_pkg.dat; then
echo "Package $1 incomplete"
exit 1
fi
datfile=/tmp/pwr_pkg.dat
fi
{
let printout=0
while read line date time; do
if [ "$line" = "%Files:" ]; then
printout=1
else
if [ "$line" = "%End:" ]; then
break
fi
if [ $printout -eq 1 ]; then
echo $date $time $line
fi
fi
done
} < $datfile
}
pkg_brief_func ()
{
if [ -z $1 ]; then
# List installed package
if [ ! -e $pwrp_load/pwr_pkg.dat ]; then
echo "-- No package installed"
exit 1
fi
datfile=$pwrp_load/pwr_pkg.dat
{
let printout=0
while read line; do
if [ "$line" = "%Brief:" ]; then
printout=1
else
if [ "$line" = "%Description:" ]; then
break
fi
if [ $printout -eq 1 ]; then
echo $line
fi
fi
done
} < $datfile
else
# Extract datfile from package
for file
do
if [ $file == ${file##*/} ]; then
# Add path
pkg="$HOME/$file"
else
pkg=$file
fi
if [ ! -e $pkg ]; then
echo "-- No such package"
exit 1
fi
dir=`eval pwd`
cd /tmp
if ! tar -xzf $pkg pwr_pkg.dat; then
echo "Package $pkg incomplete"
else
datfile=/tmp/pwr_pkg.dat
{
let printout=0
while read line; do
if [ "$line" = "%Brief:" ]; then
printout=1
else
if [ "$line" = "%Description:" ]; then
break
fi
if [ $printout -eq 1 ]; then
fname=`eval basename $pkg`
echo $fname ${line#Proview package}
fi
fi
done
} < $datfile
rm $datfile
fi
cd $dir
done
fi
}
pkg_dir_func()
{
if [ -z $1 ]; then
allpkg=`ls $HOME/pwrp_pkg_*.tgz`
else
if [ $1 == ${1##*/} ]; then
# Add path
pattern="$HOME/*$1*"
elif [ ${1:0:1} == "/" ]; then
pattern=$1*
else
pattern=*$1*
fi
allpkg=`ls $pattern`
fi
for pkg in $allpkg ; do
if [ -z ${pkg##*pwrp_pkg_*.tgz} ]; then
pkg_brief_func $pkg
fi
done
}
pkg_dirbrief_func()
{
if [ -z "$1" ]; then
allpkg=`ls $HOME/pwrp_pkg_*.tgz`
else
if [ "$1" == "${1##*/}" ]; then
# Add path
pattern="$HOME/*$1*"
elif [ ${1:0:1} == "/" ]; then
pattern=$1*
else
pattern=*$1*
fi
allpkg=`ls $pattern`
fi
for pkg in $allpkg ; do
if [ -z ${pkg##*pwrp_pkg_*.tgz} ]; then
fname=`eval basename $pkg`
ftime=`eval stat $pkg --print=%z | cut -b -19`
# echo $fname $ftime
echo $fname
fi
done
}
pkg_remove_func ()
{
if [ ! -e $pwrp_load/pwr_pkg.dat ]; then
echo "-- No package installed"
return
fi
# Get the name of the current package
{
let found=0
while read line; do
if [ "$line" = "%Package:" ]; then
found=1
else
if [ $found -eq 1 ]; then
pkg=$line
break
fi
fi
done
} < $pwrp_load/pwr_pkg.dat
if [ ! "$1" = "force" ]; then
echo ""
echo -n "Do you wan't to remove package $pkg (y/n) [n] "
read remove_pkg
if [ ! "$remove_pkg" = "y" ]; then
return
fi
fi
echo "-- Removing package $pkg"
{
let removefile=0
while read line date time; do
if [ "$line" = "%Files:" ]; then
removefile=1
else
if [ "$line" = "%End:" ]; then
break
fi
if [ $removefile -eq 1 ]; then
file=`eval echo $line`
#echo "rm $file"
rm $file
fi
fi
done
} < $pwrp_load/pwr_pkg.dat
rm $pwrp_load/pwr_pkg.dat
}
force="no"
while [ -n "$(echo $1 | grep '-')" ]; do
OPTARG=$2
case $1 in
-i ) pkg_install_func $OPTARG ;;
-la ) pkg_list_func $OPTARG ;;
-lf ) pkg_listfiles_func $OPTARG;;
-lp ) shift
pkg_brief_func $@ ;;
-r ) pkg_remove_func ;;
-rf ) force="force"
pkg_remove_func $force ;;
-ld ) pkg_dir_func $OPTARG ;;
-l ) pkg_dirbrief_func "$OPTARG";;
* ) cat <<EOF
usage: pwr_pkg [-i pkg] [-l [pkg]] [-b [pkg]] [-r]
pwr_pkg -i 'pkg' Install package 'pkg'
pwr_pkg -r Remove currently installed package
pwr_pkg -lp ['pkg'] List installed package, or package 'pkg'
pwr_pkg -la ['pkg'] List installed package, or package 'pkg', all info
pwr_pkg -lf ['pkg'] List files in installed package, or package 'pkg'
pwr_pkg -l List all packages
EOF
exit 1
esac
shift
done
#!/bin/bash
#
# Proview Open Source Process Control.
# Copyright (C) 2005-2011 SSAB Oxelosund AB.
#
# This file is part of Proview.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Proview. If not, see <http://www.gnu.org/licenses/>
#
# Linking Proview statically or dynamically with other modules is
# making a combined work based on Proview. Thus, the terms and
# conditions of the GNU General Public License cover the whole
# combination.
#
# In addition, as a special exception, the copyright holders of
# Proview give you permission to, from the build function in the
# Proview Configurator, combine Proview with modules generated by the
# Proview PLC Editor to a PLC program, regardless of the license
# terms of these modules. You may copy and distribute the resulting
# combined work under the terms of your choice, provided that every
# copy of the combined work is accompanied by a complete copy of
# the source code of Proview (the version used to produce the
# combined work), being distributed under the terms of the GNU
# General Public License plus this exception.
#
kill -9 `ps ax | grep "rt_neth_acp" | awk '{ print $1}'`
kill -9 `ps ax | grep "rt_neth" | awk '{ print $1}'`
kill -9 `ps ax | grep "rt_qmon" | awk '{ print $1}'`
kill -9 `ps ax | grep "rt_emon" | awk '{ print $1}'`
kill -9 `ps ax | grep "rt_tmon" | awk '{ print $1}'`
kill -9 `ps ax | grep "rt_\|/pwr/exe/rs" | awk '{ print $1}'`
kill -9 `ps ax | grep "\[rt_" | awk '{ print $1}'`
kill -9 `ps ax | grep "plc_" | awk '{ print $1}'`
kill -9 `ps ax | grep "jpwr.rt" | awk '{ print $1}'`
kill -9 `ps ax | grep "rs_nmps" | awk '{ print $1}'`
kill -9 `ps ax | grep "rs_remote" | awk '{ print $1}'`
kill -9 `ps ax | grep "sev_server" | awk '{ print $1}'`
kill -9 `ps ax | grep "opc_server" | awk '{ print $1}'`
if [ -u $pwr_exe/rt_ini ]; then
user=`ls -al $pwr_exe/rt_ini | awk '{ print $3}'`
else
user=$USER
fi
echo "User $user"
eval `ipcs -s|grep ^0x|grep "[ \t]$user[ \t]"|awk '{printf "ipcrm sem %s;", $2
}'`
# remove message queues
eval `ipcs -q|grep ^0x|grep "[ \t]$user[ \t]"|awk '{printf "ipcrm msg %s;", $2
}'`
# remove shared memory
eval `ipcs -m|grep ^0x|grep "[ \t]$user[ \t]"|awk '{printf "ipcrm shm %s;", $2
}'`
if [ -e $pwrp_exe/pwrp_stop.sh ]; then
source $pwrp_exe/pwrp_stop.sh
fi
rm /tmp/pwr*$PWR_BUS_ID
#rm -f /tmp/pwr*
#id=`ipcs -s | grep $user | awk '{print $2}'`
#id1=`echo $id | awk '{print $1}'`
#id2=`echo $id | awk '{print $2}'`
#id3=`echo $id | awk '{print $3}'`
#ipcrm sem $id1
#ipcrm sem $id2
#ipcrm sem $id3
#id=`ipcs -q | grep $user | awk '{print $2}'`
#id1=`echo $id | awk '{print $1}'`
#id2=`echo $id | awk '{print $2}'`
#id3=`echo $id | awk '{print $3}'`
#ipcrm msg $id1
#ipcrm msg $id2
#ipcrm msg $id3
This diff is collapsed.
This diff is collapsed.
!** Invisible: Script used by reload.sh to save classvolume versions
!
# Proview Open Source Process Control.
# Copyright (C) 2005-2011 SSAB Oxelosund AB.
#
# This file is part of Proview.
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation, either version 2 of
! the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
# along with Proview. If not, see <http://www.gnu.org/licenses/>
#
# Linking Proview statically or dynamically with other modules is
# making a combined work based on Proview. Thus, the terms and
# conditions of the GNU General Public License cover the whole
# combination.
#
# In addition, as a special exception, the copyright holders of
# Proview give you permission to, from the build function in the
# Proview Configurator, combine Proview with modules generated by the
# Proview PLC Editor to a PLC program, regardless of the license
# terms of these modules. You may copy and distribute the resulting
# combined work under the terms of your choice, provided that every
# copy of the combined work is accompanied by a complete copy of
# the source code of Proview (the version used to produce the
# combined work), being distributed under the terms of the GNU
# General Public License plus this exception.
!
!
main()
string v;
string class;
string attr;
int version;
int sts;
int file;
string fname;
string cmd;
int file_open;
printf("\n");
printf("-- ssab_exe:ssab_reload_vol_versions\n");
printf("-- Script to store current classvolume versions\n\n");
fname = "$pwrp_db/reload_vol_versions_" + p1 + ".pwr_com";
fname = translate_filename( fname);
file_open = 0;
v = GetVolumeList();
while( v != "")
class = GetVolumeClass( v);
if ( class == "$ClassVolume" && v != "pwrs" && v != "pwrb" && v != "mps" && v != "NMps" && v != "TLog" && v != "SSAB" && v != "SA")
if ( !file_open)
file = fopen( fname, "w");
if ( !file)
printf("Unable to open file %s\n", fname);
exit(0);
endif
fprintf( file, "printf(\"\\n\");\n");
fprintf( file, "printf(\"-- %s\\n\");\n", fname);
fprintf( file, "printf(\"-- Script to restore current classvolume versions\\n\\n\");\n");
file_open = 1;
endif
attr = v + ":.RtVersion";
version = GetAttribute( attr, sts);
printf( "-- Store version %d of volume '%s'\n", version, v);
fprintf(file, "printf( \"-- Restore version number %d in volume '%s'\\n\");\n", version, v);
fprintf(file, "set volume/volume=%s\n", v);
fprintf(file, "set attr/name=%s:/attr=RtVersion/value=%d/noconf\n", v, version);
fprintf(file, "save\n");
endif
v = GetNextVolume(v);
endwhile
if ( file_open)
fclose(file);
endif
endmain
!** Invisible: Load a backup dumpfile into development data base.
!
# Proview Open Source Process Control.
# Copyright (C) 2005-2011 SSAB Oxelosund AB.
#
# This file is part of Proview.
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation, either version 2 of
! the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
# along with Proview. If not, see <http://www.gnu.org/licenses/>
#
# Linking Proview statically or dynamically with other modules is
# making a combined work based on Proview. Thus, the terms and
# conditions of the GNU General Public License cover the whole
# combination.
#
# In addition, as a special exception, the copyright holders of
# Proview give you permission to, from the build function in the
# Proview Configurator, combine Proview with modules generated by the
# Proview PLC Editor to a PLC program, regardless of the license
# terms of these modules. You may copy and distribute the resulting
# combined work under the terms of your choice, provided that every
# copy of the combined work is accompanied by a complete copy of
# the source code of Proview (the version used to produce the
# combined work), being distributed under the terms of the GNU
# General Public License plus this exception.
!
function int usage()
printf( "Script to load backup dumpfile into development database.\n\n");
printf( "pwrc -v 'volumename' @pwr_exe:restore_bck 'nodename' 'dumpfile'\n\n");
printf( "Create a dumpfile on an process station with rt_bck -p\n\n");
endfunction
main()
int dump_file;
int alias_file;
string str;
string dbname;
string volname;
int i;
int j;
int first;
int len;
string start;
string objname;
string attrname;
string db_attrname;
string value;
string answer;
int loaddb;
int export_alias;
string alias_filename;
printf("\n");
if (p1 == "" || p2 == "")
usage();
exit(0);
endif
dump_file = fopen(p2, "r");
if (!dump_file)
printf( "Unable to open dumpfile %s\n", p2);
exit();
endif
loaddb = 0;
ask("Do you want to load values from the dumpfile into the database? (Y/N) ", answer);
if (answer == "y" || answer == "Y")
loaddb = 1;
endif
export_alias = 0;
ask("Do you wan to create an alias-file with values from the dumpfile? (Y/N) ", answer);
if (answer == "y" || answer == "Y")
ask("Alias-file name: ", answer);
alias_file = fopen(answer, "w");
if (!alias_file)
printf( "Unable to open output alias file %s\n", answer);
exit();
endif
export_alias = 1;
alias_filename = answer;
endif
while (fgets(str, dump_file))
start = extract(1, 2, str);
i = strstr(start, "/");
if (!i)
i = strstr(str, ".");
j = strstr(str, " ");
first = 1;
len = i-1;
objname = extract(first, len, str);
first = i+1;
len = j-i-1;
attrname = extract(first, len, str);
first = j+1;
len = strlen(str) - j;
value = extract(first, len, str);
db_attrname = attrname;
if (attrname == "ActualValue")
db_attrname = "InitialValue";
endif
if (loaddb)
set attr/attr='db_attrname'/value="'value'"/name='objname'/noconf/log
endif
if (export_alias)
fprintf(alias_file, "%s_setvalp %s.%s = \"%s\"\n", p1, objname, attrname, value);
endif
endif
endwhile
if (dump_file)
fclose(dump_file);
endif
if (alias_file)
printf("Alias-file created, %s\n", alias_filename);
fclose(alias_file);
endif
if (loaddb)
ask("Do you wan to save the database changes? (Y/N) ", answer);
if (answer == "y" || answer == "Y")
printf("Saving changes...\n");
save
else
printf("Not saving any changes\n");
endif
endif
endmain
#!/bin/bash
#
# Proview Open Source Process Control.
# Copyright (C) 2005-2011 SSAB Oxelosund AB.
#
# This file is part of Proview.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Proview. If not, see <http://www.gnu.org/licenses/>
#
# Linking Proview statically or dynamically with other modules is
# making a combined work based on Proview. Thus, the terms and
# conditions of the GNU General Public License cover the whole
# combination.
#
# In addition, as a special exception, the copyright holders of
# Proview give you permission to, from the build function in the
# Proview Configurator, combine Proview with modules generated by the
# Proview PLC Editor to a PLC program, regardless of the license
# terms of these modules. You may copy and distribute the resulting
# combined work under the terms of your choice, provided that every
# copy of the combined work is accompanied by a complete copy of
# the source code of Proview (the version used to produce the
# combined work), being distributed under the terms of the GNU
# General Public License plus this exception.
#
#
FileName="$1"
Color="$2"
Printer="$pwr_rt_print"
ColorPrinter="$pwr_rt_colorprint"
if [ "$Color" == "1" ]; then
if [ -z "$pwr_rt_colorprint" ]; then
Printer=$pwr_rt_print
else
Printer=$pwr_rt_colorprint
fi
else
if [ -z "$pwr_rt_print" ]; then
Printer=$pwr_rt_colorprint
else
Printer=$pwr_rt_print
fi
fi
if [ -z "$Printer" ]; then
echo "Printer is not defined in env 'pwr_rt_print'"
else
echo "Printing $1"
$Printer $1
fi
#!/bin/bash
#
# Proview Open Source Process Control.
# Copyright (C) 2005-2011 SSAB Oxelosund AB.
#
# This file is part of Proview.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Proview. If not, see <http://www.gnu.org/licenses/>
#
# Linking Proview statically or dynamically with other modules is
# making a combined work based on Proview. Thus, the terms and
# conditions of the GNU General Public License cover the whole
# combination.
#
# In addition, as a special exception, the copyright holders of
# Proview give you permission to, from the build function in the
# Proview Configurator, combine Proview with modules generated by the
# Proview PLC Editor to a PLC program, regardless of the license
# terms of these modules. You may copy and distribute the resulting
# combined work under the terms of your choice, provided that every
# copy of the combined work is accompanied by a complete copy of
# the source code of Proview (the version used to produce the
# combined work), being distributed under the terms of the GNU
# General Public License plus this exception.
#
#
export LD_LIBRARY_PATH=$pwr_exe
export CLASSPATH=$pwr_lib/pwr_rt.jar:$pwr_lib/pwr_jop.jar
#$jdk_home/java jpwr.rt.GdhServer
$jdk_home/java -Djava.library.path=$jdk/lib/i386/client:$jdk/lib/i386:$jdk/../lib/i386:$pwr_exe jpwr.rt.GdhServer
#!/bin/bash
#
# Proview Open Source Process Control.
# Copyright (C) 2005-2011 SSAB Oxelosund AB.
#
# This file is part of Proview.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Proview. If not, see <http://www.gnu.org/licenses/>
#
# Linking Proview statically or dynamically with other modules is
# making a combined work based on Proview. Thus, the terms and
# conditions of the GNU General Public License cover the whole
# combination.
#
# In addition, as a special exception, the copyright holders of
# Proview give you permission to, from the build function in the
# Proview Configurator, combine Proview with modules generated by the
# Proview PLC Editor to a PLC program, regardless of the license
# terms of these modules. You may copy and distribute the resulting
# combined work under the terms of your choice, provided that every
# copy of the combined work is accompanied by a complete copy of
# the source code of Proview (the version used to produce the
# combined work), being distributed under the terms of the GNU
# General Public License plus this exception.
#
#
export LD_LIBRARY_PATH=$pwr_exe
export CLASSPATH=$pwr_lib/pwr_rt.jar:$pwr_lib/pwr_jop.jar
#$jdk_home/java jpwr.rt.HistServer
$jdk_home/java -Djava.library.path=$jdk/lib/i386/client:$jdk/lib/i386:$jdk/../lib/i386:$pwr_exe jpwr.rt.HistServer
#!/bin/bash
#
# Proview Open Source Process Control.
# Copyright (C) 2005-2011 SSAB Oxelosund AB.
#
# This file is part of Proview.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Proview. If not, see <http://www.gnu.org/licenses/>
#
# Linking Proview statically or dynamically with other modules is
# making a combined work based on Proview. Thus, the terms and
# conditions of the GNU General Public License cover the whole
# combination.
#
# In addition, as a special exception, the copyright holders of
# Proview give you permission to, from the build function in the
# Proview Configurator, combine Proview with modules generated by the
# Proview PLC Editor to a PLC program, regardless of the license
# terms of these modules. You may copy and distribute the resulting
# combined work under the terms of your choice, provided that every
# copy of the combined work is accompanied by a complete copy of
# the source code of Proview (the version used to produce the
# combined work), being distributed under the terms of the GNU
# General Public License plus this exception.
#
#
export LD_LIBRARY_PATH=$pwr_exe
export CLASSPATH=$pwr_lib/pwr_rt.jar:$pwr_lib/pwr_jop.jar
$jdk_home/java -Djava.library.path=$jdk/lib/i386/client:$jdk/lib/i386:$jdk/../lib/i386:$pwr_exe jpwr.rt.MhServer
!** Invisible: Include file for io configuration script
!
# Proview Open Source Process Control.
# Copyright (C) 2005-2011 SSAB Oxelosund AB.
#
# This file is part of Proview.
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation, either version 2 of
! the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
# along with Proview. If not, see <http://www.gnu.org/licenses/>
#
# Linking Proview statically or dynamically with other modules is
# making a combined work based on Proview. Thus, the terms and
# conditions of the GNU General Public License cover the whole
# combination.
#
# In addition, as a special exception, the copyright holders of
# Proview give you permission to, from the build function in the
# Proview Configurator, combine Proview with modules generated by the
# Proview PLC Editor to a PLC program, regardless of the license
# terms of these modules. You may copy and distribute the resulting
# combined work under the terms of your choice, provided that every
# copy of the combined work is accompanied by a complete copy of
# the source code of Proview (the version used to produce the
# combined work), being distributed under the terms of the GNU
# General Public License plus this exception.
!
!
! Create a signal.
! If the card of the signal does not exist, the card with channels, and signals
! positioned in the reservhierarchy, will be created, and signals and channels
! will be connected.
! If the card already exist the signal will be move from the reservhierarchy
! to the given destination
!
function int ssab_create_signal( string rname, string resname, string chname, string signame, string chan_descr, string chan_ident, string sig_descr)
string cname;
string cardclass;
string type;
int channels;
int i;
int j;
string newname;
string oldname;
string rnam;
string chnam;
string cnam;
string hnam;
string snam;
string chnr_str;
string tnam;
int sts;
! Check if card exist
cname = extract( 1, 4, chname);
chname = toupper( chname);
type = extract( 1, 2, chname);
chnr_str = extract( 5, 2, chname);
cnam=rname + "-" + cname;
if ( type == "DI")
cardclass = "Ssab_DI32D";
channels = 32;
endif
if ( type == "DO")
cardclass = "Ssab_DO32DKS";
channels = 32;
endif
if ( type == "AI")
cardclass = "Ssab_AI32uP";
channels = 32;
endif
if ( type == "AO")
cardclass = "Ssab_AO8uP";
channels = 8;
endif
if ( type == "CO")
cardclass = "Ssab_Co4uP";
channels = 4;
endif
if (!ObjectExist(cnam))
! Create the rack and reservhierarchy if not created
ssab_create_object( rname, "Rack_SSAB");
ssab_create_object( resname, "$PlantHier");
! The card didn't exist, create it
! Create the card
create object/dest="'rname'"/class='cardclass'/name="'cname'"
! Create signalobjects in reserv hierarchy
for ( i = 1; i < channels + 1; i++)
sprintf( rnam, "Reserv_%s%02.2d", cname, i);
sprintf( hnam, "%s-%s", resname, rnam);
if (!ObjectExist(hnam))
create object/dest='resname'/class='type'/name="'rnam'"
sprintf( chnam, "Ch%02.2d", i);
! Connect to channel
set attr/noco/name='hnam'/attr=SigChanCon/value='rname'-'cname'.'chnam'
endif
endfor
endif
! Set description in signal
sprintf( rnam, "Reserv_%s%s", cname, chnr_str);
set attr/noco/name='resname'-'rnam'/attr=Description/value="'sig_descr'"
! Move signal to the final destination
i = strrchr( signame, "-");
if ( i)
i++;
j = i - 2;
hnam = extract( 1, j, signame);
snam = extract( i, 80, signame);
endif
ssab_create_object( hnam, "$PlantHier");
move obj/source='resname'-'rnam'/dest='hnam'/rename="'snam'"
endfunction
!
! Create an object and it's ancestors if they doesn't exist
!
function int ssab_create_object( string name, string class)
int i;
int j;
string parent;
string object;
int sts;
i = strrchr( name, "-");
if ( i)
i++;
j = i - 2;
parent = extract( 1, j, name);
object = extract( i, 80, name);
else
object = name;
parent = "";
endif
if ( !ObjectExist( name))
if ( parent != "")
ssab_create_object( parent, class);
endif
create object/dest="'parent'"/class='class'/name="'object'"
endif
endfunction
This diff is collapsed.
This diff is collapsed.
#!/bin/bash
#
# Proview Open Source Process Control.
# Copyright (C) 2005-2011 SSAB Oxelosund AB.
#
# This file is part of Proview.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Proview. If not, see <http://www.gnu.org/licenses/>
#
# Linking Proview statically or dynamically with other modules is
# making a combined work based on Proview. Thus, the terms and
# conditions of the GNU General Public License cover the whole
# combination.
#
# In addition, as a special exception, the copyright holders of
# Proview give you permission to, from the build function in the
# Proview Configurator, combine Proview with modules generated by the
# Proview PLC Editor to a PLC program, regardless of the license
# terms of these modules. You may copy and distribute the resulting
# combined work under the terms of your choice, provided that every
# copy of the combined work is accompanied by a complete copy of
# the source code of Proview (the version used to produce the
# combined work), being distributed under the terms of the GNU
# General Public License plus this exception.
#
sed '
/\"$/{
N
h
s/\"\n.*Attr Parameter = \"/\./
}
s/Attr object_did = /Attr oid = /
s/Attr window_did = /Attr woid = /
s/Attr subwind_objdid/Attr subwind_oid/
s/Attr parent_node_did = /Attr poid = /
s/Attr dest_node_did = /Attr dest_oid = /
s/Attr source_node_did = /Attr source_oid = /
s/Attr reset_objdid = /Attr reset_oid = /
s/pwrb:Class-Ai_AI32uP/SsabOx:Class-Ai_AI32uP/
s/pwrb:Class-Ai_HVAI32/SsabOx:Class-Ai_HVAI32/
s/pwrb:Class-Ao_AO8uP/SsabOx:Class-Ao_AO8uP/
s/pwrb:Class-Ao_HVAO4/SsabOx:Class-Ao_HVAO4/
s/pwrb:Class-Co_CO4uP/SsabOx:Class-Co_CO4uP/
s/pwrb:Class-Co_PI24BO/SsabOx:Class-Co_PI24BO/
s/pwrb:Class-Di_DIX2/SsabOx:Class-Di_DIX2/
s/pwrb:Class-Do_HVDO32/SsabOx:Class-Do_HVDO32/
s/NMps:Class-RemTransSend/Remote:Class-RemTransSend/
s/NMps:Class-RemTransRcv/Remote:Class-RemTransRcv/
/PlcProgram$/{
N
N
h
s/Attr objdid = /Attr oid =/
s/Attr classid = /Attr cid =/
}
/PlcWindow$/{
N
N
h
s/Attr objdid = /Attr oid =/
s/Attr classid = /Attr cid =/
}
/PlcNode$/{
N
N
h
s/Attr classid = /Attr cid =/
}
/PlcConnection$/{
N
N
N
h
s/Attr objdid = /Attr oid =/
s/Attr classid = /Attr cid =/
}
' $1 > $2
BEGIN {
innum = 0;
inbody = 0;
innumaggr = 0;
inbodyaggr = 0;
pos = 0;
par = "";
}
{
if ( $3 == "BaseFcPPO5PbModule" || $3 == "BaseFcPPO3PbModule" ||
$3 == "ABB_ACS_PPO5" || $3 == "ABB_ACC_PPO5") {
innum = 1;
inbody = 0;
}
else if ( $3 == "BaseFcPPO5FanAggr" || $3 == "BaseFcPPO3FanAggr" ||
$3 == "BaseFcPPO5PumpAggr" || $3 == "BaseFcPPO3PumpAggr" ||
$3 == "BaseFcPPO5MotorAggr" || $3 == "BaseFcPPO3MotorAggr" ||
$3 == "BaseFcPPO5" || $3 == "BaseFcPPO3" ||
$3 == "ABB_ACS800_1" || $3 == "ABB_ACC800" ||
$3 == "ABB_ACS800MotorAggr" || $3 == "ABB_ACS800PumpAggr" ||
$3 == "ABB_ACS800FanAggr" || $3 == "ABB_Converter_ACS800_PPO3" ||
$3 == "ABB_Converter_ACS800_PPO5") {
innumaggr = 1;
inbodyaggr = 0;
}
if ( innum) {
if ( $1 == "Body" && $2 == "RtBody") {
inbody = 1;
}
if ( inbody) {
if ( $1 == "EndBody") {
printf( "%s\n", $0);
innum = 0;
}
else if ( $1 == "EndObject") {
innum = 0;
printf( "%s\n", $0);
}
else if ( $1 == "Attr") {
pos = index($2, ".");
if ( pos != 0) {
a1 = substr( $2, 1, pos - 1);
a2 = substr( $2, pos + 1, length($2) - pos + 1);
if ( substr( a1, 1, 2) == "I_" || substr( a1, 1, 2) == "O_") {
# printf( "Attr Io.%s.%s = %s\n", a1, a2, $4);
$2 = "Io." $2;
printf( " %s\n", $0);
}
else {
printf( "%s\n", $0);
}
}
else {
printf( "%s\n", $0);
}
}
else {
printf( "%s\n", $0);
}
}
else {
printf( "%s\n", $0);
}
}
else if ( innumaggr) {
if ( $1 == "Body" && $2 == "RtBody") {
inbodyaggr = 1;
}
if ( inbodyaggr) {
if ( $1 == "EndBody") {
printf( "%s\n", $0);
innumaggr = 0;
}
else if ( $1 == "EndObject") {
innumaggr = 0;
printf( "%s\n", $0);
}
else if ( $1 == "Attr") {
pos = index($4, "PbModule.I_");
if ( pos == 0)
pos = index($4, "PbModule.O_");
if ( pos != 0) {
a1 = substr( $4, 1, pos - 1);
a2 = substr( $4, pos + 2, length($4) - pos - 1);
# printf( "Attr %sIo%s = %s\n", a1, a2, $4);
$4 = a1 "Io" a2;
printf( " %s\n", $0);
}
else {
pos = index($2, "IoConnect");
if ( pos != 0) {
a2 = substr( $4, 0, length($4) - 1);
$4 = a2 ".Io\"";
printf( " %s\n", $0);
}
else {
printf( "%s\n", $0);
}
}
}
else {
printf( "%s\n", $0);
}
}
else {
printf( "%s\n", $0);
}
}
else {
printf( "%s\n", $0);
}
}
This diff is collapsed.
#!/bin/bash
#
# Proview Open Source Process Control.
# Copyright (C) 2005-2011 SSAB Oxelosund AB.
#
# This file is part of Proview.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Proview. If not, see <http://www.gnu.org/licenses/>
#
# Linking Proview statically or dynamically with other modules is
# making a combined work based on Proview. Thus, the terms and
# conditions of the GNU General Public License cover the whole
# combination.
#
# In addition, as a special exception, the copyright holders of
# Proview give you permission to, from the build function in the
# Proview Configurator, combine Proview with modules generated by the
# Proview PLC Editor to a PLC program, regardless of the license
# terms of these modules. You may copy and distribute the resulting
# combined work under the terms of your choice, provided that every
# copy of the combined work is accompanied by a complete copy of
# the source code of Proview (the version used to produce the
# combined work), being distributed under the terms of the GNU
# General Public License plus this exception.
#
#
# Link rtt application
#
#
name=$1
action=$2
is_rttsys=$3
opsys=$4
menuname=dtt_appl_${name}_m
applname=ra_rtt_${name}
exename=ra_rtt_${name}
arname=ra_rtt_${name}.a
arname_pict=ra_rtt_${name}_pict.a
if [ $is_rttsys = "0" ]
then
# echo "Not rttsys"
if [ $action = "1" ]
then
# echo "Link"
if [ ! -e $pwrp_lib/${arname} ]
then
# echo "Creating archive $arname"
ar rc $pwrp_lib/${arname}
fi
if [ ! -e $pwrp_lib/${arname_pict} ]
then
# echo "Creating archive $arname_pict"
ar rc $pwrp_lib/${arname_pict}
fi
#link option file exists and is not empty
if [ -s $pwrp_exe/ra_rtt.opt ]; then
ld_opt_tmp="`cat $pwrp_exe/ra_rtt.opt`"
ld_opt="`eval echo $ld_opt_tmp`"
else
ld_opt=""
fi
cc=gcc
cinc="-I$pwr_inc -I$pwrp_rttbld -I-"
cflags="-DOS_CYGWIN=1 -DOS_POSIX=1 -DOS=linux -DHW_X86=1 -DHW=x86 -O3 -DGNU_SOURCE -DPWR_NDEBUG -D_REENTRANT"
${cc} -c -o $pwrp_obj/${menuname}.o \
$pwrp_rttbld/${menuname}.c \
${cinc} ${cflags}
ld=g++
linkflags="-g -L/lib/thread -L$pwrp_lib -L$pwr_lib"
${ld} ${linkflags} -o $pwrp_exe/${exename} $pwrp_obj/${menuname}.o \
$pwr_obj/dtt_rttsys.o $pwr_obj/rt_io_user.o \
$pwrp_lib/${arname_pict} $pwrp_lib/${arname} \
$ld_opt \
-lpwr_dtt\
-lpwr_rt -lpwr_co -lpwr_flow -lpwr_msg_dummy -lrpcsvc -lpthread -lm -lrt -lcrypt
fi
if [ $action = "2" ]
then
# echo "Compile"
cc=gcc
cinc="-I$pwr_inc -I$pwrp_rttbld -I$pwrp_inc -I$pwrp_cmn/common/inc -I-"
cflags="-DOS_CYGWIN=1 -DOS=linux -DHW_X86=1 -DHW=x86 -O3 -DGNU_SOURCE -DPWR_NDEBUG -D_REENTRANT"
${cc} -c -o $pwrp_obj/${applname}.o \
$pwrp_rtt/${applname}.c \
${cinc} ${cflags}
ar rc $pwrp_lib/${arname} $pwrp_obj/${applname}.o
fi
fi
This diff is collapsed.
......@@ -102,7 +102,7 @@ then
# echo "Compile"
cc=gcc
cinc="-I$pwr_inc -I$pwrp_rttbld -I$pwrp_inc -I$pwrp_cmn/common/inc -I-"
cflags="-DOS_FREEBSD=1 -DOS=freebsd -DHW_X86_64=1 -DHW=x86_64 -O3 -DGNU_SOURCE -DPWR_NDEBUG -D_REENTRANT"
cflags="-DOS_FREEBSD=1 -DOS_POSIX -DOS=freebsd -DHW_X86_64=1 -DHW=x86_64 -O3 -DGNU_SOURCE -DPWR_NDEBUG -D_REENTRANT"
${cc} -c -o $pwrp_obj/${applname}.o \
$pwrp_rtt/${applname}.c \
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -42,6 +42,7 @@
needed to use CDH. */
#include <limits.h>
#include <stdlib.h>
#ifndef pwr_h
#include "pwr.h"
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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