Commit de8ab792 authored by Claes Sjofors's avatar Claes Sjofors

Powerlink implemented

parent fa6c56ad
include $(pwre_dir_symbols)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
ifndef link_rule_mk
link_rule_mk := 1
link = $(ldxx) $(explinkflags) $(domap) -o $(export_exe) \
$(export_obj) $(pwr_eobj)/rt_io_user.o \
$(pwre_conf_libdir) $(pwre_conf_libpwrrt) $(pwre_conf_lib) \
-lpwr_usbio_dummy -lpwr_usb_dummy -lpwr_cifx_dummy -lpwr_nodave_dummy \
$(pwre_conf_libpwrprofibus) $(pwre_conf_libpwrpowerlink) -lpcap
endif
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA 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.
**/
#include "pwr.h"
#include "rt_io_msg.h"
#include "rt_pwr_msg.h"
#include "rt_gdh.h"
#include "rt_io_base.h"
#include "rt_errh.h"
#include "rt_aproc.h"
#include "pwr_basecomponentclasses.h"
#include "pwr_otherioclasses.h"
pwr_tStatus io_get_plhandler_object (
pwr_sClass_EplHandler **o,
pwr_tObjid *roid
)
{
pwr_tStatus sts;
pwr_tObjid oid;
// Get EplHandler object
sts = gdh_GetClassList(pwr_cClass_EplHandler, &oid);
if (EVEN(sts)) return sts;
sts = gdh_ObjidToPointer( oid, (void *) o);
if (EVEN(sts)) return sts;
if (roid != NULL)
*roid = oid;
return IO__SUCCESS;
}
int main()
{
pwr_tStatus sts;
io_tCtx io_ctx;
float ctime = 1;
pwr_sClass_EplHandler *plhp;
pwr_tOid oid;
struct timespec tim1, tim2;
// Make connection to error handler
errh_Init("pwr_powerlink", errh_eAnix_powerlink);
errh_SetStatus( PWR__SRVSTARTUP);
// Make connection to realtime database
sts = gdh_Init("rt_powerlink");
if (EVEN(sts)) {
errh_Fatal("rt_powerlink aborted, gdh_Init failed\n%m", sts);
errh_SetStatus( PWR__SRVTERM);
exit(sts);
}
// Get Powerlink handler object
sts = io_get_plhandler_object(&plhp, &oid);
if (EVEN(sts)) {
errh_SetStatus( 0);
errh_Info("rt_powerlink terminated, no EplHandler object found");
exit(sts);
}
// Create context and call init functions of all agent,
// rack and cardobjects
sts = io_init(io_mProcess_Powerlink, pwr_cNObjid, &io_ctx, 1, ctime);
if ( EVEN(sts)) {
errh_SetStatus( PWR__SRVTERM);
errh_Fatal("rt_powerlink aborted, io_init() failed\n%m", sts);
exit(sts);
}
tim1.tv_sec = 0;
tim1.tv_nsec = (plhp->CycleTime)*1000000000L;
aproc_TimeStamp( plhp->CycleTime, 5.0);
errh_SetStatus( PWR__SRUN);
aproc_RegisterObject( oid);
// Call IoAgentRead() IoAgentWrite() IoCardRead() IoCardWrite()
// IoModuleRead() IoModuleWrite() forever
for (;;) {
sts = io_read(io_ctx);
sts = io_write(io_ctx);
nanosleep(&tim1, &tim2);
aproc_TimeStamp( plhp->CycleTime, 5.0);
}
}
/*
Dummy for libpowerlink.a
*/
#include <stdint.h>
typedef void *tEplKernel;
typedef int tEplObdSize;
typedef void *tEplApiInitParam;
typedef void *tEplNmtEvent;
typedef void *tEplEventSource;
typedef void *tEplApiProcessImageCopyJob;
typedef void *EplObdInitParam;
#define EPLDLLEXPORT
#define PUBLIC
#define MEM
#define WORD int
#define BOOL int
tEplKernel PUBLIC EplTgtInit(void) {return 0;}
EPLDLLEXPORT tEplKernel PUBLIC EplApiInitialize(tEplApiInitParam* pInitParam_p) {return 0;}
EPLDLLEXPORT tEplKernel PUBLIC EplApiSetCdcFilename(char* pszCdcFilename_p) {return 0;}
EPLDLLEXPORT tEplKernel PUBLIC EplApiProcessImageAlloc(
unsigned int uiSizeProcessImageIn_p,
unsigned int uiSizeProcessImageOut_p,
unsigned int uiQueueEntriesLo_p,
unsigned int uiQueueEntriesHi_p) {return 0;}
EPLDLLEXPORT tEplKernel PUBLIC EplApiExecNmtCommand(tEplNmtEvent NmtEvent_p) {return 0;}
EPLDLLEXPORT char * PUBLIC EplGetNmtEventStr(tEplNmtEvent nmtEvent_p) {return 0;}
EPLDLLEXPORT tEplKernel PUBLIC EplApiWriteLocalObject(
unsigned int uiIndex_p,
unsigned int uiSubindex_p,
void* pSrcData_p,
unsigned int uiSize_p) {return 0;}
EPLDLLEXPORT tEplKernel PUBLIC EplApiReadLocalObject(
unsigned int uiIndex_p,
unsigned int uiSubindex_p,
void* pDstData_p,
unsigned int* puiSize_p) {return 0;}
EPLDLLEXPORT char * PUBLIC EplGetEplKernelStr( tEplKernel EplKernel_p ) {return 0;}
EPLDLLEXPORT char * PUBLIC EplGetEventSourceStr(tEplEventSource eventSrc_p) {return 0;}
EPLDLLEXPORT const char * PUBLIC EplGetEmergErrCodeStr( WORD EmergErrCode_p ) {return 0;}
EPLDLLEXPORT tEplKernel PUBLIC EplApiProcessImageFree(void) {return 0;}
EPLDLLEXPORT tEplKernel PUBLIC EplApiShutdown(void) {return 0;}
EPLDLLEXPORT tEplKernel PUBLIC EplApiProcessImageLinkObject(
unsigned int uiObjIndex_p,
unsigned int uiFirstSubindex_p,
unsigned int uiOffsetPI_p,
BOOL fOutputPI_p,
tEplObdSize EntrySize_p,
unsigned int* puiVarEntries_p) {return 0;}
EPLDLLEXPORT tEplKernel PUBLIC EplApiProcessImageExchange(
tEplApiProcessImageCopyJob* pCopyJob_p) {return 0;}
tEplKernel PUBLIC EplObdInitRam (EplObdInitParam MEM * pInitParam_p) {return 0;}
include $(pwre_dir_symbols)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
#if defined PWRE_CONF_EPL
#include "Epl.h"
//---------------------------------------------------------------------------
// const defines
//---------------------------------------------------------------------------
#define EPLAPI_PI_SUBINDEX_COUNT 252
//---------------------------------------------------------------------------
// local types
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
// modul globale vars
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
// local function prototypes
//---------------------------------------------------------------------------
/***************************************************************************/
/* */
/* */
/* C L A S S EplApi */
/* */
/* */
/***************************************************************************/
//
// Description:
//
//
/***************************************************************************/
//=========================================================================//
// //
// P R I V A T E D E F I N I T I O N S //
// //
//=========================================================================//
//---------------------------------------------------------------------------
// const defines
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
// local types
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
// local vars
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
// local function prototypes
//---------------------------------------------------------------------------
static tEplKernel EplApiProcessImageLinkRange(
unsigned int uiObjIndexStart_p,
unsigned int uiObjIndexEnd_p,
unsigned int uiOffsetPI_p,
BOOL fOutputPI_p,
tEplObdSize EntrySize_p,
unsigned int uiSubindexCountPerIndex_p);
//=========================================================================//
// //
// P U B L I C F U N C T I O N S //
// //
//=========================================================================//
//---------------------------------------------------------------------------
//
// Function: EplApiProcessImageSetup()
//
// Description: sets up static process image
//
// Parameters: (none)
//
// Returns: tEplKernel = error code
//
//
// State:
//
//---------------------------------------------------------------------------
tEplKernel PUBLIC EplApiProcessImageSetup(void)
{
tEplKernel Ret = kEplSuccessful;
Ret = EplApiProcessImageLinkRange(0xA000, 0xA00F, 0, FALSE, 1, EPLAPI_PI_SUBINDEX_COUNT);
if (Ret != kEplSuccessful)
{
goto Exit;
}
Ret = EplApiProcessImageLinkRange(0xA040, 0xA04F, 0, FALSE, 1, EPLAPI_PI_SUBINDEX_COUNT);
if (Ret != kEplSuccessful)
{
goto Exit;
}
Ret = EplApiProcessImageLinkRange(0xA0C0, 0xA0C7, 0, FALSE, 2, EPLAPI_PI_SUBINDEX_COUNT);
if (Ret != kEplSuccessful)
{
goto Exit;
}
Ret = EplApiProcessImageLinkRange(0xA100, 0xA107, 0, FALSE, 2, EPLAPI_PI_SUBINDEX_COUNT);
if (Ret != kEplSuccessful)
{
goto Exit;
}
Ret = EplApiProcessImageLinkRange(0xA1C0, 0xA1C3, 0, FALSE, 4, EPLAPI_PI_SUBINDEX_COUNT);
if (Ret != kEplSuccessful)
{
goto Exit;
}
Ret = EplApiProcessImageLinkRange(0xA200, 0xA203, 0, FALSE, 4, EPLAPI_PI_SUBINDEX_COUNT);
if (Ret != kEplSuccessful)
{
goto Exit;
}
Ret = EplApiProcessImageLinkRange(0xA480, 0xA48F, 0, TRUE, 1, EPLAPI_PI_SUBINDEX_COUNT);
if (Ret != kEplSuccessful)
{
goto Exit;
}
Ret = EplApiProcessImageLinkRange(0xA4C0, 0xA4CF, 0, TRUE, 1, EPLAPI_PI_SUBINDEX_COUNT);
if (Ret != kEplSuccessful)
{
goto Exit;
}
Ret = EplApiProcessImageLinkRange(0xA540, 0xA547, 0, TRUE, 2, EPLAPI_PI_SUBINDEX_COUNT);
if (Ret != kEplSuccessful)
{
goto Exit;
}
Ret = EplApiProcessImageLinkRange(0xA580, 0xA587, 0, TRUE, 2, EPLAPI_PI_SUBINDEX_COUNT);
if (Ret != kEplSuccessful)
{
goto Exit;
}
Ret = EplApiProcessImageLinkRange(0xA640, 0xA643, 0, TRUE, 4, EPLAPI_PI_SUBINDEX_COUNT);
if (Ret != kEplSuccessful)
{
goto Exit;
}
Ret = EplApiProcessImageLinkRange(0xA680, 0xA683, 0, TRUE, 4, EPLAPI_PI_SUBINDEX_COUNT);
if (Ret != kEplSuccessful)
{
goto Exit;
}
Exit:
return Ret;
}
//=========================================================================//
// //
// P R I V A T E F U N C T I O N S //
// //
//=========================================================================//
//---------------------------------------------------------------------------
//
// Function: EplApiProcessImageSetup()
//
// Description: sets up static process image
//
// Parameters: (none)
//
// Returns: tEplKernel = error code
//
//
// State:
//
//---------------------------------------------------------------------------
static tEplKernel EplApiProcessImageLinkRange(
unsigned int uiObjIndexStart_p,
unsigned int uiObjIndexEnd_p,
unsigned int uiOffsetPI_p,
BOOL fOutputPI_p,
tEplObdSize EntrySize_p,
unsigned int uiSubindexCountPerIndex_p)
{
tEplKernel Ret = kEplSuccessful;
unsigned int uiVarEntries;
for (; uiObjIndexStart_p <= uiObjIndexEnd_p;
uiObjIndexStart_p++, uiOffsetPI_p += EntrySize_p * uiSubindexCountPerIndex_p)
{
uiVarEntries = uiSubindexCountPerIndex_p;
Ret = EplApiProcessImageLinkObject(
uiObjIndexStart_p,
1,
uiOffsetPI_p,
fOutputPI_p,
EntrySize_p,
&uiVarEntries);
if (((Ret == kEplSuccessful) && (uiVarEntries < uiSubindexCountPerIndex_p))
|| (Ret == kEplApiPISizeExceeded))
{
Ret = kEplSuccessful;
break;
}
if (Ret != kEplSuccessful)
{
TRACE("EplApiProcessImageLinkObject returned: %xh for index %xh\n", Ret, uiObjIndexStart_p);
goto Exit;
}
}
Exit:
return Ret;
}
#endif
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA 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.
**/
#ifndef rt_io_m_epl_h
#define rt_io_m_epl_h
typedef struct {
int input_area_size;
int output_area_size;
void *input_area;
void *output_area;
void *tmp_area;
struct timespec tpe, tps;
short inputResetEnabled;
} io_sLocalEpl_MN;
typedef struct {
int byte_ordering;
int float_representation;
struct timespec tpe, tps;
} io_sLocalEpl_CN;
#endif
This diff is collapsed.
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA 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.
**/
#include "pwr.h"
#include "pwr_basecomponentclasses.h"
#include "rt_io_base.h"
#include "rt_io_card_init.h"
#include "rt_io_card_close.h"
#include "rt_io_card_read.h"
#include "rt_io_card_write.h"
#include "rt_io_msg.h"
#include "pwr_otherioclasses.h"
/*----------------------------------------------------------------------------*\
Init method for the Powerlink module
\*----------------------------------------------------------------------------*/
static pwr_tStatus IoCardInit (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
return IO__SUCCESS;
}
/*----------------------------------------------------------------------------*\
Read method for the Powerlink module
\*----------------------------------------------------------------------------*/
static pwr_tStatus IoCardRead (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
return IO__SUCCESS;
}
/*----------------------------------------------------------------------------*\
Write method for the Powerlink module
\*----------------------------------------------------------------------------*/
static pwr_tStatus IoCardWrite (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
return IO__SUCCESS;
}
/*----------------------------------------------------------------------------*\
Close method for the Powerlink module
\*----------------------------------------------------------------------------*/
static pwr_tStatus IoCardClose (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
return IO__SUCCESS;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindIoMethods(Epl_Module) = {
pwr_BindIoMethod(IoCardInit),
pwr_BindIoMethod(IoCardRead),
pwr_BindIoMethod(IoCardWrite),
pwr_BindIoMethod(IoCardClose),
pwr_NullMethod
};
......@@ -233,7 +233,8 @@ static pwr_tStatus IoAgentInit( io_tCtx ctx,
}
io_bus_card_init( ctx, cp, &input_area_offset, &input_area_chansize,
&output_area_offset, &output_area_chansize, byte_ordering);
&output_area_offset, &output_area_chansize, byte_ordering,
io_eAlignment_Packed);
// Show module offset and size
if ( cp->Class == pwr_cClass_Hilscher_cifX_Module && cp->op) {
......
......@@ -131,7 +131,7 @@ static pwr_tStatus IoRackInit (
io_bus_card_init( ctx, cardp, &input_area_offset, &input_area_chansize,
&output_area_offset, &output_area_chansize,
pwr_eByteOrderingEnum_BigEndian);
pwr_eByteOrderingEnum_BigEndian, io_eAlignment_Packed);
/* Count number of di and do */
for (i = 0; i < cardp->ChanListSize; i++) {
......
......@@ -890,7 +890,7 @@ static pwr_tStatus mb_init_channels( io_tCtx ctx, io_sAgent *ap, io_sRack *rp)
io_bus_card_init( ctx, cardp, &input_area_offset, &input_area_chansize,
&output_area_offset, &output_area_chansize,
pwr_eByteOrderingEnum_BigEndian);
pwr_eByteOrderingEnum_BigEndian, io_eAlignment_Packed);
for (i = 0; i < cardp->ChanListSize; i++) {
chanp = &cardp->chanlist[i];
......
......@@ -717,7 +717,7 @@ static pwr_tStatus IoRackInit (
io_bus_card_init( ctx, cardp, &input_area_offset, &input_area_chansize,
&output_area_offset, &output_area_chansize,
pwr_eByteOrderingEnum_BigEndian);
pwr_eByteOrderingEnum_BigEndian, io_eAlignment_Packed);
/* Count number of di and do */
for (i = 0; i < cardp->ChanListSize; i++) {
......@@ -769,7 +769,7 @@ static pwr_tStatus IoRackInit (
io_bus_card_init( ctx, cardp, &input_area_offset, &input_area_chansize,
&output_area_offset, &output_area_chansize,
pwr_eByteOrderingEnum_BigEndian);
pwr_eByteOrderingEnum_BigEndian, io_eAlignment_Packed);
/* Count number of di and do */
for (i = 0; i < cardp->ChanListSize; i++) {
......
......@@ -246,7 +246,7 @@ static pwr_tStatus IoRackInit (
io_bus_card_init( ctx, cardp, &input_area_offset, &input_area_chansize,
&output_area_offset, &output_area_chansize,
op->ByteOrdering);
op->ByteOrdering, io_eAlignment_Packed);
break;
}
}
......@@ -293,7 +293,7 @@ static pwr_tStatus IoRackInit (
io_bus_card_init( ctx, cardp, &input_area_offset, &input_area_chansize,
&output_area_offset, &output_area_chansize,
op->ByteOrdering);
op->ByteOrdering, io_eAlignment_Packed);
local_card->input_size = input_area_offset + input_area_chansize -
prev_input_area_offset;
......
......@@ -167,7 +167,8 @@ static pwr_tStatus IoCardInit( io_tCtx ctx,
local->byte_ordering = op->ByteOrdering;
io_bus_card_init( ctx, cp, &input_area_offset, &input_area_chansize,
&output_area_offset, &output_area_chansize, local->byte_ordering);
&output_area_offset, &output_area_chansize, local->byte_ordering,
io_eAlignment_Packed);
local->input_area_size = input_area_offset + input_area_chansize;
local->output_area_size = output_area_offset + output_area_chansize;
......
......@@ -310,7 +310,8 @@ static pwr_tStatus IoCardInit( io_tCtx ctx,
local->byte_ordering = op->ByteOrdering;
io_bus_card_init( ctx, cp, &input_area_offset, &input_area_chansize,
&output_area_offset, &output_area_chansize, local->byte_ordering);
&output_area_offset, &output_area_chansize, local->byte_ordering,
io_eAlignment_Packed);
local->input_area_size = input_area_offset + input_area_chansize;
local->output_area_size = output_area_offset + output_area_chansize;
......
......@@ -28,4 +28,6 @@ UDP_IO
SPI_Slave
Nodave_PLC
Nodave_Transaction
Epl_MN
Epl_Module
#endif
\ No newline at end of file
include $(pwre_dir_symbols)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA 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.
**/
/* wb_c_epl_mn.c -- work bench methods of the Epl_MN class. */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "pwr_basecomponentclasses.h"
#include "pwr_otherioclasses.h"
#include "wb_pwrs.h"
#include "wb_ldh_msg.h"
#include "wb_ldh.h"
#include "wb_pwrb_msg.h"
#include "wb_wnav.h"
#include "wb_wsx.h"
using namespace std;
static pwr_tStatus Configure (
ldh_sMenuCall *ip
)
{
pwr_tCmd cmd = "openCONFIGURATOR";
system( cmd);
return 1;
}
static pwr_tStatus ConfigureFilter (
ldh_sMenuCall *ip
)
{
return 1;
}
//
// Syntax check.
//
#if 0
static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session,
pwr_tAttrRef Object, /* current object */
int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */
) {
return wsx_CheckIoDevice( Session, Object, ErrorCount, WarningCount, wsx_mCardOption_None);
}
#endif
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindMethods(Epl_MN) = {
pwr_BindMethod(Configure),
pwr_BindMethod(ConfigureFilter),
pwr_NullMethod
};
#if OS_LINUX
Epl_MN
#endif
\ No newline at end of file
include $(pwre_dir_symbols)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
0! DefaultWidth 615
0! DefaultHeight 72
1
100 20
135 20
101 20
102 -37
103 -22
104 3.7377
136 3.7377
105 100
106 -6
107 -4
108 30.1132
109 0.65
110 4.81052
111 2.15
116 0
117 0
118 126
119 113
120 1
121 Claes context
122 0
126 1
127 1
128 0
129 0.3
130 1.5
131 0.8
132 3
133 2
137 4510
138 3
139 2
134
22
2200 0
2201 65
2202 pwr_c_eplhandler
2203 51
2205 0
2204
2206 0
2207
2208
2209 0.25
2210 1.7
2211 31
2212 5.35
2213 4
2214
pwrp_pop:
pwrp_exe:
ssab_exe:
pwr_exe:
2215 0
2246 0
2236 0
2247 0
2216 0
2221 0
2237 0
2238 0
2239 0
2240 0
2241 0
2242 0
2217 0
2218 0
2219 0
2220
2230 0
2231 1
2222
2223 1
2224 0.5
2232 0.5
2225 0.5
2226 700
2227
2228 0
2229 0
2233 1
2234 3
2235 1
2243 0
2248 0
2245 0
2244
99
123
2
3
300 pwr_valuelong
301
2
19
1904
1900 26.6
1901 0
1902 0.7
1903 0
1908 0
1909 41
1910 41
1911 1
1915 0
1913 5
1916 2
1914 0
1918 0
1919 0
1920 0
1917 0
1921 0
1922 4
1923 0
1907 0
1906
1905
5
500 0
501 1
504 1
505 1
502
7
700 0
701 0
99
503
7
700 26.6
701 0.7
99
99
1912
28
2800 1
2801 0
2802 0
2803 0
2804 1
2805 0
2806 0
99
99
29
2907
13
1300 1
1301 304
1306 0
1302 1
1305 1
1303
7
700 1
701 1.35
99
1304 0
1307 0
99
2908
28
2800 1
2801 0
2802 -0.715333
2803 0
2804 1
2805 -0.771778
2806 0
99
2901 2
99
99
302 0
304 0
303
305 0
306
307
308 1024
330 0
321 0
331 0
309 0
313 0
322 0
323 0
324 0
325 0
326 0
327 0
310 0
311 0
312
314
315 1
316 1
317 0
318 0
319 0
320 0
328 0
332 0
99
3
300 pwr_indsquare
301
2
19
1904
1900 0.75
1901 0.15
1902 0.75
1903 0.1
1908 0
1909 293
1910 293
1911 1
1915 0
1913 15
1916 2
1914 0
1918 0
1919 0
1920 0
1917 0
1921 0
1922 4
1923 0
1907 0
1906
1905
5
500 0
501 1
504 1
505 1
502
7
700 0.15
701 0.1
99
503
7
700 0.75
701 0.75
99
99
1912
28
2800 1
2801 0
2802 0
2803 0
2804 1
2805 0
2806 0
99
99
99
302 0
304 0
303
305 0
306
307
308 4
330 0
321 0
331 0
309 29
313 0
322 0
323 0
324 0
325 0
326 0
327 0
310 0
311 0
312
314
315 1
316 1
317 0
318 0
319 0
320 0
328 0
332 0
99
3
300 pwr_valuesmall
301
2
19
1904
1900 2.3
1901 0
1902 0.7
1903 0
1908 0
1909 41
1910 41
1911 1
1915 0
1913 5
1916 2
1914 0
1918 0
1919 0
1920 0
1917 0
1921 0
1922 4
1923 0
1907 0
1906
1905
5
500 0
501 1
504 1
505 1
502
7
700 0
701 0
99
503
7
700 2.3
701 0.7
99
99
1912
28
2800 1
2801 0
2802 0
2803 0
2804 1
2805 0
2806 0
99
99
29
2907
13
1300 1
1301 304
1306 0
1302 1
1305 1
1303
7
700 1
701 1.35
99
1304 0
1307 0
99
2908
28
2800 1
2801 0
2802 -0.715333
2803 0
2804 1
2805 -0.771778
2806 0
99
2901 2
99
99
302 0
304 0
303
305 0
306
307
308 1024
330 0
321 0
331 0
309 0
313 0
322 0
323 0
324 0
325 0
326 0
327 0
310 0
311 0
312
314
315 1
316 1
317 0
318 0
319 0
320 0
328 0
332 0
99
99
124
2
99
125
2
30
3004 O62
3000 2.7
3001 0.65
3002 3.81052
3003 3.21052
3008 103
3010 4
3011 2
3007 0
3006
3005
9
900 2
901 303
904 0
902 Status
903
7
700 1.1
701 2.5
99
99
3009
28
2800 1
2801 0
2802 -0.45
2803 0
2804 1
2805 1.21052
2806 0
99
99
30
3004 O63
3000 4.55
3001 0.65
3002 4.81052
3003 4.21052
3008 103
3010 4
3011 2
3007 0
3006
3005
9
900 2
901 303
904 0
902 LogMessage
903
7
700 1.1
701 2.5
99
99
3009
28
2800 1
2801 0
2802 -0.45
2803 0
2804 1
2805 2.21052
2806 0
99
99
30
3004 O64
3000 3.7
3001 0.65
3002 2.81052
3003 2.21052
3008 103
3010 4
3011 2
3007 0
3006
3005
9
900 2
901 303
904 0
902 CycleTime
903
7
700 1.1
701 2.5
99
99
3009
28
2800 1
2801 0
2802 -0.45
2803 0
2804 1
2805 0.21052
2806 0
99
99
27
2703 33
2704 31
2722 10000
2705 31
2723 10000
2706 33
2708 0
2709 0
2710 0
2711 0
2712 0
2713 0
2714 0
2715 0
2720 0
2725 0
2726 0
2702 0
2701
2700
10
1000 pwr_valuesmall
1002 O52
1005
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1006 9.37555
1007 5.9
1008 2.85
1009 2.15
1013 9.37555
1014 5.9
1015 2.85
1016 2.15
1003
0
0
0
0
0
0
0
0
0
0
1004
1001
7
700 10.25
701 2.1
99
1010
1011
1018
1019
1020
1021
1022
1023
1024
1025
1012 0
1017 9999
1027 9999
1026 65532
1028 0
1029
99
2707
28
2800 1.51111
2801 0
2802 5.9
2803 0
2804 1
2805 2.15
2806 0
99
2716 0
2718
2717
2719 0
2724 0
2727 0
2728 303
2729 4
2721
1
100 1
105 0
101 1
106 0
102 65532
103 0
12
1200 $object.CycleTime##Float32
1201 %7.3f
1202 1
1203 1
1204 0
99
99
99
27
2703 10000
2704 10000
2722 10000
2705 10000
2723 10000
2706 10000
2708 0
2709 0
2710 0
2711 0
2712 0
2713 0
2714 0
2715 0
2720 0
2725 0
2726 0
2702 0
2701
2700
10
1000 pwr_indsquare
1002 O58
1005
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1006 6.5
1007 5.9
1008 3.8
1009 3.15
1013 6.5
1014 5.9
1015 3.8
1016 3.15
1003
0
0
0
0
0
0
0
0
0
0
1004
1001
7
700 5.95
701 8.95
99
1010
1011
1018
1019
1020
1021
1022
1023
1024
1025
1012 0
1017 9999
1027 9999
1026 65532
1028 0
1029
99
2707
28
2800 1
2801 0
2802 5.75
2803 0
2804 1
2805 3.05
2806 0
99
2716 0
2718
2717
2719 0
2724 0
2727 0
2728 303
2729 4
2721
1
100 33554432
105 0
101 0
106 0
102 65532
103 0
31
3100 $node.ProcStatus[24]##status
3101 38
99
99
99
27
2703 10000
2704 10000
2722 10000
2705 10000
2723 10000
2706 10000
2708 0
2709 0
2710 0
2711 0
2712 0
2713 0
2714 0
2715 0
2720 0
2725 0
2726 0
2702 0
2701
2700
10
1000 pwr_indsquare
1002 O59
1005
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1006 6.5
1007 5.9
1008 4.7
1009 4.05
1013 6.5
1014 5.9
1015 4.7
1016 4.05
1003
0
0
0
0
0
0
0
0
0
0
1004
1001
7
700 5.95
701 8.95
99
1010
1011
1018
1019
1020
1021
1022
1023
1024
1025
1012 0
1017 9999
1027 9999
1026 65532
1028 0
1029
99
2707
28
2800 1
2801 0
2802 5.75
2803 0
2804 1
2805 3.95
2806 0
99
2716 0
2718
2717
2719 0
2724 0
2727 0
2728 303
2729 4
2721
1
100 33554432
105 0
101 0
106 0
102 65532
103 0
31
3100 $node.ProcMsgSeverity[24]##status
3101 38
99
99
99
27
2703 33
2704 10000
2722 10000
2705 10000
2723 10000
2706 33
2708 0
2709 0
2710 0
2711 0
2712 0
2713 0
2714 0
2715 0
2720 0
2725 0
2726 0
2702 0
2701
2700
10
1000 pwr_valuelong
1002 O60
1005
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1006 30.1132
1007 6.7
1008 4.75
1009 4.05
1013 30.1132
1014 6.7
1015 4.75
1016 4.05
1003
0
0
0
0
0
0
0
0
0
0
1004
1001
7
700 6.75
701 5.6
99
1010
1011
1018
1019
1020
1021
1022
1023
1024
1025
1012 0
1017 9999
1027 9999
1026 65532
1028 0
1029
99
2707
28
2800 0.880194
2801 0
2802 6.7
2803 0
2804 1
2805 4.05
2806 0
99
2716 0
2718
2717
2719 0
2724 0
2727 0
2728 303
2729 4
2721
1
100 1
105 0
101 1
106 0
102 65532
103 0
12
1200 $node.ProcMessage[24]##String80
1201 %s
1202 1
1203 1
1204 0
99
99
99
27
2703 33
2704 10000
2722 10000
2705 10000
2723 10000
2706 33
2708 0
2709 0
2710 0
2711 0
2712 0
2713 0
2714 0
2715 0
2720 0
2725 0
2726 0
2702 0
2701
2700
10
1000 pwr_valuelong
1002 O61
1005
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1006 30.106
1007 6.7
1008 3.8
1009 3.1
1013 30.106
1014 6.7
1015 3.8
1016 3.1
1003
0
0
0
0
0
0
0
0
0
0
1004
1001
7
700 6.75
701 5.6
99
1010
1011
1018
1019
1020
1021
1022
1023
1024
1025
1012 0
1017 9999
1027 9999
1026 65532
1028 0
1029
99
2707
28
2800 0.879925
2801 0
2802 6.7
2803 0
2804 1
2805 3.1
2806 0
99
2716 0
2718
2717
2719 0
2724 0
2727 0
2728 303
2729 4
2721
1
100 1
105 0
101 1
106 0
102 65532
103 0
12
1200 $node.ProcStatus[24]##Status
1201 %1m
1202 1
1203 1
1204 0
99
99
99
99
99
This diff is collapsed.
......@@ -50,6 +50,8 @@
#include "pwr_baseclasses.h"
#include "pwr_remoteclasses.h"
#include "pwr_nmpsclasses.h"
#include "pwr_basecomponentclasses.h"
#include "pwr_otherioclasses.h"
#include "pwr_opcclasses.h"
#include "co_dbs.h"
#include "co_tree.h"
......@@ -133,6 +135,7 @@
# define cPrio_report (cPrio_base + 5)
# define cPrio_sevhistmon (cPrio_base + 15)
# define cPrio_sev_server (cPrio_base + 15)
# define cPrio_powerlink (cPrio_base + 15)
# define cPrio_plc_init (cPrio_base + 5)
# define cPrio_remh (cPrio_base + 5)
# define cPrio_remotelogg (cPrio_base + 5)
......@@ -2125,6 +2128,9 @@ ini_ProcTable (
pp = ini_ProcInsert(sts, cp, "pwr_sev_server", "pwr_sev_server_%d", 0, 1, "sev_server", cPrio_sev_server, 0, pwr_cClass_SevServer, "", 0);
pp->proc.flags.b.system = 1;
pp = ini_ProcInsert(sts, cp, "pwr_powerlink", "pwr_powerlink_%d", 0, 1, "rt_powerlink", cPrio_powerlink, 0, pwr_cClass_EplHandler, "", 0);
pp->proc.flags.b.system = 1;
pp = ini_ProcInsert(sts, cp, "pwr_sim", "pwr_sim_%d", 0, 1, "rt_sim", cPrio_sim, 0, pwr_cClass_SimulateConfig, "", 0);
pp->proc.flags.b.system = 1;
#endif
......
......@@ -126,6 +126,7 @@ extern "C" {
#endif
#define pwr_AlignW(offs) (((offs) + (pwr_cAlignW-1)) & ~(pwr_cAlignW-1))
#define pwr_AlignLW(offs) (((offs) + (pwr_cAlignLW-1)) & ~(pwr_cAlignLW-1))
#define pwr_Align(offs, align) ((offs + (align-1)) & ~(align-1))
/* PROVIEW/R types */
......
......@@ -124,6 +124,7 @@ typedef enum {
errh_eAnix_report = 22,
errh_eAnix_sevhistmon = 23,
errh_eAnix_sim = 24,
errh_eAnix_powerlink = 25,
errh_eAnix_plc1 = 41,
errh_eAnix_plc2 = 42,
errh_eAnix_plc3 = 43,
......
......@@ -105,6 +105,7 @@ typedef enum {
io_mProcess_User2 = 1 << 4,
io_mProcess_User3 = 1 << 5,
io_mProcess_User4 = 1 << 6,
io_mProcess_Powerlink = 1 << 7,
io_mProcess_All = ~0
} io_mProcess;
......
......@@ -254,7 +254,8 @@ pwr_tStatus io_bus_card_init( io_tCtx ctx,
unsigned int *input_area_chansize,
unsigned int *output_area_offset,
unsigned int *output_area_chansize,
pwr_tByteOrderingEnum byte_order)
pwr_tByteOrderingEnum byte_order,
io_eAlignment alignment)
{
int i;
......@@ -272,6 +273,9 @@ pwr_tStatus io_bus_card_init( io_tCtx ctx,
if ( !chanp->sop)
continue;
if( alignment == io_eAlignment_Powerlink)
*input_area_offset = pwr_Align(*input_area_offset, *input_area_chansize);
chanp->offset = *input_area_offset;
chanp->mask = 1 << chan_di->Number;
if ( byte_order == pwr_eByteOrderingEnum_BigEndian) {
......@@ -290,6 +294,9 @@ pwr_tStatus io_bus_card_init( io_tCtx ctx,
if ( !chanp->sop)
continue;
if( alignment == io_eAlignment_Powerlink)
*input_area_offset = pwr_Align(*input_area_offset, *input_area_chansize);
chanp->offset = *input_area_offset;
chanp->size = *input_area_chansize;
chanp->mask = 0;
......@@ -304,6 +311,9 @@ pwr_tStatus io_bus_card_init( io_tCtx ctx,
if ( !chanp->sop)
continue;
if( alignment == io_eAlignment_Powerlink)
*input_area_offset = pwr_Align(*input_area_offset, *input_area_chansize);
chanp->offset = *input_area_offset;
chanp->size = *input_area_chansize;
chanp->mask = 0;
......@@ -318,6 +328,9 @@ pwr_tStatus io_bus_card_init( io_tCtx ctx,
if ( !chanp->sop)
continue;
if( alignment == io_eAlignment_Powerlink)
*input_area_offset = pwr_Align(*input_area_offset, *input_area_chansize);
chanp->offset = *input_area_offset;
chanp->size = *input_area_chansize;
chanp->mask = 0;
......@@ -331,6 +344,9 @@ pwr_tStatus io_bus_card_init( io_tCtx ctx,
if ( !chanp->sop || !chan_bi->Size)
continue;
if( alignment == io_eAlignment_Powerlink)
*input_area_offset = pwr_Align(*input_area_offset, *input_area_chansize);
chanp->offset = *input_area_offset;
chanp->size = *input_area_chansize;
chanp->mask = 0;
......@@ -348,6 +364,9 @@ pwr_tStatus io_bus_card_init( io_tCtx ctx,
if ( !chanp->sop || !chan_bo->Size)
continue;
if( alignment == io_eAlignment_Powerlink)
*output_area_offset = pwr_Align(*output_area_offset, *output_area_chansize);
chanp->offset = *output_area_offset;
chanp->size = *output_area_chansize;
chanp->mask = 0;
......@@ -364,6 +383,9 @@ pwr_tStatus io_bus_card_init( io_tCtx ctx,
if ( !chanp->sop || !chan_bi->Size)
continue;
if( alignment == io_eAlignment_Powerlink)
*input_area_offset = pwr_Align(*input_area_offset, *input_area_chansize);
chanp->offset = *input_area_offset;
chanp->size = *input_area_chansize;
chanp->mask = 0;
......@@ -378,6 +400,9 @@ pwr_tStatus io_bus_card_init( io_tCtx ctx,
if ( !chanp->sop || !chan_bo->Size)
continue;
if( alignment == io_eAlignment_Powerlink)
*output_area_offset = pwr_Align(*output_area_offset, *output_area_chansize);
chanp->offset = *output_area_offset;
chanp->size = *output_area_chansize;
chanp->mask = 0;
......@@ -394,6 +419,9 @@ pwr_tStatus io_bus_card_init( io_tCtx ctx,
if ( !chanp->sop)
continue;
if( alignment == io_eAlignment_Powerlink)
*output_area_offset = pwr_Align(*output_area_offset, *output_area_chansize);
chanp->offset = *output_area_offset;
chanp->mask = 1 << chan_do->Number;
if ( byte_order == pwr_eByteOrderingEnum_BigEndian) {
......@@ -412,6 +440,9 @@ pwr_tStatus io_bus_card_init( io_tCtx ctx,
if ( !chanp->sop)
continue;
if( alignment == io_eAlignment_Powerlink)
*output_area_offset = pwr_Align(*output_area_offset, *output_area_chansize);
chanp->offset = *output_area_offset;
chanp->size = *output_area_chansize;
chanp->mask = 0;
......@@ -426,6 +457,9 @@ pwr_tStatus io_bus_card_init( io_tCtx ctx,
if ( !chanp->sop)
continue;
if( alignment == io_eAlignment_Powerlink)
*output_area_offset = pwr_Align(*output_area_offset, *output_area_chansize);
chanp->offset = *output_area_offset;
chanp->size = *output_area_chansize;
chanp->mask = 0;
......@@ -443,6 +477,9 @@ pwr_tStatus io_bus_card_init( io_tCtx ctx,
if ( !chanp->sop)
continue;
if( alignment == io_eAlignment_Powerlink)
*input_area_offset = pwr_Align(*input_area_offset, *input_area_chansize);
chanp->offset = *input_area_offset;
chanp->mask = 1 << chan_d->Number;
if ( byte_order == pwr_eByteOrderingEnum_BigEndian) {
......@@ -461,6 +498,9 @@ pwr_tStatus io_bus_card_init( io_tCtx ctx,
if ( !chanp->sop)
continue;
if( alignment == io_eAlignment_Powerlink)
*output_area_offset = pwr_Align(*output_area_offset, *output_area_chansize);
chanp->offset = *output_area_offset;
chanp->mask = 1 << chan_d->Number;
if ( byte_order == pwr_eByteOrderingEnum_BigEndian) {
......
......@@ -77,6 +77,11 @@ extern "C"
# endif
#endif
typedef enum {
io_eAlignment_Packed,
io_eAlignment_Powerlink
} io_eAlignment;
/*----------------------------------------------------------------------------*\
Io functions
\*----------------------------------------------------------------------------*/
......@@ -96,7 +101,8 @@ pwr_tStatus io_bus_card_init( io_tCtx ctx,
unsigned int *input_area_chansize,
unsigned int *output_area_offset,
unsigned int *output_area_chansize,
pwr_tByteOrderingEnum byte_order);
pwr_tByteOrderingEnum byte_order,
io_eAlignment alignment);
void io_bus_card_read( io_tCtx ctx,
io_sRack *rp,
......
......@@ -49,6 +49,8 @@ spi_init <SPI initialization error> /error
spi_normal <SPI normal operating state> /info
spi_readerror <SPI read error> /error
spi_writeerror <SPI write error> /error
epl_oper <EPL Operational> /succ
epl_nooper <EPL Not in operational state> /error
.end
......@@ -182,6 +182,10 @@ if getent group dialout > /dev/null; then
fi
chown root /usr/pwrrt/exe/rt_prio
chmod u+s /usr/pwrrt/exe/rt_prio
if [ -e /usr/pwrrt/exe/rt_powerlink ]; then
chown root /usr/pwrrt/exe/rt_powerlink
chmod u+s /usr/pwrrt/exe/rt_powerlink
fi
chown root /usr/pwrrt/exe/rt_mozilla
chmod u+s /usr/pwrrt/exe/rt_mozilla
......
......@@ -32,6 +32,10 @@ if getent group dialout > /dev/null; then
fi
chown root /usr/pwrrt/exe/rt_prio
chmod u+s /usr/pwrrt/exe/rt_prio
if [ -e /usr/pwrrt/exe/rt_powerlink ]; then
chown root /usr/pwrrt/exe/rt_powerlink
chmod u+s /usr/pwrrt/exe/rt_powerlink
fi
chown root /usr/pwrrt/exe/rt_mozilla
chmod u+s /usr/pwrrt/exe/rt_mozilla
......
......@@ -182,6 +182,10 @@ if getent group dialout > /dev/null; then
fi
chown root /usr/pwrrt/exe/rt_prio
chmod u+s /usr/pwrrt/exe/rt_prio
if [ -e /usr/pwrrt/exe/rt_powerlink ]; then
chown root /usr/pwrrt/exe/rt_powerlink
chmod u+s /usr/pwrrt/exe/rt_powerlink
fi
chown root /usr/pwrrt/exe/rt_mozilla
chmod u+s /usr/pwrrt/exe/rt_mozilla
......
......@@ -153,6 +153,10 @@ if grep -q "\bdialout:" /etc/group; then
fi
chown root /usr/pwrrt/exe/rt_prio
chmod u+s /usr/pwrrt/exe/rt_prio
if [ -e /usr/pwrrt/exe/rt_powerlink ]; then
chown root /usr/pwrrt/exe/rt_powerlink
chmod u+s /usr/pwrrt/exe/rt_powerlink
fi
chown root /usr/pwrrt/exe/rt_mozilla
chmod u+s /usr/pwrrt/exe/rt_mozilla
......
......@@ -153,6 +153,10 @@ if grep -q "\bdialout:" /etc/group; then
fi
chown root /usr/pwrrt/exe/rt_prio
chmod u+s /usr/pwrrt/exe/rt_prio
if [ -e /usr/pwrrt/exe/rt_powerlink ]; then
chown root /usr/pwrrt/exe/rt_powerlink
chmod u+s /usr/pwrrt/exe/rt_powerlink
fi
chown root /usr/pwrrt/exe/rt_mozilla
chmod u+s /usr/pwrrt/exe/rt_mozilla
......
......@@ -254,6 +254,7 @@ sub build_kernel # args: flavour
_build("lib","usb_dummy","src","init lib");
_build("lib","cifx_dummy","src","init lib");
_build("lib","nodave_dummy","src","init lib");
_build("lib","epl_dummy","src","init lib");
merge();
_module("xtt");
build_all("exe", $flavour);
......@@ -369,6 +370,7 @@ sub ebuild # args: pass flavour
_build("lib","usb_dummy","src","init lib");
_build("lib","cifx_dummy","src","init lib");
_build("lib","nodave_dummy","src","init lib");
_build("lib","epl_dummy","src","init lib");
merge();
_module("rt");
_build("exe", "rt*", "src", "all");
......@@ -762,12 +764,12 @@ sub build_all_wbl ()
system( "rm $load_dir/*.dbs");
_build("wbl", "mcomp", "src", "lib");
merge();
_module("othermanu");
_module("otherio");
my($load_dir) = $ENV{"pwr_load"};
system( "rm $load_dir/*.dbs");
_build("wbl", "mcomp", "src", "lib");
merge();
_module("otherio");
_module("othermanu");
my($load_dir) = $ENV{"pwr_load"};
system( "rm $load_dir/*.dbs");
_build("wbl", "mcomp", "src", "lib");
......
......@@ -161,6 +161,8 @@ pwre_config_check_lib()
conf_libpnak=$conf_libpnak" -l${lib%.*}"
elif test $4 == "libusb"; then
conf_lib=$conf_lib" -lusb-1.0"
elif test $4 == "powerlink"; then
conf_libpowerlink=$conf_libpowerlink" -l${lib%.*}"
else
conf_lib=$conf_lib" -l${lib%%.*}"
fi
......@@ -430,11 +432,14 @@ else
pwre_config_check_lib wmq WMQ lib wmq 1 "/usr/lib/libmqic.so"
pwre_config_check_lib libpnioif PNAK lib pnak 1 "/usr/lib/libpnioif.a:/usr/local/lib/libpnioif.a"
pwre_config_check_lib libusb LIBUSB lib libusb 1 "/usr/lib/libusb-1.0.so:/usr/lib/$hwpl-linux-$gnu/libusb-1.0.so"
pwre_config_check_lib powerlink POWERLINK lib powerlink 1 "$epl/build/Examples/X86/Generic/powerlink_user_lib/libpowerlink.a"
pwre_config_check_include mq MQ 0 "/usr/local/dmq/include/p_entry.h"
pwre_config_check_include wmq WMQ 1 "/opt/mqm/inc/cmqc.h"
pwre_config_check_include cifx CIFX 1 "/usr/local/include/cifx/cifxlinux.h"
pwre_config_check_include nodave NODAVE 1 "/usr/include/nodave.h"
pwre_config_check_include powerlink EPL 1 "$epl/Include/Epl.h"
pwre_config_check_include powerlinkuser EPLU 0 "$epl/Examples/X86/Generic/powerlink_user_lib/EplCfg.h"
pwre_config_check_tool android ANDROID "/usr/local/android-sdk-linux/tools/android"
......@@ -457,8 +462,9 @@ else
echo "export pwre_conf_libpwrco=\"-lpwr_co\"" >> $cfile
echo "export pwre_conf_libpwrrt=\"-lpwr_rt -lpwr_co -lpwr_statussrv -lpwr_msg_dummy\"" >> $cfile
echo "export pwre_conf_libpwrdtt=\"-lpwr_dtt\"" >> $cfile
echo "export pwre_conf_libpwrotherio=\"-lpwr_usbio_dummy -lpwr_usb_dummy -lpwr_cifx_dummy -lpwr_nodave_dummy\"" >> $cfile
echo "export pwre_conf_libpwrotherio=\"-lpwr_usbio_dummy -lpwr_usb_dummy -lpwr_cifx_dummy -lpwr_nodave_dummy -lpwr_epl_dummy\"" >> $cfile
echo "export pwre_conf_libpwrprofibus=\"-lpwr_pnak_dummy\"" >> $cfile
echo "export pwre_conf_libpwrpowerlink=\"$conf_libpowerlink\"" >> $cfile
echo "export pwre_conf_libpwrxtt=\"-lpwr_xtt -lpwr_ge -lpwr_cow -lpwr_flow -lpwr_glow\"" >> $cfile
echo "export pwre_conf_libpwrxttgtk=\" -lpwr_xtt_gtk -lpwr_ge_gtk -lpwr_cow_gtk -lpwr_flow_gtk -lpwr_glow_gtk\"" >> $cfile
echo "export pwre_conf_libpwrxttmotif=\" -lpwr_xtt_motif -lpwr_ge_motif -lpwr_cow_motif -lpwr_flow_motif -lpwr_glow_motif\"" >> $cfile
......
......@@ -118,6 +118,16 @@ SObject pwrb:Type
Attr Value = 64
EndBody
EndObject
!/**
! Powerlink. Device is handled by a rt_powerlink process.
!*/
Object Powerlink $Bit
Body SysBody
Attr PgmName = "Powerlink"
Attr Text = "Powerlink"
Attr Value = 128
EndBody
EndObject
EndObject
EndSObject
......
......@@ -184,7 +184,7 @@ CompileRtNode()
ld_opt_tmp="`cat $pwrp_exe/$FileName.opt`"
ld_opt="`eval echo $ld_opt_tmp`"
else
ld_opt="`eval echo $pwr_obj/rt_io_user.o -lpwr_rt -lpwr_usbio_dummy -lpwr_usb_dummy -lpwr_pnak_dummy -lpwr_cifx_dummy -lpwr_nodave_dummy`"
ld_opt="`eval echo $pwr_obj/rt_io_user.o -lpwr_rt -lpwr_usbio_dummy -lpwr_usb_dummy -lpwr_pnak_dummy -lpwr_cifx_dummy -lpwr_nodave_dummy -lpwr_epl_dummy`"
fi
if $ldxx $link_debug -L/lib/thread -L$pwrp_lib -L$pwrp_cmn/x86_linux/lib -L$pwr_lib \
......
......@@ -280,27 +280,62 @@ palette NavigatorPalette
class ChanIi
class ChanIo
}
menu PSS9000
menu GPIO
{
menu Rack
{
class Rack_SSAB
class Ssab_RemoteRack
}
menu Cards
{
class Ssab_AI32uP
class Ssab_AI16uP
class Ssab_Ai8uP
class Ssab_AO8uP
class Ssab_AO8uPL
class Ssab_AO16uP_Logger
class Ssab_Co4uP
class Ssab_DI32D
class Ssab_DO32DKS
class Ssab_DO32DKS_Stall
}
class GPIO
class GPIO_Module
}
menu Hilscher_cifX
{
class Hilscher_cifX_Master
class Hilscher_cifX_Device
class Hilscher_cifX_Module
}
menu Modbus_TCP
{
class Modbus_Master
class Modbus_TCP_Slave
class Modbus_Module
menu Server
{
class Modbus_TCP_Server
class Modbus_TCP_ServerModule
}
}
menu Modbus_RTU
{
class Modbus_RTU_Master
class Modbus_RTU_Slave
class Modbus_RTU_Module
menu Server
{
class Modbus_RTU_Server
class Modbus_RTU_ServerModule
}
}
menu Nodave
{
class Nodave_PLC
class Nodave_Transaction
}
menu OneWire
{
class OneWire
class OneWire_AiDevice
class OneWire_AoDevice
class Maxim_DS18B20
}
menu Powerlink
{
class Epl_MN
class Epl_CN
class EPl_Module
menu Server
{
class Epl_Server
class Epl_ServerModule
}
}
menu Profibus
{
menu Masters
......@@ -337,55 +372,36 @@ palette NavigatorPalette
class ABB_ACS_PnDevice
}
}
menu Modbus_TCP
{
class Modbus_Master
class Modbus_TCP_Slave
class Modbus_Module
menu Server
{
class Modbus_TCP_Server
class Modbus_TCP_ServerModule
}
}
menu Modbus_RTU
menu PSS9000
{
class Modbus_RTU_Master
class Modbus_RTU_Slave
class Modbus_RTU_Module
menu Server
{
class Modbus_RTU_Server
class Modbus_RTU_ServerModule
}
}
menu Hilscher_cifX
menu Rack
{
class Rack_SSAB
class Ssab_RemoteRack
}
menu Cards
{
class Ssab_AI32uP
class Ssab_AI16uP
class Ssab_Ai8uP
class Ssab_AO8uP
class Ssab_AO8uPL
class Ssab_AO16uP_Logger
class Ssab_Co4uP
class Ssab_DI32D
class Ssab_DO32DKS
class Ssab_DO32DKS_Stall
}
}
menu SPI
{
class Hilscher_cifX_Master
class Hilscher_cifX_Device
class Hilscher_cifX_Module
class SPI_Slave
}
menu UDP
{
class UDP_IO
class BaseIORack
}
menu GPIO
{
class GPIO
class GPIO_Module
}
menu OneWire
{
class OneWire
class OneWire_AiDevice
class OneWire_AoDevice
class Maxim_DS18B20
}
menu SPI
{
class SPI_Slave
}
menu USB
{
class USB_Agent
......@@ -410,11 +426,6 @@ palette NavigatorPalette
class BaseIORack
}
}
menu Nodave
{
class Nodave_PLC
class Nodave_Transaction
}
}
menu Remote
{
......
......@@ -3115,7 +3115,8 @@ pwr_tStatus lfu_check_appl_file( ldh_tSesContext ldhses,
"#pwr_statussrv, , noload, norun, , 5, debug, \"\"" << endl <<
"#pwr_post, , noload, norun, , 5, debug, \"\"" << endl <<
"#pwr_sevhistmon, , noload, norun, , 5, debug, \"\"" << endl <<
"#pwr_sev_server, , noload, norun, , 5, debug, \"\"" << endl;
"#pwr_sev_server, , noload, norun, , 5, debug, \"\"" << endl <<
"#rt_powerlink, , noload, norun, , 5, debug, \"\"" << endl;
fp.close();
return LFU__SUCCESS;
......
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