Commit 5a3f5323 authored by Claes Sjofors's avatar Claes Sjofors

Profinet Viewer added

parent 1ebe6512
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) $(elinkflags) $(domap) -o $(export_exe) \
$(export_obj) -lpwr_co -lrt
endif
/**
* 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.
**/
//
// Search for DeviceID and VendorID in gsdml files and extract ProductFamly and TextInfo.
// The content should be written in $pwr_exe/profinet_deviceid.dat which is used by the
// Proview Viewer to show info for a device.
//
#include <fstream>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "pwr.h"
#include "co_dcli.h"
using namespace std;
void parse_file( char *filename);
int main( int argc, char *argv[])
{
pwr_tFileName file_spec, found_file;
pwr_tStatus sts;
if ( argc < 2 || strcmp( argv[1], "-h") == 0) {
printf( "\nUsage: pn_get_deviceid \"file-pattern\" > profinet_deviceid.dat\n\n");
exit(0);
}
dcli_translate_filename( file_spec, argv[1]);
sts = dcli_search_file( file_spec, found_file, DCLI_DIR_SEARCH_INIT);
while ( ODD(sts)) {
printf("# Processing file: %s\n", found_file);
parse_file( found_file);
sts = dcli_search_file( file_spec, found_file, DCLI_DIR_SEARCH_NEXT);
}
dcli_search_file( file_spec, found_file, DCLI_DIR_SEARCH_END);
}
void parse_file( char *filename)
{
ifstream fp;
pwr_tFileName fname;
char line[1024];
unsigned int deviceid;
unsigned int vendorid;
char infotextid[500] = "";
char infotext[500] = "";
char family[500] = "";
dcli_translate_filename( fname, filename);
fp.open( fname);
if ( !fp) {
printf( "# Unable to open file\n");
exit(0);
}
int in_deviceid = 0;
int in_devicefunction = 0;
int in_text = 0;
int deviceid_found = 0;
int family_found = 0;
int vendorid_found = 0;
int infotextid_found = 0;
int infotext_found = 0;
while( fp.getline( line, sizeof(line))) {
char *s;
if ( !in_deviceid) {
if ( (s = strstr( line, "<DeviceIdentity")))
in_deviceid = 1;
}
if ( in_deviceid) {
if ( !deviceid_found) {
if ( (s = strstr( line, "DeviceID"))) {
for ( s += 9; *s; s++) {
if ( *s == '\"') {
sscanf( s+3, "%x", &deviceid);
deviceid_found = 1;
break;
}
}
}
}
if ( !vendorid_found) {
if ( (s = strstr( line, "VendorID"))) {
for ( s += 9; *s; s++) {
if ( *s == '\"') {
sscanf( s+3, "%x", &vendorid);
vendorid_found = 1;
break;
}
}
}
}
if ( !infotextid_found) {
if ( (s = strstr( line, "<InfoText"))) {
for ( s += 16; *s; s++) {
if ( *s == '\"') {
strncpy( infotextid, s+1, sizeof(infotextid));
if ( (s = strchr( infotextid, '\"')))
*s = 0;
infotextid_found = 1;
break;
}
}
}
}
if ( strstr( line, "</DeviceIdentity>")) {
in_deviceid = 0;
printf( "%u %u\n", vendorid, deviceid);
if ( !deviceid_found)
printf( "# DeviceID not found\n");
if ( !vendorid_found)
printf( "# VendorID not found\n");
if ( !infotextid_found)
printf( "# TextId not found\n");
if ( !(deviceid_found && vendorid_found && infotextid_found))
return;
}
}
if ( !in_devicefunction) {
if ( (s = strstr( line, "<DeviceFunction")))
in_devicefunction = 1;
}
if ( in_devicefunction) {
if ( !family_found) {
if ( (s = strstr( line, "ProductFamily"))) {
for ( s += 14; *s; s++) {
if ( *s == '\"') {
strncpy( family, s+1, sizeof(family));
if ( (s = strchr( family, '\"')))
*s = 0;
family_found = 1;
in_devicefunction = 0;
break;
}
}
}
}
}
if ( infotextid_found && !infotext_found) {
if ( strstr( line, "<Text") && strstr( line, infotextid))
in_text = 1;
if ( in_text) {
if ( (s = strstr( line, "Value"))) {
for ( s +=6; *s; s++) {
if ( *s == '\"') {
strncpy( infotext, s+1, sizeof(infotext));
if ( (s = strchr( infotext, '\"')))
*s = 0;
infotext_found = 1;
in_text = 0;
break;
}
}
}
}
}
}
printf( "%s\n%s\n", family, infotext);
fp.close();
}
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) $(elinkflags) $(domap) -o $(pwr_exe)/profinet_viewer_gtk \
$(bld_dir)/profinet_viewer_gtk.o \
$(bld_dir)/pn_viewer_gtk.o $(bld_dir)/pn_viewernav_gtk.o \
$(bld_dir)/pn_viewer.o $(bld_dir)/pn_viewernav.o $(bld_dir)/pn_viewer_pnac.o\
$(wb_msg_eobjs) $(rt_msg_eobjs) \
$(pwr_eobj)/rt_io_user.o -L/usr/X11R6/lib \
-L/opt/gnome/lib \
-lpwr_flow_gtk -lpwr_flow -lpwr_rt_gtk -lpwr_rt \
-lpwr_co_gtk -lpwr_co -lpwr_flow_gtk -lpwr_flow \
`pkg-config --libs gtk+-2.0` \
-lpwr_msg_dummy -lantlr \
-lcrypt -lrpcsvc -lpthread -lm -ldb_cxx -lz
endif
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 pn_viewer_gtk_h
#define pn_viewer_gtk_h
/* pn_viewer_gtk.h -- Profinet viewer */
#ifndef pn_viewer_h
# include "../src/pn_viewer.h"
#endif
#ifndef co_wow_gtk_h
# include "co_wow_gtk.h"
#endif
#include <gtk/gtk.h>
class PnViewerGtk : public PnViewer {
public:
PnViewerGtk(
void *v_parent_ctx,
GtkWidget *v_parent_wid,
const char *v_name,
pwr_tStatus *status);
~PnViewerGtk();
GtkWidget *parent_wid;
GtkWidget *toplevel;
GtkWidget *form;
GtkWidget *nav_widget;
GtkWidget *msg_label;
GtkWidget *cmd_prompt;
GtkWidget *cmd_input;
CoWowFocusTimerGtk focustimer;
CoWowFocusTimerGtk maptimer;
CoWowRecall *value_recall;
CoWowEntryGtk *cmd_entry;
void message( char severity, const char *msg);
void set_prompt( const char *prompt);
void open_change_value();
static gboolean action_inputfocus( GtkWidget *w, GdkEvent *event, gpointer data);
static void valchanged_cmd_input( GtkWidget *w, gpointer data);
static void activate_exit( GtkWidget *w, gpointer data);
static void activate_update( GtkWidget *w, gpointer data);
static void activate_setdevice( GtkWidget *w, gpointer data);
static void activate_changevalue( 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_help( GtkWidget *w, gpointer data);
};
#endif
/**
* 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.
**/
/* pn_viewernav_gtk.cpp -- Profinet viewer */
#include "glow_std.h"
#include <stdio.h>
#include <stdlib.h>
#include <gtk/gtk.h>
extern "C" {
#include "co_cdh.h"
#include "co_time.h"
}
#include "flow.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
#include "flow_browwidget_gtk.h"
#include "pn_viewernav_gtk.h"
PnViewerNavGtk::PnViewerNavGtk (
void *l_parent_ctx,
GtkWidget *l_parent_wid,
GtkWidget **w) :
PnViewerNav( l_parent_ctx), parent_wid(l_parent_wid)
{
form_widget = scrolledbrowwidgetgtk_new(
PnViewerNav::init_brow_cb, this, &brow_widget);
gtk_widget_show_all( brow_widget);
// Create the root item
*w = form_widget;
}
//
// Delete ev
//
PnViewerNavGtk::~PnViewerNavGtk()
{
delete brow;
gtk_widget_destroy( form_widget);
}
void PnViewerNavGtk::set_input_focus()
{
gtk_widget_grab_focus( brow_widget);
}
/**
* 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 pn_viewernav_gtk_h
#define pn_viewernav_gtk_h
/* pn_viewernav_gtk.h -- Profinet viewer */
#ifndef pn_viewernav_h
# include "../src/pn_viewernav.h"
#endif
class PnViewerNavGtk : public PnViewerNav {
public:
PnViewerNavGtk(
void *ev_parent_ctx,
GtkWidget *ev_parent_wid,
GtkWidget **w);
~PnViewerNavGtk();
GtkWidget *parent_wid;
GtkWidget *brow_widget;
GtkWidget *form_widget;
GtkWidget *toplevel;
void set_input_focus();
};
#endif
/*
* Proview $Id: wb_ge_gtk.cpp,v 1.2 2007-09-07 06:26:21 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.
*/
/* profinet_viewer.cpp -- Profinet viewer */
#include <stdio.h>
#include <stdlib.h>
#include "pwr.h"
#include <gtk/gtk.h>
#include "co_lng.h"
#include "co_error.h"
#include "co_xhelp_gtk.h"
#include "pn_viewer_gtk.h"
typedef struct {
GtkWidget *toplevel;
PnViewer *viewer;
} tViewer;
static void usage()
{
printf("\nUsage: profinet_viewer [-l language]\n");
}
static void viewer_close( void *c)
{
delete ((tViewer *)c)->viewer;
exit(0);
}
int main( int argc, char *argv[])
{
int i;
int sts;
tViewer *ctx;
ctx = (tViewer *)calloc( 1, sizeof(tViewer));
gtk_init( &argc, &argv);
ctx->toplevel = (GtkWidget *) g_object_new( GTK_TYPE_WINDOW,
"default-height", 100,
"default-width", 100,
"title", "Profinet Viewer",
NULL);
// Create help window
CoXHelpGtk *xhelp = new CoXHelpGtk( ctx->toplevel, 0, xhelp_eUtility_Wtt, (int *)&sts);
CoXHelpGtk::set_default( xhelp);
for ( i = 1; i < argc; i++) {
if ( strcmp( argv[i], "-l") == 0) {
if ( i+1 >= argc) {
usage();
exit(0);
}
Lng::set( argv[i+1]);
i++;
}
}
// Open window
try {
ctx->viewer = new PnViewerGtk( ctx, ctx->toplevel, "Profinet Viewer", &sts);
ctx->viewer->close_cb = viewer_close;
}
catch ( co_error &e) {
printf( "** Exception: %s\n", e.what().c_str());
exit(0);
}
gtk_widget_show_all( ctx->toplevel);
g_object_set( ctx->toplevel, "visible", FALSE, NULL);
try {
ctx->viewer->update_devices();
}
catch( co_error &e) {
printf( "** Exception: %s\n", e.what().c_str());
}
gtk_main();
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
copy : $(exe_dir)/profinet_vendorid.dat $(exe_dir)/profinet_deviceid.dat
$(exe_dir)/profinet_vendorid.dat : ../../profinet_vendorid.dat
@ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target)
$(exe_dir)/profinet_deviceid.dat : ../../profinet_deviceid.dat
@ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target)
ifndef link_rule_mk
link_rule_mk := 1
link = $(ldxx) $(elinkflags) $(domap) -o $(export_exe) \
$(export_obj) -lpwr_co
endif
/**
* 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.
**/
/* pn_viewer.cpp -- Profinet viewer */
#include "glow_std.h"
#include <stdio.h>
#include <stdlib.h>
#include "co_cdh.h"
#include "co_time.h"
#include "co_dcli.h"
#include "co_error.h"
#include "co_lng.h"
#include "co_xhelp.h"
#include "pn_viewer_pnac.h"
#include "pn_viewer.h"
PnViewer::PnViewer(
void *v_parent_ctx,
const char *v_name,
pwr_tStatus *status) :
parent_ctx(v_parent_ctx), viewernav(NULL), wow(0), input_open(0), pnet(0), close_cb(0)
{
strcpy( name, v_name);
pnet = new PnViewerPNAC( status);
}
PnViewer::~PnViewer()
{
delete pnet;
}
void PnViewer::update_devices()
{
dev_vect.clear();
pnet->fetch_devices( dev_vect);
viewernav->set( dev_vect);
}
void PnViewer::set_device_properties( unsigned char *macaddress, unsigned char *ipaddress,
char *devname)
{
pnet->set_device_properties( macaddress, ipaddress, devname);
}
void PnViewer::change_value( void *ctx)
{
PnViewer *viewer = (PnViewer *) ctx;
viewer->open_change_value();
}
void PnViewer::message_cb( void *ctx, int severity, const char *msg)
{
PnViewer *viewer = (PnViewer *) ctx;
viewer->message( severity, msg);
}
void PnViewer::activate_update()
{
try {
update_devices();
}
catch( co_error &e) {
printf( "** Update exception: %s\n", e.what().c_str());
}
}
void PnViewer::activate_setdevice()
{
pwr_tStatus sts;
ItemDevice *dev;
sts = viewernav->get_selected_device( &dev);
if ( EVEN(sts)) {
message( 'E', "Select a device");
return;
}
try {
set_device_properties( dev->macaddress, dev->ipaddress,
dev->devname);
}
catch ( co_error &e) {
printf( "** Exception, %s\n", e.what().c_str());
}
}
void PnViewer::activate_changevalue()
{
open_change_value();
}
void PnViewer::activate_close()
{
if ( close_cb)
close_cb( parent_ctx);
else {
delete this;
exit(0);
}
}
void PnViewer::activate_help()
{
CoXHelp::dhelp( "profinet_viewer", 0, navh_eHelpFile_Other, "$pwr_lang/man_pb.dat",
true);
}
/**
* 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 pn_viewer_h
#define pn_viewer_h
/* pn_viewer.h -- Profinet viewer */
#include <vector>
#ifndef pwr_h
# include "pwr.h"
#endif
#ifndef pn_viewernav_h
# include "pn_viewernav.h"
#endif
class CoWow;
class CoWowFocusTimer;
class PnViewerPNAC;
class PnViewer {
public:
PnViewer(
void *v_parent_ctx,
const char *v_name,
pwr_tStatus *status);
virtual ~PnViewer();
virtual void message( char severity, const char *msg) {}
virtual void set_prompt( const char *prompt) {}
virtual void open_change_value() {}
void update_devices();
void set_device_properties( unsigned char *macaddress, unsigned char *ipaddress,
char *devname);
void activate_update();
void activate_setdevice();
void activate_changevalue();
void activate_close();
void activate_help();
static void change_value( void *ctx);
static void message_cb( void *ctx, int severity, const char *msg);
void *parent_ctx;
char name[80];
PnViewerNav *viewernav;
CoWow *wow;
int input_open;
vector<PnDevice> dev_vect;
PnViewerPNAC *pnet;
void (*close_cb)( void *);
};
#endif
/**
* 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.
**/
/* pn_viewer_pnac.cpp -- Profinet viewer PNAC interface */
#include "co_error.h"
#include "pn_viewer_pnac.h"
PnViewerPNAC::PnViewerPNAC( pwr_tStatus *sts)
{
// Init PNAC
*sts = 1;
}
PnViewerPNAC::~PnViewerPNAC()
{
// Close PNAC
}
void PnViewerPNAC::fetch_devices( vector<PnDevice>& dev_vect)
{
PnDevice d1;
strcpy( d1.devname, "D1");
d1.ipaddress[3] = 168;
d1.ipaddress[2] = 192;
d1.ipaddress[1] = 101;
d1.ipaddress[0] = 56;
d1.macaddress[0] = 255;
d1.macaddress[1] = 255;
d1.macaddress[2] = 255;
d1.macaddress[3] = 36;
d1.macaddress[4] = 9;
d1.macaddress[5] = 22;
d1.vendorid = 42;
d1.deviceid = 769;
dev_vect.push_back(d1);
PnDevice d2;
strcpy( d2.devname, "D2");
d2.ipaddress[3] = 168;
d2.ipaddress[2] = 192;
d2.ipaddress[1] = 101;
d2.ipaddress[0] = 57;
d2.macaddress[0] = 255;
d2.macaddress[1] = 255;
d2.macaddress[2] = 255;
d2.macaddress[3] = 36;
d2.macaddress[4] = 9;
d2.macaddress[5] = 23;
d2.vendorid = 42;
d2.deviceid = 769;
dev_vect.push_back(d2);
PnDevice d3;
strcpy( d3.devname, "D3");
d3.ipaddress[3] = 168;
d3.ipaddress[2] = 192;
d3.ipaddress[1] = 101;
d3.ipaddress[0] = 58;
d3.macaddress[0] = 255;
d3.macaddress[1] = 255;
d3.macaddress[2] = 255;
d3.macaddress[3] = 36;
d3.macaddress[4] = 9;
d3.macaddress[5] = 24;
d3.vendorid = 42;
d3.deviceid = 769;
dev_vect.push_back(d3);
PnDevice d4;
strcpy( d4.devname, "D4");
d4.ipaddress[3] = 168;
d4.ipaddress[2] = 192;
d4.ipaddress[1] = 101;
d4.ipaddress[0] = 59;
d4.macaddress[0] = 255;
d4.macaddress[1] = 255;
d4.macaddress[2] = 255;
d4.macaddress[3] = 36;
d4.macaddress[4] = 9;
d4.macaddress[5] = 25;
d4.vendorid = 42;
d4.deviceid = 769;
dev_vect.push_back(d4);
PnDevice d5;
strcpy( d5.devname, "D5");
d5.ipaddress[3] = 168;
d5.ipaddress[2] = 192;
d5.ipaddress[1] = 101;
d5.ipaddress[0] = 60;
d5.macaddress[0] = 255;
d5.macaddress[1] = 255;
d5.macaddress[2] = 255;
d5.macaddress[3] = 36;
d5.macaddress[4] = 9;
d5.macaddress[5] = 26;
d5.vendorid = 266;
d5.deviceid = 1;
dev_vect.push_back(d5);
PnDevice d6;
strcpy( d6.devname, "D6");
d6.ipaddress[3] = 168;
d6.ipaddress[2] = 192;
d6.ipaddress[1] = 100;
d6.ipaddress[0] = 55;
d6.macaddress[0] = 200;
d6.macaddress[1] = 1;
d6.macaddress[2] = 0;
d6.macaddress[3] = 201;
d6.macaddress[4] = 202;
d6.macaddress[5] = 203;
d6.vendorid = 285;
d6.deviceid = 750;
dev_vect.push_back(d6);
// if ( ...error... ) throw co_error_str( "Somethings is wrong...");
}
void PnViewerPNAC::set_device_properties( unsigned char *macaddress, unsigned char *ipaddress,
char *devname)
{
printf( "Set %s %hhu.%hhu.%hhu.%hhu\n", devname, ipaddress[3],
ipaddress[2], ipaddress[1], ipaddress[0]);
}
/**
* 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 pn_viewer_pnac_h
#define pn_viewer_pnac_h
/* pn_viewer_pnac.h -- Profinet viewer PNAC interface */
#ifndef pwr_h
# include "pwr.h"
#endif
#ifndef pn_viewernav_h
# include "pn_viewernav.h"
#endif
class PnViewerPNAC {
public:
PnViewerPNAC( pwr_tStatus *sts);
~PnViewerPNAC();
void fetch_devices( vector<PnDevice>& dev_vect);
void set_device_properties( unsigned char *macaddress, unsigned char *ipaddress,
char *devname);
};
#endif
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 pn_viewernav_h
#define pn_viewernav_h
/* pn_viewernav.h -- Profinet viewer */
#include <vector>
#ifndef pwr_h
# include "pwr.h"
#endif
#ifndef pwr_class_h
# include "pwr_class.h"
#endif
#ifndef flow_h
#include "flow.h"
#endif
#ifndef flow_browctx_h
#include "flow_browctx.h"
#endif
#ifndef flow_browapi_h
#include "flow_browapi.h"
#endif
class PnDevice {
public:
PnDevice() {}
unsigned char ipaddress[4];
unsigned char macaddress[6];
char devname[80];
int vendorid;
int deviceid;
};
class ItemDevice;
typedef enum {
viewitem_eItemType_Device,
viewitem_eItemType_DeviceAttr
} viewitem_eItemType;
class PnViewerNavBrow {
public:
PnViewerNavBrow( BrowCtx *brow_ctx, void *lvnav) : ctx(brow_ctx), viewernav(lvnav) {};
~PnViewerNavBrow();
BrowCtx *ctx;
void *viewernav;
brow_tNodeClass nc_device;
brow_tNodeClass nc_attr;
flow_sAnnotPixmap *pixmap_map;
flow_sAnnotPixmap *pixmap_openmap;
flow_sAnnotPixmap *pixmap_attr;
flow_sAnnotPixmap *pixmap_edit;
void free_pixmaps();
void allocate_pixmaps();
void create_nodeclasses();
void brow_setup();
};
class PnViewerNav {
public:
PnViewerNav( void *v_parent_ctx);
virtual ~PnViewerNav();
void *parent_ctx;
PnViewerNavBrow *brow;
void (*change_value_cb)( void *);
void (*message_cb)( void *, int, const char *);
virtual void set_input_focus() {}
void message( int severity, const char *msg);
void zoom( double zoom_factor);
void unzoom();
void set( vector<PnDevice>& dev_vect);
int set_attr_value( char *value_str);
int check_attr_value();
int get_selected_device( ItemDevice **device);
void vendorid_to_str( unsigned int vendorid, char *vendorid_str, int size);
void get_device_info( unsigned int vendorid, unsigned int deviceid,
char *info, int info_size, char *family, int family_size);
static int init_brow_cb( FlowCtx *fctx, void *client_data);
static int brow_cb( FlowCtx *ctx, flow_tEvent event);
};
class ItemDevice {
public:
ItemDevice( PnViewerNav *viewernav, const char *item_name,
unsigned char *item_ipaddress, unsigned char *item_macaddress, char *item_devname,
int vendorid, int deviceid,
brow_tNode dest, flow_eDest dest_code);
viewitem_eItemType type;
PnViewerNav *viewernav;
brow_tNode node;
unsigned char ipaddress[4];
unsigned char macaddress[8];
char ipaddress_str[20];
char macaddress_str[20];
char devname[80];
int vendorid;
int deviceid;
char vendorid_str[80];
char deviceid_str[20];
char infotext[200];
char family[80];
int open_children( PnViewerNav *viewernav);
void close( PnViewerNav *viewernav);
virtual ~ItemDevice() {}
};
class ItemDeviceAttr {
public:
ItemDeviceAttr( PnViewerNav *viewernav, const char *item_name, pwr_eType item_attr_type,
void *item_p, brow_tNode dest, flow_eDest dest_code);
viewitem_eItemType type;
char name[80];
pwr_eType attr_type;
PnViewerNav *viewernav;
brow_tNode node;
void *p;
virtual ~ItemDeviceAttr() {}
};
#endif
# Processing file: /home/claes/gsdml/GSDML-V1.0-HirschmannAutomationAndControl-RS20-1600T1T1SDAPPH-20070808.xml
304 4
Hirschmann Railswitch
Hirschmann PROFINET Switch
# Processing file: /home/claes/gsdml/GSDML-V1.0-Hms-ABSPRT-20060321.xml
268 1
Anybus
Anybus-S PROFINET IO module
# Processing file: /home/claes/gsdml/GSDML-V1.0-Murrelektronik-Cube67 BN PNIO-20060914.xml
303 56506
Cube67
Cube67 BN-PNIO
# Processing file: /home/claes/gsdml/GSDML-V1.0-OMRON-GRT1-PNT-20080325.xml
328 8192
GRT1-PNT
Omron PROFINET IO device
# Processing file: /home/claes/gsdml/GSDML-V1.0-OMRON-GRT1-PNT-20080327.xml
328 8192
GRT1-PNT
Omron PROFINET IO device
# Processing file: /home/claes/gsdml/GSDML-V1.0-Phoenix Contact-FL IL 24 BK-PN-V1.0-20070306.xml
176 3
Inline
Inline bus coubler for PROFINET IO
# Processing file: /home/claes/gsdml/GSDML-V1.0-Phoenix Contact-ILB PN 24 DI16 DIO16-2TX-V1.9-20070726.xml
176 4
Inline
Inline Block digital input-/outputmodule for PROFINET IO-Systems
# Processing file: /home/claes/gsdml/GSDML-V1.0-SEW-DFE12B-20050317.xml
266 1
SEW
Frequency inverter Movidrive B
# Processing file: /home/claes/gsdml/GSDML-V1.0-Softing-DevKit-20060719.xml
279 0
DEVKIT
Softing PROFINET IO Developers Kit
# Processing file: /home/claes/gsdml/gsdml-v2.0-beckhoff-BK9103-20061213.xml
288 9000
BK Device
BK products, protection type IP20
# Processing file: /home/claes/gsdml/GSDML-V2.0-Lenze-9400PN100-20070901.xml
262 37888
V9400
V9400 PROFINET IO Interface
# Processing file: /home/claes/gsdml/GSDML-V2.0-Lenze-9400PN100Patch-20081210.xml
262 1024
V9400
V9400 PROFINET IO Interface
# Processing file: /home/claes/gsdml/GSDML-V2.0-Siemens-CP3431Lean-20060711.xml
42 515
SIMATIC S7-CP
Communications processors for SIMATIC S7
# Processing file: /home/claes/gsdml/GSDML-V2.0-Siemens-IeAsiLink-20060807.xml
42 1539
IE/AS-i LINK PN IO
IE/AS-i LINK PN IO
# Processing file: /home/claes/gsdml/GSDML-V2.0-Turck-BL67-20070402.xml
317 1
TURCK
BL67-GW Profinet IO
# Processing file: /home/claes/gsdml/GSDML-V2.1-Murrelektronik-MVK_MPNIO-20080104.xml
303 55289
MVK ProfiNet
ProfiNet IO module, IP67 protection type
# Processing file: /home/claes/gsdml/GSDML-V2.1-Siemens-002A-SCALANCE_X200-20070416.xml
42 2561
SCALANCE X-200
Switching Devices for Industial Ethernet
# Processing file: /home/claes/gsdml/gsdml-v2.1-siemens-et200m-20070920.xml
42 770
ET 200M
Finely-graduated modular distributed IO device, protection type IP20
# Processing file: /home/claes/gsdml/gsdml-v2.1-siemens-et200pro-20071108.xml
42 773
ET 200pro
Modular distributed I/O device, protection type IP65
# Processing file: /home/claes/gsdml/gsdml-v2.1-siemens-et200s-20070701.xml
42 769
ET 200S
Finely-graduated modular distributed IO device, protection type IP20
# Processing file: /home/claes/gsdml/gsdml-v2.1-siemens-pnpnioc-20060830.xml
42 1540
PN/PN Coupler
PN/PN Coupler
# Processing file: /home/claes/gsdml/GSDML-V2.1-Softing-PNIODevKit-20081030.xml
279 259
Softing AG PROFINET IO Reference Device
Portations of Softing's PROFINET IO Device stack to various hardware platforms
# Processing file: /home/claes/gsdml/gsdml-v2.1-wago-series750_753-20080520.xml
285 750
WAGO-I/O-SYSTEM 750/753
Finely-graduated modular distributed I/O device, protection type IP20
# Processing file: /home/claes/gsdml/test.xml
328 8192
GRT1-PNT
# Processing file: /home/claes/gsdml/GSDML-V2.0-ABBdrives-RETA02-20070621.xml
26 1
ABB RETA-02
PROFINET IO module RETA-02
# Processing file: /home/claes/gsdml/GSDML-V1.0-PhoenixContact-FL-SWITCH-MC-16TX-V1.0-20051207.xml
176 19
Factory Line
Managed Switch as Profinet IO Device
# Processing file: /home/claes/gsdml/t.xml
42 770
ET 200M
Finely-graduated modular distributed IO device, protection type IP20
1 Acromag
10 Brooks Instrument
100 Oval
101 Masoneilan-Dresser
102 BESTA
103 Ohmart
104 Harold Beck and Sons
105 rittmeyer instrumentation
106 Rössel Messtechnik
107 Wika
108 Bopp &amp; Reuther Messtechnik
109 PR Electronics
11 Chessell
110 Jordan Controls
111 Valcom s.r.l.
112 US ELECTRIC MOTORS
113 Apparatebau Hundsbach
114 Dynisco
115 Spriano
116 Direct Measurement
117 Klay Instruments
118 CiDRA Corporate Services
119 MMG AM DTR
12 Combustion Engineering
120 buerkert fluid control systems
121 AALIANT Process Mgt.
122 PONDUS INSTRUMENTS
123 ZAP S.A. Ostrow Wielkopolski
124 GLI
125 Fisher-Rosemount Performance Technologies
126 Paper Machine Components
127 LABOM
128 Danfoss Antriebs-und Regeltechnik GmbH
129 Turbo
13 Daniel Industries
130 TOKYO KEISO
131 SMC
132 Status Instruments
133 Huakong
134 Duon System
135 Vortek Instruments, LLC
136 AG Crosby
137 Action Instruments
138 Keystone Controls
139 Thermo Electric Co.
14 Delta
140 ISE-Magtech
141 Rueger
142 Mettler Toledo GmbH
143 Det-Tronics
144 Thermo Measure Tech
145 DeZURIK
146 Phase Dynamics
147 WELLTECH SHANGHAI
148 ENRAF
149 4tech ASA
15 Dieterich Standard
150 Brandt Instruments
151 Nivelco
152 Camille Bauer
153 Metran
154 Milton Roy Co.
155 PMV
156 Turck (Tianjin) Sensor Co., Ltd.
157 Panametrics
158 Stahl
159 Analytical Technology, Inc
16 Dohrmann
160 FINT
161 Berthold Technologies GmbH &amp; Co.KG
162 InterCorr
163 China BRICONTE Co Ltd
164 Electron Machine
165 Sierra Instruments
166 Fluid Components Int
167 Solid AT
168 Meriam Instrument
169 Invensys
17 Endress+Hauser
170 S-Products
171 Tyco Valves &amp; Controls
172 Micro Matic Instrument A/S
173 J-Tec Associates
174 TRACERO
175 AGAR
176 Phoenix Contact GmbH &amp; Co. KG
177 Andean Instruments
178 Amer. Level Instr.
179 Hawk
18 ABB
180 YTC
181 Pyromation Inc.
182 Satron Instruments
183 BIFFI
184 SAIC
185 BD Sensors
186 Andean Instruments
187 Kemotron
188 APLISENS SP. Z O.O.
189 Badger Meter
19 Fisher Controls
190 HIMA
191 GP:50
192 Kongsberg Maritime
193 ASA S.p.A.
194 Hengesbach
195 Lanlian Instruments
197 Kajaani Process Measurements
198 FAFNIR
199 SICK-MAIHAK
2 Allen Bradley
20 Foxboro
200 JSP Nova Paka
201 MESACON
202 Spirax Sarco Italy
203 L&amp;J TECHNOLOGIES
204 Tecfluid S.A.
205 Sailsors Instruments
206 Roost
207 KOSO
208 MJK
209 GE Energy
21 Fuji
210 BW Technologies
211 HEINRICHS Messtechnik
212 SIC
213 HACH LANGE
214 Exalon Instruments
215 FAURE HERMAN
216 STI S.r.l.
217 Manometr-Kharkiv
218 Dalian-Instruments
219 Spectrex
22 ABB
220 SIPAI Instruments
221 Advanced Flow
222 Rexa. Koso America
223 General Monitors, Inc.
224 Manufacturer Expansion
23 Honeywell AG
2351 Pilz
24 ITT Barton
2403 Prozesskommunikation, TU Dresden
24576 ExSaf
24577 SEOJIN INSTECH
24578 TASI FLOW
24579 Daehan Control
24580 APM
24581 ORANGE INST. UK
24582 BARTEC
24583 Detcon
24584 MSA
24585 METROVAL
24586 Etalon Rus
25 Thermo Measure Tech
256 Rüeger
257 SICK AG
258 ASCO JOUCOMATIC GmbH &amp; Co.
259 Bosch Rexroth AG
26 ABB
260 ESR Pollmeier
261 Kollmorgen Seidel
262 Lenze
263 Loher
264 Mitsubishi Electric Europe B.V. Niederlassung Deutschland
265 Moeller GmbH
266 SEW-EURODRIVE GmbH &amp; Co.
267 Stöber
268 HMS Industrial Networks GmbH
269 Züllig
27 Leeds &amp; Northrup
270 BARTEC GmbH
271 Parker Hannifin Compumotor
272 Fraba Posital
273 YASKAWA Electric GmbH
274 Baumüller Nürnberg El.GmbhCo
279 SOFTING AG
28 Leslie
280 BEKA associates Ltd.
281 Elektro-Elektronik Pranjic
282 Eurotherm Automation
283 Dr. Bruno Lange GmbH &amp; Co. KG
284 JH Group
285 WAGO Kontakttechnik GmbH
286 Hilscher Gesellschaft für Systemautomation mbH
287 Bosch Rexroth AG
288 Beckhoff Industrie Elektronik
289 Bihl+Wiedemann GmbH
29 M-System Co.
291 Swan Analytical Instruments
292 Deutschmann Automation GmbH&amp;Co.KG
293 Rotork Controls Ltd.
294 Leuze Lumiflex GmbH+Co.KG
295 Woodhead Software &amp; Electronics
296 Berger Lahr
297 Schneider Electric
298 Baumer IVO GmbH &amp; Co. KG
299 Werner Turck GmbH &amp; Co. KG
3 Ametek
30 Measurex
300 G. Bachmann Electronic GmbH
301 HORIBA STEC, Co.,Ltd.
302 Maschinenfabrik Spaichingen
303 Murrelektronik GmbH
304 Hirschmann Automation and Control GmbH
305 Drehmo GmbH
306 AGILiCOM
307 L. Bernard SA
308 Weidmüller
309 EUCHNER GmbH + Co.KG
31 Micro Motion
310 ifm electronic GmbH
311 Cognex Corp.
312 Markator
313 Beaufort Cay Corporation
314 Baldor Motors &amp; Drives
315 VitalSensors Technologies LLC
316 Optris GmbH
317 Hans Turck GmbH &amp; Co.KG
318 SymCom, Inc.
319 AUMA Riester GmbH &amp; Co.KG
32 Moore Industries
320 CREVIS Co.,Ltd
321 SIPOS Aktorik
322 testo AG
323 ProMinent Dosiertechnik GmbH
324 Systemtechnik LEBER GmbH &amp; Co.KG
325 Smart Network Devices GmbH
326 KSB Aktiengesellschaft
327 Ing. Punzenberger COPA-DATA GmbH
328 Omron Europe BV
329 Real Time Automation
33 PRIME Measurement Products
330 Grundfos
331 attoSensor GmbH
332 AquaSensors LLC
333 Festo AG &amp; Co. KG
334 MESCO Engineering GmbH
335 TMG TE GmbH
336 Ropex Industrie-Elektronik
337 vögtlin instruments ag
338 Leuze electronic GmbH + Co. KG
339 TR-Electronic GmbH
34 Ohkura Electric
340 FOGALE Nanotech
341 Industrial Control Communications, Inc. (ICC)
342 Contrinex AG Industrial Electronics
343 DRS Power &amp; Control Technologies, Inc.
344 AALBORG INSTRUMENTS
345 TWK-ELEKTRONIK GmbH
346 GE Fanuc Automation, Inc.
347 Sensopart Industriesensorik GmbH
348 HYDAC ELECTRONIC GMBH
349 esd electronic system design gmbh
35 Paine
350 Baumer Electric AG
351 Lenord, Bauer &amp; Co.GmbH
352 Control Techniques Ltd.
353 Siebert Industrieelektronik GmbH
354 Knorr-Bremse AG
355 Comtrol Corporation
356 IfTA GmbH
357 Sprecher + Schuh USA
358 GE Consumer &amp; Industrial
359 Hitachi High-Technologies Corporation
36 Rochester Instrument Systems
360 ACS-Control-System GmbH
361 Höntzsch GmbH
362 Lumberg Automation - Belden Deutschland GmbH
363 Anhui WNK Electronic Engineering Co.,Ltd.
364 Microcyber Inc.
365 Comsoft GmbH
366 Morgan Korea Ltd.
367 WEG
368 Matuschek
369 Graco Inc.
37 Ronan
370 Banner Engineering Corp.
371 KEBA AG
372 KW-Software GmbH
373 ProSoft Technology, Inc.
374 IXXAT Automation GmbH
375 KEB Antriebstechnik
376 Kontron Modular Computers GmbH
377 Varian Inc.
378 Inficon AG
379 Sartorius Mechatronics T&amp;H GmbH
38 Rosemount
380 LTi DRiVES GmbH
381 Jacobs Automation
382 Dürr Systems GmbH
383 Cisco Systems, Inc.
384 ATI Industrial Automation
386 BEI IDEACOD
387 miControl GmbH
388 Jokab Safety AB
389 Moog
39 Peek Measurement
390 optek-Danulat
391 sibotech Co.
392 AEG Power Solutions GmbH
393 NORD Electronic DRIVESYSTEMS GmbH
394 Leine &amp; Linde AB
395 NDC Infrared Engineering Ltd
396 NEC Electronics (Europe) GmbH
397 Wieland Electric GmbH
398 GE Healthcare
399 LappGroup
40 Actaris Neptune
400 Toshiba Schneider Inverter Corporation
401 GEMUE Gebr. Mueller Apparatebau GmbH &amp; Co. KG
402 Delta Computer Systems, Inc.
403 HARTING
404 Harms &amp; Wende GmbH &amp; Co. KG
405 Accutron Controls International Inc.
406 Quiss GmbH
407 Lipowsky Industrie-Elektronik GmbH
408 Fritz Kuebler GmbH
409 GH Electrotermia S.A.
41 Sensall
410 Alcatel-Lucent Deutschland AG; Components Division - Dunkermotoren
411 KUKA Roboter GmbH
414 embeX GmbH
42 SIEMENS AG
43 Weed
44 Toshiba Corp.
444 profichip GmbH
45 Transmation
46 Rosemount Analytic
47 Metso Automation
48 Flowserve
49 Varec
5 ABB
50 Viatran
51 Delta / Weed
52 Westinghouse
53 Xomox
54 Yamatake
55 Yokogawa
555 VIPA GmbH
56 Nuovo Pignone
57 Promac
58 Exac Corporation
59 Mobrey Measurement
6 Beckman
60 Arcom Control Systems
61 Princo
61440 F000 - FFFF reserviert für herstellerübergreifende Profile bei PROFINET
62 SMAR Meß- und Regeltechnik GmbH
63 Foxboro Eckardt
64 Measurement Technology
65 Applied System Technologies
65535 F000 - FFFF reserviert für herstellerübergreifende Profile bei PROFINET
66 SAMSON AG
67 Sparling Instruments
68 Fireye
69 KROHNE Messtechnik GmbH &amp; Co.KG
7 Bell Microsensor
70 Betz
71 Druck
72 SOR
73 Elcon Instruments
74 EMCO
75 Termiflex Corporation
7556 Elomatic
76 VAF Instruments
77 Westlock Controls
777 ifak e.V. Magdeburg
78 Drexelbrook
79 Saab Tank Control
793 Bernstein AG
8 Bourns
80 K-TEK
81 SENSIDYNE, INC
82 Draeger
83 Raytek
84 Siemens Milltronics PI
85 BTG Engineering B.V.
86 Magnetrol
87 Metso Automation
88 Siemens Milltronics PI
888 Balluff GmbH
8888 ifak system
89 HELIOS
9 Bristol Babcock
90 Anderson Instrument Company
91 INOR AB
92 ROBERTSHAW
93 PEPPERL+FUCHS GmbH
94 ACCUTECH
95 Flow Measurement
96 Baumer A/S
97 Knick
98 VEGA Grieshaber KG
99 MTS Systems Corporation
/*
* Proview $Id$
* Copyright (C) 2005 SSAB Oxelösund 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.
*/
/* profinet_viewer.cpp Profinet viewer */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "pwr.h"
static void usage()
{
printf("\nUsage: profinet_viewer\n");
}
int main( int argc, char *argv[])
{
int i;
int found = 0;
char wmg[80];
pwr_tFileName file;
if ( argc > 1) {
for ( i = 1; i < argc; i++) {
if ( strcmp( argv[i], "-f") == 0) {
if ( i+1 >= argc) {
usage();
exit(0);
}
found = 1;
strcpy( wmg, argv[i+1]);
i++;
}
}
}
if ( !found)
strcpy( wmg, "gtk");
strcpy( file, argv[0]);
strcat( file, "_");
strcat( file, wmg);
execvp( file, argv);
}
BEGIN {
ininfo = 0;
par = "";
}
{
if ( $1 == "<Manufacturer") {
par = substr($2,5,length($2)-6);
printf( "%s ", par);
}
if ( ininfo == 1) {
par = substr($0,23,length($0)-41);
printf( "%s\n", par);
ininfo = 0;
}
if ( $1 == "<ManufacturerInfo>") {
ininfo = 1;
}
}
<topic> __DocumentTitlePage
<image> pwr_logga.gif
<h1> Operator's Guide
<hr>
2009-08-04
Version 4.7.0
<hr>
</topic>
<topic> __DocumentInfoPage
Copyright 2009 SSAB Oxelösund AB
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
Texts.
</topic>
<option> printdisable
<topic> index
Pofinet
<image> pwr_logga.gif
<h1>Profnet
Profinet Viewer <link> profinet_viewer
</topic>
<option> printenable
<chapter>
<topic> profinet_viewer
Profinet Viewer
The Profinet Viewer dispays a list of the current devices one the Profinet circuit.
It is also possible to set the name and ip address to a device.
<h1>Set devicename and ip address
When a device is exchanged the devicename of the old device has to be set to the new device.
In some cases the ip address has to be set as well. Also when a device is configured for the
first time, the device name and ip address has to be set on the device.
The steps to set the devicename and ip address is:
- Stop Proview runtime environment on the current node.
- Start the Profinet Viewer.
- Find the new device in the list of devices.
- Open the device and enter the new name i DeviceName, by selecting DeviceName and press
the Arrow Right Key. An input field is opened where the new name is entered.
- Enter a new ip address by selecting Ip Address and press the Arrow Right Key. An input field
is opened where the new address is entered.
- Select the device and activate Function/Set Device Properties in the menu. Now the
new name and ip address is transfered to the node.
- Activate Functions/Update to update the list and check the settings of the new device.
<h1>Set IP address
<image>pb_fig1.png
<b>Fig The Profinet Viewer
</topic>
</chapter>
\ No newline at end of file
......@@ -235,6 +235,7 @@ copy : $(export_pdf) $(export_pdf_en_us) $(export_pdf_sv_se) \
$(doc_dir)/en_us/man_geref_index.html $(doc_dir)/sv_se/man_geref_index.html \
$(doc_dir)/en_us/man_geref.pdf $(doc_dir)/sv_se/man_geref.pdf \
$(doc_dir)/en_us/man_geref.ps $(doc_dir)/sv_se/man_geref.ps \
$(exe_dir)/en_us/man_pb.dat $(exe_dir)/sv_se/man_pb.dat \
$(exe_dir)/man_subgraph.dat \
$(doc_dir)/en_us/man_subgraph_index.html \
$(doc_dir)/en_us/man_subgraph.pdf \
......@@ -387,6 +388,14 @@ $(doc_dir)/sv_se/man_geref.ps : $(pwre_sroot)/doc/man/sv_se/man_geref.dat
@ echo "Generating postscript for sv_se/man_geref"
@ co_convert -n -d $(doc_dir)/sv_se $(source)
$(exe_dir)/en_us/man_pb.dat : $(pwre_sroot)/doc/man/en_us/man_pb.dat
@ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target)
$(exe_dir)/sv_se/man_pb.dat : $(pwre_sroot)/doc/man/en_us/man_pb.dat
@ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target)
$(exe_dir)/en_us/man_orm.dat : $(pwre_sroot)/doc/man/en_us/man_orm.dat
@ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target)
......
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