Commit bdf31a73 authored by Claes pwr46/data0/x4-6-0's avatar Claes pwr46/data0/x4-6-0

Conflicts fixed

parents da428b1c fb8481c7
This diff is collapsed.
/*
* Proview $Id: rt_pn_gsdml_attr_gtk.h,v 1.3 2008-10-31 12:51:29 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* 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 the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
#ifndef rt_pn_gsdml_attr_gtk_h
#define rt_pn_gsdml_attr_gtk_h
/* rt_pn_gsdml_attr_gtk.h -- Profibus gsd attribute editor */
#include "rt_pn_gsdml_attr.h"
#include "co_wow_gtk.h"
class GsdmlAttrGtk : public GsdmlAttr {
public:
GtkWidget *parent_wid;
GtkWidget *brow_widget;
GtkWidget *form_widget;
GtkWidget *toplevel;
GtkWidget *msg_label;
GtkWidget *cmd_prompt;
GtkWidget *cmd_input;
GtkWidget *attrnav_form;
GtkWidget *cmd_ok;
GtkWidget *cmd_cancel;
GtkWidget *menubutton_copy;
GtkWidget *menubutton_cut;
GtkWidget *menubutton_paste;
GtkWidget *menubutton_changevalue;
GtkWidget *menubutton_viewio;
CoWowFocusTimerGtk focustimer;
GsdmlAttrGtk( GtkWidget *a_parent_wid,
void *a_parent_ctx,
void *a_object,
pn_gsdml *a_gsdml,
int a_edit_mode,
const char *a_data_filename);
~GsdmlAttrGtk();
void message( char severity, const char *message);
void set_prompt( const char *prompt);
void change_value();
static void gsdnkattr_message( void *attr, char severity, char *message);
static void gsdmlattr_change_value_cb( void *attr_ctx);
static void activate_change_value( GtkWidget *w, gpointer data);
static void activate_exit( GtkWidget *w, gpointer data);
static void activate_help( GtkWidget *w, gpointer data);
static void activate_copy( GtkWidget *w, gpointer data);
static void activate_cut( GtkWidget *w, gpointer data);
static void activate_paste( GtkWidget *w, gpointer data);
static void activate_viewio( GtkWidget *w, gpointer data);
static void activate_zoom_in( GtkWidget *w, gpointer data);
static void activate_zoom_out( GtkWidget *w, gpointer data);
static void activate_zoom_reset( GtkWidget *w, gpointer data);
static void activate_print( GtkWidget *w, gpointer data);
static void activate_cmd_input( GtkWidget *w, gpointer data);
static void activate_cmd_ok( GtkWidget *w, gpointer data);
static void cmd_close_apply_cb( void *ctx, void *data);
static void cmd_close_no_cb( void *ctx, void *data);
static void activate_cmd_ca( GtkWidget *w, gpointer dataxo);
static gboolean action_inputfocus( GtkWidget *w, GdkEvent *event, gpointer data);
//static void valchanged_cmd_input( GtkWidget *w, gpointer data);
};
#endif
/*
* Proview $Id: rt_pn_gsdml_attrnav_gtk.cpp,v 1.3 2008-10-31 12:51:29 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* 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 the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
/* rt_pn_gsdml_attrnav_gtk.cpp -- Display gsd attributes */
#include "glow_std.h"
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <gtk/gtk.h>
#include "co_cdh.h"
#include "co_time.h"
#include "co_wow_gtk.h"
#include "flow.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
#include "flow_browwidget_gtk.h"
#include "flow_msg.h"
#include "glow.h"
#include "glow_growctx.h"
#include "glow_growapi.h"
#include "glow_growwidget_gtk.h"
#include "rt_pn_gsdml.h"
#include "rt_pn_gsdml_attr_gtk.h"
#include "rt_pn_gsdml_attrnav_gtk.h"
#include "rt_pb_msg.h"
//
// Create the navigator widget
//
GsdmlAttrNavGtk::GsdmlAttrNavGtk( void *xn_parent_ctx,
GtkWidget *xn_parent_wid,
const char *xn_name,
pn_gsdml *xn_gsdml,
int xn_edit_mode,
GtkWidget **w,
pwr_tStatus *status) :
GsdmlAttrNav( xn_parent_ctx, xn_name, xn_gsdml, xn_edit_mode, status),
parent_wid(xn_parent_wid)
{
form_widget = scrolledbrowwidgetgtk_new( init_brow_cb,
this, &brow_widget);
gtk_widget_show_all( brow_widget);
*w = form_widget;
wow = new CoWowGtk( brow_widget);
trace_timerid = wow->timer_new();
*status = 1;
}
//
// Delete a nav context
//
GsdmlAttrNavGtk::~GsdmlAttrNavGtk()
{
delete trace_timerid;
delete wow;
delete brow;
gtk_widget_destroy( form_widget);
}
void GsdmlAttrNavGtk::set_inputfocus()
{
gtk_widget_grab_focus( brow_widget);
}
/*
* Proview $Id: rt_pn_gsdml_attrnav_gtk.h,v 1.2 2008-10-31 12:51:29 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* 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 the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
#ifndef rt_pn_gsdml_attrnav_gtk_h
#define rt_pn_gsdml_attrnav_gtk_h
/* rt_pn_gsdml_attrnav_gtk.h -- Profibus gsd configurator navigator */
#ifndef rt_pn_gsdml_attrnav_h
# include "rt_pn_gsdml_attrnav.h"
#endif
//! The navigation area of the attribute editor.
class GsdmlAttrNavGtk : public GsdmlAttrNav {
public:
GsdmlAttrNavGtk(
void *xn_parent_ctx,
GtkWidget *xn_parent_wid,
const char *xn_name,
pn_gsdml *xn_gsdml,
int xn_edit_mode,
GtkWidget **w,
pwr_tStatus *status);
~GsdmlAttrNavGtk();
void set_inputfocus();
GtkWidget *parent_wid;
GtkWidget *brow_widget;
GtkWidget *form_widget;
GtkWidget *toplevel;
};
#endif
This diff is collapsed.
This diff is collapsed.
/* <St> *******************************************************************
======================== Copyright =====================================
Copyright (C) 2004 Hilscher GmbH
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 the program, if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
=========================================================================
cif_types.h
-------------------------------------------------------------------------
CREATETED : D. Tsaava, Hilscher GmbH
DATE : 18.07.2000
PROJEKT : CIF device driver
=========================================================================
DISCRIPTION
Includefile for CIF device driver, DPM layout .
=========================================================================
CHANGES
version name date Discription
March 2001
Juli 2004 Redesigned for the 2.6 Kernel
Copyright changed to GNU Lesser GPL
-------------------------------------------------------------------------
V2.602
******************************************************************** <En> */
#ifndef CIF_TYPES_H
# define CIF_TYPES_H
/* Macros for debugging */
#undef DBG_PRN /* undef it, just in case */
#ifdef CIF_DEBUG
# define CIF_PRN(function, lineno,fmt,args...) printk(fmt,function,lineno,##args)
# define DBG_PRN(fmt,args...) CIF_PRN((__FUNCTION__),(__LINE__),KERN_INFO __FILE__"::%s(L%.4d): "fmt,##args)
#else
# define DBG_PRN(fmt, args...) /* not debugging: nothing */
#endif
#ifndef TRUE
# define TRUE 1
#endif
#ifndef FALSE
# define FALSE 0
#endif
#ifndef BOOL
# define BOOL int
#endif
#endif /* CIF_TYPES_H */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* <St> *******************************************************************
======================== Copyright =====================================
Copyright (C) 2004 Hilscher GmbH
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 the program, if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
========================================================================
FILENAME : RcsDef.h
-------------------------------------------------------------------------
CREATED BY : R.Mayer, Hilscher GmbH
CREATED AT : 10.03.97
PROJECT :
=========================================================================
FUNCTION / CLASSDESCRIPTION:
=========================================================================
CHANGES OF REVISIONS :
Version Name Date Change
-------------------------------------------------------------------------
1.000 RM 10.03.97 Created
******************************************************************** <En> */
// Prevent multiple inclusion
#ifndef __RCSDEF_H__
#define __RCSDEF_H__
#ifdef _cplusplus
extern "C" {
#endif /* _cplusplus */
#define FIRMWARE_DOWNLOAD 1
#define CONFIGURATION_DOWNLOAD 2
/* ======================================================================== */
/* Message definitions */
/* ======================================================================== */
#define RCS_TASK 0x00 /* Number of RCS */
#define PLC_TASK 0x02 /* Number for PLC_TASK */
#define MSG_SYSTEM_TX 0xFF /* Transmitter for system functions number */
#define RCS_B_TASK_STATE 4 // Task state
/************************************************************************** */
/* Genaral RCS commands */
/************************************************************************** */
#define RCS_B_SYSFKT 1
#define RCS_B_TASKFKT 2
#define RCS_B_DIAGNOSE 3
#define RCS_B_STRUCTFNC 4
#define RCS_B_TRACE 5
#define RCS_B_LOADFKT 6
#define RCS_B_DBMFKT 10
/* ----------------------- */
/* Message extension masks */
/* ----------------------- */
#define RCS_FIFO_MSK 0
#define RCS_LIFO_MSK 1
#define RCS_NAK_MSK 2
#define RCS_NORM_MSK 0
#define RCS_FIRST_MSK 4
#define RCS_CONT_MSK 8
#define RCS_LAST_MSK 0x0C
#define RCS_SEQ_MSK 0x0C
/* ------------------ */
/* Mode definitions */
/* ------------------ */
#define MODE_NEUSTART 0 /* Command: B_SYSFKT */
#define MODE_KALTSTART 1 /* Command: B_SYSFKT */
#define MODE_WARMSTART 2 /* Command: B_SYSFKT */
#define MODE_ZYKL_STATUS_STOP 3 /* Command: B_SYSFKT */
#define MODE_FWVERSION 4 /* Command: B_SYSFKT */
#define MODE_GET_PROJ_WERTE_HW 5 /* Command: B_SYSFKT */
#define MODE_GET_PROJ_WERTE_SW 6 /* Command: B_SYSFKT */
#define MODE_SHOW_DYN_SYSSTAT 7 /* Command: B_SYSFKT */
#define MODE_SETTIME 9 /* not implemented yet */
#define MODE_SET_DEVICE_DATA 9 /* not implemented yet */
#define MODE_MODUL_RCS 11 /* Command: B_SYSFKT */
#define MODE_MODUL_LIB 12 /* Command: B_SYSFKT */
#define MODE_MODUL_MCL 13 /* Command: B_SYSFKT */
#define MODE_MODUL_LIB 12 /* Command: B_SYSFKT */
#define MODE_MODUL_MCL 13 /* Command: B_SYSFKT */
#define MODE_DISTRIBUTOR_DRIVER 14 /* Command: B_SYSFKT ->function 1 = insert */
#define MODE_PRINT_DRIVER 15 /* Command: B_SYSFKT */
#define MODE_GET_RCS_ERROR 16 /* Command: B_SYSFKT */
#define MODE_PRINT_DEVICE 1 /* NO mode, only for MENU.H */
#define MODE_PRINT_DEVICE_DRIVER 2 /* NO mode, only for MENU.H */
#define MODE_START_STOP_STAT 0 /* Command: B_TASKFKT */
#define MODE_START_STOP 1 /* Command: B_TASKFKT */
#define MODE_TASK_VERSION 2 /* Command: B_TASKFKT */
#define MODE_ZYKL_STATUS 3 /* Command: B_TASKFKT */
#define MODE_SHOW_FUELLST 4 /* Command: B_TASKFKT */
#define MODE_SHOW_TIMER 5 /* Command: B_TASKFKT */
#define MODE_DIAG_MEM_READ_SINGLE 0x0 /* Command: B_DIAGNOSE */
#define MODE_DIAG_MEM_WRITE_SINGLE 0x1 /* Command: B_DIAGNOSE */
#define MODE_DIAG_IO_READ_SINGLE 0x2 /* Command: B_STRUKTFKT */
#define MODE_DIAG_IO_WRITE_SINGLE 0x3 /* Command: B_STRUKTFKT */
#define MODE_DIAG_ZYKL 0x10 /* Command: B_STRUKTFKT */
#define MODE_DIAG_MEM_READ_ZYKL 0x10 /* Command: B_STRUKTFKT */
#define MODE_DIAG_MEM_WRITE_ZYKL 0x11 /* Command: B_STRUKTFKT */
#define MODE_DIAG_IO_READ_ZYKL 0x12 /* Command: B_STRUKTFKT */
#define MODE_DIAG_IO_WRITE_ZYKL 0x13 /* Command: B_STRUKTFKT */
#define MODE_ZYKL_TASK_STRUK 0 /* Command: B_STRUKTFKT */
#define MODE_INIT_INFO_STRUK 1 /* Command: B_STRUKTFKT */
#define MODE_WRITE_STRUK 2 /* Command: B_STRUKTFKT */
#define MODE_START_TRACE 0 /* Command: B_TRACE */
#define MODE_DEL_TRACE_PUF 1 /* Command: B_TRACE */
#define MODE_UPLOAD_BINAER 0 /* Command: B_LOADFKT */
#define MODE_DOWNLOAD_BINAER 1 /* Command: B_LOADFKT */
#define MODE_UPLOAD_DBM 2 /* Command: B_LOADFKT */
#define MODE_DOWNLOAD_DBM 3 /* Command: B_LOADFKT */
#define MODE_DEL_FLASH 4 /* Command: B_LOADFKT */
#define MODE_GET_FLASH_DIR 5 /* Command: B_LOADFKT */
#define MODE_URLADEN 6 /* Command: B_LOADFKT */
#define MODE_LONG_BINLOAD 7 /* Command: B_LOADFKT */
#define MODE_FREE_DRIVER 8 /* Command: B_LOADFKT */
#define MODE_RESET_DEVICE 10 /* Command: B_LOADFKT */
/* ------------------------------------------------------------------------------------ */
#ifdef _cplusplus
}
#endif
#endif
// ======== eof 'RcsDef.h' ========
......@@ -30,14 +30,6 @@
#include <sys/file.h>
#include <sys/ioctl.h>
#include "keywords.h"
#include "pb_type.h"
#include "pb_conf.h"
#include "pb_if.h"
#include "pb_err.h"
#include "pb_fmb.h"
#include "pb_dp.h"
#include "rt_io_pb_locals.h"
#include "pwr.h"
......@@ -47,7 +39,6 @@
#include "rt_io_bus.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_profiboard.h"
/*----------------------------------------------------------------------------*\
Convert ai from rawvalue to actualvalue.
......
......@@ -28,15 +28,6 @@
#include <sys/file.h>
#include <sys/ioctl.h>
#include "keywords.h"
#include "pb_type.h"
#include "pb_conf.h"
#include "pb_if.h"
#include "pb_err.h"
#include "pb_fmb.h"
#include "pb_dp.h"
#include "rt_io_pb_locals.h"
#include "pwr.h"
......@@ -46,7 +37,6 @@
#include "rt_io_bus.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_profiboard.h"
/*----------------------------------------------------------------------------*\
......
......@@ -28,15 +28,6 @@
#include <sys/file.h>
#include <sys/ioctl.h>
#include "keywords.h"
#include "pb_type.h"
#include "pb_conf.h"
#include "pb_if.h"
#include "pb_err.h"
#include "pb_fmb.h"
#include "pb_dp.h"
#include "rt_io_pb_locals.h"
#include "pwr.h"
......@@ -46,7 +37,6 @@
#include "rt_io_bus.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_profiboard.h"
#define IO_CONVMASK_ALL 0xFFFF
......
......@@ -28,15 +28,6 @@
#include <sys/file.h>
#include <sys/ioctl.h>
#include "keywords.h"
#include "pb_type.h"
#include "pb_conf.h"
#include "pb_if.h"
#include "pb_err.h"
#include "pb_fmb.h"
#include "pb_dp.h"
#include "rt_io_pb_locals.h"
#include "pwr.h"
......@@ -46,7 +37,6 @@
#include "rt_io_bus.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_profiboard.h"
/*----------------------------------------------------------------------------*\
......
......@@ -27,15 +27,6 @@
#include <sys/file.h>
#include <sys/ioctl.h>
#include "keywords.h"
#include "pb_type.h"
#include "pb_conf.h"
#include "pb_if.h"
#include "pb_err.h"
#include "pb_fmb.h"
#include "pb_dp.h"
#include "rt_io_pb_locals.h"
#include "pwr.h"
......@@ -316,21 +307,13 @@ static pwr_tStatus IoRackRead (
{
pwr_sClass_Pb_Profiboard *mp;
pwr_sClass_Pb_DP_Slave *sp;
T_PROFI_DEVICE_HANDLE *hDevice;
pwr_tUInt16 sts;
pwr_tUInt16 data_len;
hDevice = (T_PROFI_DEVICE_HANDLE *) ap->Local;
sp = (pwr_sClass_Pb_DP_Slave *) rp->op;
mp = (pwr_sClass_Pb_Profiboard *) ap->op;
if (sp->Status == PB__NORMAL && mp->Status == PB__NORMAL && sp->DisableSlave != 1 && mp->DisableBus != 1) {
/* The reading of the process image is now performed at the agent level,
this eliminates the need for board specific code at the rack level. */
data_len = sp->BytesOfInput;
sts = profi_get_data(hDevice, ID_DP_SLAVE_IO_IMAGE, sp->OffsetInputs, &data_len, &sp->Inputs );
}
if (sp->DisableSlave != 1 && mp->DisableBus != 1) {
if (sp->Status == PB__NORMAL) {
......@@ -368,26 +351,12 @@ static pwr_tStatus IoRackWrite (
{
pwr_sClass_Pb_Profiboard *mp;
pwr_sClass_Pb_DP_Slave *sp;
T_PROFI_DEVICE_HANDLE *hDevice;
pwr_tUInt16 sts;
hDevice = (T_PROFI_DEVICE_HANDLE *) ap->Local;
sp = (pwr_sClass_Pb_DP_Slave *) rp->op;
mp = (pwr_sClass_Pb_Profiboard *) ap->op;
// Write the whole I/O output area from local area
if ((sp->Status == PB__NORMAL || sp->Status == PB__NOCONN) &&
mp->Status == PB__NORMAL && (sp->DisableSlave != 1) && (mp->DisableBus != 1)) {
if (sp->BytesOfOutput > 0) {
sts = profi_set_data(hDevice, ID_DP_SLAVE_IO_IMAGE, sp->OffsetOutputs, sp->BytesOfOutput, &sp->Outputs);
if (sts != E_OK) sp->ErrorCount++;
}
}
/* The writing of the process image is now performed at the agent level,
this eliminates the need for board specific code at the rack level. */
if (sp->DisableSlave == 1 || mp->DisableBus == 1) sp->Status = PB__DISABLED;
......
This diff is collapsed.
......@@ -27,16 +27,6 @@
#include <sys/file.h>
#include <sys/ioctl.h>
#include "keywords.h"
#include "pb_type.h"
#include "pb_conf.h"
#include "pb_if.h"
#include "pb_err.h"
#include "pb_fmb.h"
#include "pb_dp.h"
#include "rt_io_pb_locals.h"
#include "pwr.h"
......@@ -46,7 +36,6 @@
#include "rt_io_bus.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_profiboard.h"
/*----------------------------------------------------------------------------*\
......
......@@ -25,15 +25,6 @@
#include <sys/file.h>
#include <sys/ioctl.h>
#include "keywords.h"
#include "pb_type.h"
#include "pb_conf.h"
#include "pb_if.h"
#include "pb_err.h"
#include "pb_fmb.h"
#include "pb_dp.h"
#include "rt_io_pb_locals.h"
#include "pwr.h"
......@@ -43,7 +34,6 @@
#include "rt_io_bus.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_profiboard.h"
/*----------------------------------------------------------------------------*\
......
......@@ -27,15 +27,6 @@
#include <sys/file.h>
#include <sys/ioctl.h>
#include "keywords.h"
#include "pb_type.h"
#include "pb_conf.h"
#include "pb_if.h"
#include "pb_err.h"
#include "pb_fmb.h"
#include "pb_dp.h"
#include "rt_io_pb_locals.h"
#include "pwr.h"
......@@ -45,7 +36,6 @@
#include "rt_io_bus.h"
#include "rt_io_msg.h"
#include "rt_errh.h"
#include "rt_io_profiboard.h"
#include "rt_pb_msg.h"
/*----------------------------------------------------------------------------*\
......
......@@ -54,6 +54,17 @@
#include "rt_io_profiboard.h"
typedef struct {
int hServiceReadDevice; // Handle for Service device
int hServiceWriteDevice; // Handle for Service device
int hDpDataDevice; // Handle for DP-Data device
int hDpsInputDataDevice; // Handle for DP-Slave Input-Data device
int hDpsOutputDataDevice; // Handle for DP-Slave Output-Data device
unsigned char CurrentBoardNumber;
int slave_diag_requested;
int hDpsBoardDevice; // Handle for DP-Slave Output-Data device
} io_sAgentLocal;
#define DP_MAX_SERVICE_RETRY 10
......@@ -807,10 +818,32 @@ static pwr_tStatus IoAgentRead (
T_PROFI_SERVICE_DESCR con_ind_sdb;
T_DP_GET_SLAVE_DIAG_CON FAR *get_slave_diag_con_ptr;
pwr_sClass_Pb_Profiboard *mp;
pwr_sClass_Pb_DP_Slave *sp;
pwr_tUInt16 data_len;
io_sRack *slave_list;
hDevice = (T_PROFI_DEVICE_HANDLE *) ap->Local;
local = (io_sAgentLocal *) ap->Local;
op = (pwr_sClass_Pb_Profiboard *) ap->op;
/* Iterate over the slaves. */
for (slave_list = ap->racklist; slave_list != NULL;
slave_list = slave_list->next) {
sp = (pwr_sClass_Pb_DP_Slave *) slave_list->op;
mp = (pwr_sClass_Pb_Profiboard *) ap->op;
/* Read process data. */
if (sp->Status == PB__NORMAL && mp->Status == PB__NORMAL && sp->DisableSlave != 1 && mp->DisableBus != 1) {
data_len = sp->BytesOfInput;
sts = profi_get_data(hDevice, ID_DP_SLAVE_IO_IMAGE, sp->OffsetInputs, &data_len, &sp->Inputs );
}
}
/* If everything is fine we should be in state OPERATE
Make a poll to see if there are diagnostics, the answer also tell us
if there are any hardware faults. In that case, make a reset and a new init. */
......@@ -1003,6 +1036,37 @@ static pwr_tStatus IoAgentWrite (
io_sAgent *ap
)
{
T_PROFI_DEVICE_HANDLE *hDevice;
pwr_tUInt16 sts;
pwr_sClass_Pb_Profiboard *mp;
pwr_sClass_Pb_DP_Slave *sp;
io_sRack *slave_list;
hDevice = (T_PROFI_DEVICE_HANDLE *) ap->Local;
/* Iterate over the slaves. */
for (slave_list = ap->racklist; slave_list != NULL;
slave_list = slave_list->next) {
sp = (pwr_sClass_Pb_DP_Slave *) slave_list->op;
mp = (pwr_sClass_Pb_Profiboard *) ap->op;
// Write the whole I/O output area from local area
if ((sp->Status == PB__NORMAL || sp->Status == PB__NOCONN) &&
mp->Status == PB__NORMAL && (sp->DisableSlave != 1) && (mp->DisableBus != 1)) {
if (sp->BytesOfOutput > 0) {
sts = profi_set_data(hDevice, ID_DP_SLAVE_IO_IMAGE, sp->OffsetOutputs, sp->BytesOfOutput, &sp->Outputs);
if (sts != E_OK) sp->ErrorCount++;
}
}
}
return IO__SUCCESS;
}
......
......@@ -53,16 +53,7 @@
#define PB_UDATA_DIAG 1
typedef struct {
int hServiceReadDevice; // Handle for Service device
int hServiceWriteDevice; // Handle for Service device
int hDpDataDevice; // Handle for DP-Data device
int hDpsInputDataDevice; // Handle for DP-Slave Input-Data device
int hDpsOutputDataDevice; // Handle for DP-Slave Output-Data device
unsigned char CurrentBoardNumber;
int slave_diag_requested;
int hDpsBoardDevice; // Handle for DP-Slave Output-Data device
} io_sAgentLocal;
/* io_sAgentLocal now lives in the respective agent modules. */
typedef struct {
int initialized;
......
Pb_Profiboard
Pb_Hilscher
Pb_DP_Slave
Pb_Module
Pb_Di
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* Proview $Id$
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* 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 the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
#ifndef rt_pn_gsdml_attr_h
#define rt_pn_gsdml_attr_h
/* rt_pn_gsdml_attr.h -- Profinet gsdml attribute editor */
#include "rt_pn_gsdml.h"
#include "rt_pn_gsdml_data.h"
typedef struct {
void *value;
char name[80];
int type;
int size;
double minlimit;
double maxlimit;
int noedit;
int multiline;
int mask;
} attr_sItem;
class GsdmlAttrNav;
class CoWow;
class GsdmlAttr {
public:
void *parent_ctx;
char name[80];
pn_gsdml *gsdml;
int edit_mode;
GsdmlAttrNav *attrnav;
int input_open;
void *object;
void (*close_cb) (void *);
int (*save_cb) (void *);
int (*help_cb) (void *, const char *);
void *client_data;
int recall_idx;
static char value_recall[30][160];
int value_current_recall;
pwr_tFileName data_filename;
CoWow *wow;
GsdmlAttr( void *a_parent_ctx,
void *a_object,
pn_gsdml *a_gsdml,
int a_edit_mode,
const char *a_data_filename);
virtual ~GsdmlAttr();
virtual void message( char severity, const char *message) {}
virtual void set_prompt( const char *prompt) {}
virtual void change_value() {}
void activate_exit();
void activate_help();
void activate_copy();
void activate_cut();
void activate_paste();
void activate_print();
void activate_viewio( int set);
void activate_zoom_in();
void activate_zoom_out();
void activate_zoom_reset();
void activate_cmd_ok();
void activate_cmd_ca();
static void gsdmlattr_message( void *attr, char severity, const char *message);
static void gsdmlattr_change_value_cb( void *attr_ctx);
static void cmd_close_apply_cb( void *ctx, void *data);
static void cmd_close_no_cb( void *ctx, void *data);
};
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* Proview $Id$
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* 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 the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
#ifndef wb_c_pndevice_h
#define wb_c_pndevice_h
/* wb_c_pndevice.h -- Profinet gsdml configure method */
typedef struct {
pn_gsdml *gsdml;
GsdmlAttr *attr;
ldh_tSession ldhses;
pwr_tAttrRef aref;
gsdml_sModuleClass *mc;
void *editor_ctx;
int edit_mode;
} device_sCtx;
pwr_tStatus pndevice_create_ctx( ldh_tSession ldhses, pwr_tAttrRef aref,
void *editor_ctx, device_sCtx **ctxp);
pwr_tStatus pndevice_init( device_sCtx *ctx);
int pndevice_help_cb( void *sctx, const char *text);
void pndevice_close_cb( void *sctx);
int pndevice_save_cb( void *sctx);
#endif
Pb_DP_Slave
PnDevice
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -41,6 +41,12 @@ configerr <Configuration error> /error
masterlock <Slave is locked by other master> /error
notready <Not ready> /warning
gsdattr <Gsdfile attibute is empty> /error
nyi <Not yet implemented> /error
syntax <Conversion syntax error> /error
gsdmlfile <Unable to open GSDML file> /error
nodevice <No device selected> /error
createchan <Unable to create channel> /error
gsdmlfilemismatch <Gsdmlfile doesn't match original filename> /error
.end
This diff is collapsed.
......@@ -5,6 +5,7 @@ Ssab_Di
Ssab_Do
Ssab_Co
Ssab_RemoteRack
Ssab_PIDuP
Di_DIX2
Do_HVDO32
Ao_HVAO4
......
This diff is collapsed.
......@@ -264,6 +264,7 @@ palette NavigatorPalette
menu Masters
{
class Pb_Profiboard
class Pb_Hilscher
}
menu Slaves
{
......
......@@ -585,7 +585,7 @@ WNav::WNav(
layout_objid(pwr_cNObjid), search_last(pwr_cNObjid), search_compiled(0),
search_type(wnav_eSearchType_No), selection_owner(0), last_selected(0),
displayed(0), scriptmode(0), dialog_width(0), dialog_height(0),
dialog_x(0), dialog_y(0), menu(0), admin_login(0)
dialog_x(0), dialog_y(0), menu(0), admin_login(0), nodraw(0)
{
strcpy( name, xn_name);
......@@ -2749,6 +2749,9 @@ void WNav::ldh_refresh( pwr_tObjid new_open)
if ( brow->type != wnav_eBrowType_Volume)
return;
if ( nodraw)
return;
// Store all open objects
open_cnt = 0;
......
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