Commit da4cb706 authored by claes's avatar claes

Division in modules

parent d13ba328
#
# Script to export all classgraphs to java
#
#
#
function int process( string graph)
open 'graph'
printf( "Exporting %s...\n", graph);
export java
endfunction
main()
process( "pwr_c_abb_acs800_1");
process( "pwr_c_abb_acs800fanaggr");
process( "pwr_c_abb_acs800motoraggr");
process( "pwr_c_abb_acs800pumpaggr");
endmain
#! /bin/bash #! /bin/bash
# #
# Proview $Id: upgrade_cnvdmp.sh,v 1.2 2005-09-01 14:57:49 claes Exp $ # Proview $Id: upgrade_cnvdmp.sh,v 1.3 2005-12-30 15:47:43 claes Exp $
# Copyright (C) 2005 SSAB Oxelsund AB. # Copyright (C) 2005 SSAB Oxelsund AB.
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
...@@ -32,6 +32,14 @@ s/Attr parent_node_did = /Attr poid = / ...@@ -32,6 +32,14 @@ s/Attr parent_node_did = /Attr poid = /
s/Attr dest_node_did = /Attr dest_oid = / s/Attr dest_node_did = /Attr dest_oid = /
s/Attr source_node_did = /Attr source_oid = / s/Attr source_node_did = /Attr source_oid = /
s/Attr reset_objdid = /Attr reset_oid = / s/Attr reset_objdid = /Attr reset_oid = /
s/pwrb:Ai_AI32uP/SsabOx:Ai_AI32uP/
s/pwrb:Ai_HVAI32/SsabOx:Ai_HVAI32/
s/pwrb:Ao_AO8uP/SsabOx:Ao_AO8uP/
s/pwrb:Ao_HVAO4/SsabOx:Ao_HVAO4/
s/pwrb:Co_CO4uP/SsabOx:Co_CO4uP/
s/pwrb:Co_PI24BO/SsabOx:Co_PI24BO/
s/pwrb:Di_DIX2/SsabOx:Di_DIX2/
s/pwrb:Do_HVDO32/SsabOx:Do_HVDO32/
/PlcProgram$/{ /PlcProgram$/{
N N
N N
...@@ -62,3 +70,4 @@ s/Attr classid = /Attr cid =/ ...@@ -62,3 +70,4 @@ s/Attr classid = /Attr cid =/
} }
' $1 > $2 ' $1 > $2
#!/bin/bash
#
# Edit a base wb_load-file with classeditor
#
export pwr_exe=$pwr_eexe
export pwr_load=$pwr_eload
wb -c $1
\ No newline at end of file
#include "rt_io_base.h"
pwr_dImport pwr_BindIoMethods(Node);
pwr_dImport pwr_BindIoMethods(Pb_Profiboard);
pwr_dImport pwr_BindIoMethods(Pb_DP_Slave);
pwr_dImport pwr_BindIoMethods(Pb_Module);
pwr_dImport pwr_BindIoMethods(Pb_Di);
pwr_dImport pwr_BindIoMethods(Pb_Do);
pwr_dImport pwr_BindIoMethods(Pb_Ai);
pwr_dImport pwr_BindIoMethods(Pb_Ao);
pwr_dImport pwr_BindIoMethods(Pb_Ii);
pwr_dImport pwr_BindIoMethods(Pb_Io);
pwr_BindIoClasses(Base) = {
pwr_BindIoClass(Node),
pwr_BindIoClass(Pb_Profiboard),
pwr_BindIoClass(Pb_DP_Slave),
pwr_BindIoClass(Pb_Module),
pwr_BindIoClass(Pb_Di),
pwr_BindIoClass(Pb_Do),
pwr_BindIoClass(Pb_Ai),
pwr_BindIoClass(Pb_Ao),
pwr_BindIoClass(Pb_Ii),
pwr_BindIoClass(Pb_Io),
pwr_NullClass
};
Node
Pb_Profiboard
Pb_DP_Slave
Pb_Module
Pb_Di
Pb_Do
Pb_Ai
Pb_Ao
Pb_Ii
Pb_Io
/*
* Proview $Id: rt_io_methods.h,v 1.1 2005-12-30 15:45:31 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_io_methods_h
#define rt_io_methods_h
/* rt_io_methods.h -- includefile for io methods. */
#ifndef pwr_h
#include "pwr.h"
#endif
typedef struct {
pwr_tObjName MethodName;
pwr_tStatus (*Method)();
} pwr_sMethodBinding;
typedef struct {
pwr_tObjName ClassName;
pwr_sMethodBinding (*Methods)[];
} pwr_sClassBinding;
/* Base methods */
#if defined (__DECC) || defined (OS_LYNX) || defined (OS_LINUX)
# define pwr_BindIoMethods(Class) pwr_sMethodBinding pwr_g ## Class ## _IoMethods[]
# define pwr_BindIoClasses(Type) pwr_sClassBinding pwr_g ## Type ## _IoClassMethods[]
# define pwr_BindIoClass(Class) {#Class, (void *)pwr_g ## Class ## _IoMethods}
# define pwr_BindIoMethod(Method) {#Method, (pwr_tStatus (*)())Method}
#else
# define pwr_BindIoMethods(Class) pwr_sMethodBinding pwr_g/**/Class/**/_IoMethods[]
# define pwr_BindIoClasses(Type) pwr_sClassBinding pwr_g/**/Type/**/_IoClassMethods[]
# define pwr_BindIoClass(Class) {"Class", pwr_g/**/Class/**/_IoMethods}
# define pwr_BindIoMethod(Method) {"Method", (pwr_tStatus (*)())Method}
#endif
/* User methods */
#if defined (__DECC) || defined (OS_LYNX) || defined(OS_LINUX)
#define pwr_BindIoUserMethods(Class) pwr_sMethodBinding pwr_g ## Class ## _IoUserMethods[]
#define pwr_BindIoUserClasses(Type) pwr_sClassBinding pwr_g ## Type ## _IoUserClassMethods[]
#define pwr_BindIoUserClass(Class) {#Class, (void *)pwr_g ## Class ## _IoUserMethods}
#define pwr_BindIoUserMethod(Method) {#Method, (pwr_tStatus (*)())Method}
#else
#define pwr_BindIoUserMethods(Class) pwr_sMethodBinding pwr_g/**/Class/**/_IoUserMethods[]
#define pwr_BindIoUserClasses(Type) pwr_sClassBinding pwr_g/**/Type/**/_IoUserClassMethods[]
#define pwr_BindIoUserClass(Class) {"Class", pwr_g/**/Class/**/_IoUserMethods}
#define pwr_BindIoUserMethod(Method) {"Method", (pwr_tStatus (*)())Method}
#endif
#define pwr_NullMethod {"", NULL}
#define pwr_NullClass {"", NULL}
#endif
/*
* Proview $Id: rt_io_util.c,v 1.1 2005-12-30 15:45:31 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.
*/
#include <stdlib.h>
#include "pwr.h"
#include "pwr_class.h"
#include "rt_gdh.h"
#include "co_cdh.h"
#include "rt_gdh_msg.h"
#include "rt_io_msg.h"
#include "rt_io_base.h"
#include "rt_io_util.h"
#define IO_CLASSES_SIZE 200
/*----------------------------------------------------------------------------*\
Find classes belonging to an specific IO-type.
\*----------------------------------------------------------------------------*/
pwr_tStatus io_GetIoTypeClasses(
io_eType type,
pwr_tClassId **classes,
int *size
)
{
pwr_tStatus sts;
pwr_sClassDef cdef;
pwr_tOid oid;
int add_class;
pwr_sAttrRef aref;
*size = 0;
*classes = calloc( IO_CLASSES_SIZE, sizeof(pwr_tCid));
for ( sts = gdh_GetClassList( pwr_eClass_ClassDef, &oid);
ODD(sts);
sts = gdh_GetNextObject( oid, &oid)) {
aref = cdh_ObjidToAref( oid);
sts = gdh_GetObjectInfoAttrref( &aref, &cdef, sizeof(cdef));
if ( EVEN(sts)) return sts;
add_class = 0;
switch ( type) {
case io_eType_Agent:
if ( cdef.Flags.b.IOAgent)
add_class = 1;
break;
case io_eType_Rack:
if ( cdef.Flags.b.IORack)
add_class = 1;
break;
case io_eType_Card:
if ( cdef.Flags.b.IOCard)
add_class = 1;
break;
default:
return IO__NOMETHOD;
}
if ( add_class) {
if ( *size >= IO_CLASSES_SIZE)
return IO__CLASSEXCEED;
(*classes)[ *size] = cdh_ClassObjidToId( oid);
(*size)++;
}
}
return IO__SUCCESS;
}
/*----------------------------------------------------------------------------*\
Check if class is an IO-type.
\*----------------------------------------------------------------------------*/
int io_CheckClassIoType(
io_eType type,
pwr_tCid cid
)
{
pwr_tStatus sts;
pwr_sClassDef cdef;
pwr_sAttrRef aref;
aref = cdh_ObjidToAref( cdh_ClassIdToObjid( cid));
sts = gdh_GetObjectInfoAttrref( &aref, &cdef, sizeof(cdef));
if ( EVEN(sts)) return 0;
switch ( type) {
case io_eType_Agent:
if ( cdef.Flags.b.IOAgent)
return 1;
break;
case io_eType_Rack:
if ( cdef.Flags.b.IORack)
return 1;
break;
case io_eType_Card:
if ( cdef.Flags.b.IOCard)
return 1;
break;
default: ;
}
return 0;
}
/*
* Proview $Id: rt_io_util.h,v 1.1 2005-12-30 15:45:31 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_io_util_h
#define rt_io_util_h
/* rt_io_util.h -- includefile for io util. */
#ifndef pwr_h
#include "pwr.h"
#endif
#ifndef pwr_class_h
#include "pwr_class.h"
#endif
pwr_tStatus io_GetIoTypeClasses(
io_eType type,
pwr_tClassId **classes,
int *size
);
int io_CheckClassIoType(
io_eType type,
pwr_tCid cid
);
#endif
...@@ -9,19 +9,22 @@ ifndef variables_mk ...@@ -9,19 +9,22 @@ ifndef variables_mk
variables_mk := 1 variables_mk := 1
release_root := $(pwre_broot)/$(os_name)/$(hw_name) release_root := $(pwre_broot)/$(os_name)/$(hw_name)
exp_root := $(release_root)/exp module_root := $(release_root)/$(pwre_bmodule)
exe_dir := $(exp_root)/exe exe_dir := $(module_root)/exe
lib_dir := $(exp_root)/lib lib_dir := $(module_root)/lib
obj_dir := $(exp_root)/obj obj_dir := $(module_root)/obj
cnf_dir := $(exp_root)/cnf cnf_dir := $(module_root)/cnf
db_dir := $(exp_root)/db db_dir := $(module_root)/db
inc_dir := $(exp_root)/inc inc_dir := $(module_root)/inc
lis_dir := $(exp_root)/lis lis_dir := $(module_root)/lis
kit_dir := $(exp_root)/kit kit_dir := $(module_root)/kit
src_dir := $(exp_root)/src src_dir := $(module_root)/src
doc_dir := $(exp_root)/doc load_dir := $(module_root)/load
load_dir := $(exp_root)/load
doc_dir := $(release_root)/exp/doc
elib_dir := $(release_root)/exp/lib
einc_dir := $(release_root)/exp/inc
bld_dir := $(release_root)/bld/$(type_name)/$(comp_name) bld_dir := $(release_root)/bld/$(type_name)/$(comp_name)
tmp_dir := $(release_root)/tmp tmp_dir := $(release_root)/tmp
...@@ -85,7 +88,7 @@ wb_msg_objs := $(obj_dir)/pwr_msg_wb.o $(obj_dir)/pwr_msg_ge.o $(obj_dir)/pwr_m ...@@ -85,7 +88,7 @@ wb_msg_objs := $(obj_dir)/pwr_msg_wb.o $(obj_dir)/pwr_msg_ge.o $(obj_dir)/pwr_m
log_done = log_done =
csetos := -DOS_LINUX=1 -DOS=linux -DHW_X86=1 -DHW=x86 csetos := -DOS_LINUX=1 -DOS=linux -DHW_X86=1 -DHW=x86
cinc := -I$(inc_dir) -I$(hw_source) -I$(os_source) -I$(co_source) -I$(dbinc) -I/usr/X11R6/include -I$(jdk)/include -I$(jdk)/include/linux cinc := -I$(inc_dir) -I$(einc_dir) -I$(hw_source) -I$(os_source) -I$(co_source) -I$(dbinc) -I/usr/X11R6/include -I$(jdk)/include -I$(jdk)/include/linux
rm := rm rm := rm
cp := cp cp := cp
...@@ -110,6 +113,7 @@ ifeq ($(pwre_btype),rls) ...@@ -110,6 +113,7 @@ ifeq ($(pwre_btype),rls)
cflags := -c -O3 -D_GNU_SOURCE -DPWR_NDEBUG -D_REENTRANT cflags := -c -O3 -D_GNU_SOURCE -DPWR_NDEBUG -D_REENTRANT
cxxflags := $(cflags) cxxflags := $(cflags)
linkflags := -O3 -L/usr/local/lib -L$(lib_dir) -lm -lrt linkflags := -O3 -L/usr/local/lib -L$(lib_dir) -lm -lrt
elinkflags := -O3 -L/usr/local/lib -L$(elib_dir) -L$(libdir) -lm -lrt
clis = /lis=$(list) clis = /lis=$(list)
dolist = /lis=$(list) dolist = /lis=$(list)
domap = -Xlinker -Map -Xlinker $(map) domap = -Xlinker -Map -Xlinker $(map)
...@@ -118,6 +122,7 @@ else ...@@ -118,6 +122,7 @@ else
cxxflags := $(cflags) -Wno-deprecated cxxflags := $(cflags) -Wno-deprecated
mmflags := -Wno-deprecated mmflags := -Wno-deprecated
linkflags := -g -L/usr/local/lib -L$(lib_dir) -lrt linkflags := -g -L/usr/local/lib -L$(lib_dir) -lrt
elinkflags := -g -L/usr/local/lib -L$(elib_dir) -L$(lib_dir) -lrt
dolist = /lis=$(list) dolist = /lis=$(list)
clis := clis :=
domap = -Xlinker -Map -Xlinker $(map) domap = -Xlinker -Map -Xlinker $(map)
......
...@@ -10,18 +10,18 @@ lib_generic_mk := 1 ...@@ -10,18 +10,18 @@ lib_generic_mk := 1
ifndef variables_mk ifndef variables_mk
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/variables.mk -include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/variables.mk
endif endif
ifndef variables_mk ifndef variables_mk
include $(pwre_sroot)/tools/bld/src/$(os_name)/variables.mk include $(pwre_kroot)/tools/bld/src/$(os_name)/variables.mk
endif endif
ifndef rules_mk ifndef rules_mk
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/rules.mk -include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/rules.mk
endif endif
ifndef rules_mk ifndef rules_mk
include $(pwre_sroot)/tools/bld/src/$(os_name)/rules.mk include $(pwre_kroot)/tools/bld/src/$(os_name)/rules.mk
endif endif
source_dirs = $(hw_source) $(os_source) $(co_source) source_dirs = $(hw_source) $(os_source) $(co_source)
...@@ -39,6 +39,7 @@ vpath %.x $(hw_source):$(os_source):$(co_source) ...@@ -39,6 +39,7 @@ vpath %.x $(hw_source):$(os_source):$(co_source)
vpath %.pdr $(hw_source):$(os_source):$(co_source) vpath %.pdr $(hw_source):$(os_source):$(co_source)
vpath %.java $(hw_source):$(os_source):$(co_source) vpath %.java $(hw_source):$(os_source):$(co_source)
vpath %.pwsg $(hw_source):$(os_source):$(co_source) vpath %.pwsg $(hw_source):$(os_source):$(co_source)
vpath %.meth $(hw_source):$(os_source):$(co_source)
source_dirs = $(hw_source) $(os_source) $(co_source) source_dirs = $(hw_source) $(os_source) $(co_source)
...@@ -105,6 +106,15 @@ pwsg_sources := $(sort \ ...@@ -105,6 +106,15 @@ pwsg_sources := $(sort \
) \ ) \
) )
meth_sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/*.meth) \
), $(notdir $(file)) \
) \
)
xdr_includes := $(addprefix $(inc_dir)/,$(patsubst %.x, %.h, $(xdr_sources))) xdr_includes := $(addprefix $(inc_dir)/,$(patsubst %.x, %.h, $(xdr_sources)))
xdr_objects := $(patsubst %.x, %_xdr.o, $(xdr_sources)) xdr_objects := $(patsubst %.x, %_xdr.o, $(xdr_sources))
...@@ -116,6 +126,7 @@ export_includes := $(addprefix $(inc_dir)/,$(h_includes) $(hpp_includes)) ...@@ -116,6 +126,7 @@ export_includes := $(addprefix $(inc_dir)/,$(h_includes) $(hpp_includes))
export_includes += $(xdr_includes) $(pdr_includes) export_includes += $(xdr_includes) $(pdr_includes)
export_pwsg := $(addprefix $(exe_dir)/,$(pwsg_sources)) export_pwsg := $(addprefix $(exe_dir)/,$(pwsg_sources))
export_meth := $(addprefix $(inc_dir)/,$(meth_sources))
clean_h_includes := $(patsubst %.h,clean_%.h, $(h_includes)) clean_h_includes := $(patsubst %.h,clean_%.h, $(h_includes))
clean_hpp_includes := $(patsubst %.hpp,clean_%.hpp, $(hpp_includes)) clean_hpp_includes := $(patsubst %.hpp,clean_%.hpp, $(hpp_includes))
...@@ -144,7 +155,7 @@ all : init copy lib exe ...@@ -144,7 +155,7 @@ all : init copy lib exe
init : dirs init : dirs
copy : $(export_includes) $(l_copy) $(export_pwsg) copy : $(export_includes) $(l_copy) $(export_pwsg) $(export_meth)
lib : $(export_lib) lib : $(export_lib)
......
...@@ -9,22 +9,26 @@ ifndef mmi_generic_mk ...@@ -9,22 +9,26 @@ ifndef mmi_generic_mk
mmi_generic_mk := 1 mmi_generic_mk := 1
ifndef variables_mk ifndef variables_mk
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/variables.mk -include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/variables.mk
endif endif
ifndef variables_mk ifndef variables_mk
include $(pwre_sroot)/tools/bld/src/$(os_name)/variables.mk include $(pwre_kroot)/tools/bld/src/$(os_name)/variables.mk
endif endif
ifndef rules_mk ifndef rules_mk
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/rules.mk -include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/rules.mk
endif endif
ifndef rules_mk ifndef rules_mk
include $(pwre_sroot)/tools/bld/src/$(os_name)/rules.mk include $(pwre_kroot)/tools/bld/src/$(os_name)/rules.mk
endif endif
vpath %.uil $(hw_source):$(os_source):$(co_source) vpath %.uil $(hw_source):$(os_source):$(co_source)
vpath %.pwg $(hw_source):$(os_source):$(co_source)
vpath %.pwsg $(hw_source):$(os_source):$(co_source)
source_dirs := $(hw_source) $(os_source) $(co_source) source_dirs := $(hw_source) $(os_source) $(co_source)
...@@ -37,13 +41,35 @@ uil_sources := $(sort \ ...@@ -37,13 +41,35 @@ uil_sources := $(sort \
) \ ) \
) )
pwg_sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/pwr_c_*.pwg) \
), $(notdir $(file)) \
) \
)
pwsg_sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/$(comp_name)*.pwsg) \
), $(notdir $(file)) \
) \
)
export_uid := $(addprefix $(exe_dir)/, $(patsubst %.uil, %.uid, $(uil_sources))) export_uid := $(addprefix $(exe_dir)/, $(patsubst %.uil, %.uid, $(uil_sources)))
export_pwg := $(addprefix $(exe_dir)/, $(pwg_sources))
export_pwsg := $(addprefix $(exe_dir)/, $(pwsg_sources))
$(exe_dir)/%.uid : %.uil $(exe_dir)/%.uid : %.uil
@ $(log_uil_uid) @ $(log_uil_uid)
@ export -n LANG; uil -o $(target) $(source) @ export -n LANG; uil -o $(target) $(source)
clean_uid := $(patsubst %.uil,clean_%.uid,$(uil_sources)) clean_uid := $(patsubst %.uil,clean_%.uid,$(uil_sources))
clean_pwg := $(patsubst %.pwg,clean_%.pwg,$(pwg_sources))
clean_pwsg := $(patsubst %.pwsg,clean_%.pwsg,$(pwsg_sources))
.PHONY : all init copy lib exe clean realclean\ .PHONY : all init copy lib exe clean realclean\
dirs clean_bld clean_dirs $(clean_uid) dirs clean_bld clean_dirs $(clean_uid)
...@@ -52,13 +78,13 @@ all : init copy ...@@ -52,13 +78,13 @@ all : init copy
init : dirs init : dirs
copy : $(export_uid) copy : $(export_uid) $(export_pwg) $(export_pwsg)
lib : lib :
exe : exe :
clean : $(clean_uid) clean : $(clean_uid) $(clean_pwg) $(clean_pwsg)
realclean : clean realclean : clean
...@@ -68,5 +94,13 @@ $(clean_uid) : clean_%.uid : %.uil ...@@ -68,5 +94,13 @@ $(clean_uid) : clean_%.uid : %.uil
@ echo "Removing uid" @ echo "Removing uid"
@ $(rm) $(rmflags) $(exe_dir)/$*.uid @ $(rm) $(rmflags) $(exe_dir)/$*.uid
$(clean_pwg) : clean_%.pwg : %.pwg
@ echo "Removing pwg"
@ $(rm) $(rmflags) $(exe_dir)/$*.pwg
$(clean_pwsg) : clean_%.pwsg : %.pwsg
@ echo "Removing pwsg"
@ $(rm) $(rmflags) $(exe_dir)/$*.pwsg
endif endif
...@@ -228,4 +228,8 @@ $(doc_dir)/%.html : ../../%.html ...@@ -228,4 +228,8 @@ $(doc_dir)/%.html : ../../%.html
@ $(log_h_h) @ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target) @ $(cp) $(cpflags) $(source) $(target)
$(inc_dir)/%.meth : %.meth
@ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target)
endif endif
# wbl_generic.mk -- generic make file for building wbl components
#
# PROVIEW/R
# Copyright (C) 1996 by Comator Process AB.
#
# <Description>
#
ifndef wbl_generic_mk
wbl_generic_mk := 1
ifndef variables_mk
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/variables.mk
endif
ifndef variables_mk
include $(pwre_kroot)/tools/bld/src/$(os_name)/variables.mk
endif
ifndef rules_mk
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/rules.mk
endif
ifndef rules_mk
include $(pwre_kroot)/tools/bld/src/$(os_name)/rules.mk
endif
vpath %.wb_load $(hw_source):$(os_source):$(co_source)
source_dirs := $(hw_source) $(os_source) $(co_source)
wblsources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/*.wb_load) \
), $(notdir $(file)) \
) \
)
flwsources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/*.flw) \
), $(notdir $(file)) \
) \
)
wbl_sources := $(filter %.wb_load,$(wblsources))
flw_sources := $(filter %.flw,$(flwsources))
export_wbl := $(addprefix $(load_dir)/, $(patsubst %.wb_load, %.dbs, $(wbl_sources)))
export_flw := $(patsubst %.flw,$(load_dir)/%.flw,$(flw_sources))
export_wbl_dbs := $(patsubst %.wb_load,$(load_dir)/%.dbs,$(wbl_sources))
export_wbl_h := $(patsubst %.wb_load,$(inc_dir)/pwr_%classes.h,$(wbl_sources))
export_wbl_hpp := $(patsubst %.wb_load,$(inc_dir)/pwr_%classes.hpp,$(wbl_sources))
export_wbl_xtthelp_en_us := $(patsubst %.wb_load,$(exe_dir)/en_us/%_xtthelp.dat,$(wbl_sources))
export_wbl_xtthelp_sv_se := $(patsubst %.wb_load,$(exe_dir)/sv_se/%_xtthelp.dat,$(wbl_sources))
export_wbl_html_en_us := $(patsubst %.wb_load,$(doc_dir)/en_us/orm/%_allclasses.html,$(wbl_sources))
export_wbl_html_sv_se := $(patsubst %.wb_load,$(doc_dir)/sv_se/orm/%_allclasses.html,$(wbl_sources))
export_wbl_ps_en_us := $(patsubst %.wb_load,$(doc_dir)/en_us/%.ps,$(wbl_sources))
export_wbl_ps_sv_se := $(patsubst %.wb_load,$(doc_dir)/sv_se/%.ps,$(wbl_sources))
clean_dbs := $(patsubst %.wb_load,clean_%.dbs,$(wbl_sources))
clean_h := $(patsubst %.wb_load,clean_%.h,$(wbl_sources))
clean_hpp := $(patsubst %.wb_load,clean_%.hpp,$(wbl_sources))
clean_xtthelp_sv_se := $(patsubst %.wb_load,clean_%_sv_se.xtthelp,$(wbl_sources))
clean_xtthelp_en_us := $(patsubst %.wb_load,clean_%_en_us.xtthelp,$(wbl_sources))
clean_html_sv_se := $(patsubst %.wb_load,clean_%_sv_se.html,$(wbl_sources))
clean_html_en_us := $(patsubst %.wb_load,clean_%_en_us.html,$(wbl_sources))
clean_ps_sv_se := $(patsubst %.wb_load,clean_%_sv_se.ps,$(wbl_sources))
clean_ps_en_us := $(patsubst %.wb_load,clean_%_en_us.ps,$(wbl_sources))
.SUFFIXES:
$(load_dir)/%.dbs : ../../%.wb_load
@ echo "Generating loadfile for $(source)"
@ export pwr_load=$(pwr_eload);\
wb_cmd -q -i create snapshot /file=\"$(source)\"/out=\"$(target)\"
@ chmod a+w $(target)
$(inc_dir)/pwr_%classes.h : ../../%.wb_load
@ echo "Generating struct files for $(source) classes..."
@ co_convert -s -d $(inc_dir) "$(source)"
$(inc_dir)/pwr_%classes.hpp : ../../%.wb_load
@ echo "Generating hpp files for $(source) classes..."
@ co_convert -po -d $(inc_dir) "$(source)"
$(doc_dir)/en_us/orm/%_allclasses.html : ../../%.wb_load
@ echo "Generating html files for $(source) classes en_us..."
@ co_convert -w -d $(doc_dir)/en_us/orm -g $(pwre_sroot)/wbl/mcomp/src/cnv_setup.dat "$(source)"
@ co_convert -c -d $(doc_dir)/en_us/orm $(inc_dir)/pwr_$(source)classes.h
@ co_convert -c -d $(doc_dir)/en_us/orm $(inc_dir)/pwr_$(source)classes.hpp
@ co_convert -k -d $(doc_dir)/en_us/orm -l en_us
$(doc_dir)/sv_se/orm/%_allclasses.html : ../../%.wb_load
@ echo "Generating html files for $(source) classes sv_se..."
@ co_convert -w -l sv_se -d $(doc_dir)/sv_se/orm -g $(pwre_sroot)/wbl/mcomp/src/cnv_setup.dat "$(source)"
@ co_convert -c -d $(doc_dir)/sv_se/orm $(inc_dir)/pwr_$(source)classes.h
@ co_convert -c -d $(doc_dir)/sv_se/orm $(inc_dir)/pwr_$(source)classes.hpp
@ co_convert -k -d $(doc_dir)/sv_se/orm -l sv_se
$(doc_dir)/en_us/%.ps : ../../%.wb_load
@ echo "Generating postscript file for $(source) classes en_us..."
@ co_convert -q -l en_us -d $(doc_dir)/en_us "$(source)"
$(doc_dir)/sv_se/%.ps : ../../%.wb_load
@ echo "Generating postscript file for $(source) classes sv_se..."
@ co_convert -q -l sv_se -d $(doc_dir)/sv_se "$(source)"
$(exe_dir)/en_us/%_xtthelp.dat : ../../%.wb_load
@ echo "Generating xtt help files for $(source) classes en_us"
@ co_convert -x -d $(exe_dir)/en_us "$(source)"
$(exe_dir)/sv_se/%_xtthelp.dat : ../../%.wb_load
@ echo "Generating xtt help files for $(source) classes sv_se"
@ co_convert -x -l sv_se -d $(exe_dir)/sv_se "$(source)"
$(exe_dir)/%.pwg : ../../%.pwg
@ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target)
$(exe_dir)/%.pwsg : ../../%.pwsg
@ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target)
$(load_dir)/%.flw : ../../%.flw
@ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target)
.PHONY : all init copy lib exe clean realclean\
$(clean_wbl)
all : init copy exe
init :
lib : $(export_wbl_dbs)
copy : $(export_wbl_h) \
$(export_wbl_hpp) \
$(export_pwg) \
$(export_pwsg) \
$(export_flw)
exe: $(export_wbl_xtthelp_en_us) \
$(export_wbl_xtthelp_sv_se) \
$(export_wbl_html_en_us) \
$(export_wbl_html_sv_se) \
$(export_wbl_ps_en_us) \
$(export_wbl_ps_sv_se)
clean : \
$(clean_xtthelp_sv_se) $(clean_xtthelp_en_us) \
$(clean_html_sv_se) $(clean_html_en_us) \
$(clean_ps_sv_se) $(clean_ps_en_us)
realclean : clean \
$(clean_dbs) \
$(clean_h) \
$(clean_hpp) \
$(clean_dbs) : clean_%.dbs : $(load_dir)/%.dbs
@ echo "rm $(source)"
@ if [ -e $(source) ]; then \
$(rm) $(rmflags) $(source); \
fi
$(clean_h) : clean_%.h : $(inc_dir)/pwr_%classes.h
@ echo "rm $(source)"
@ if [ -e $(source) ]; then \
$(rm) $(rmflags) $(source); \
fi
$(clean_hpp) : clean_%.hpp : $(inc_dir)/pwr_%classes.hpp
@ echo "rm $(source)"
@ if [ -e $(source) ]; then \
$(rm) $(rmflags) $(source); \
fi
$(clean_ps_sv_se) : clean_%_sv_se.ps : $(doc_dir)/sv_se/%.ps
@ echo "rm $(source)"
@ if [ -e $(source) ]; then \
$(rm) $(rmflags) $(source); \
fi
$(clean_ps_en_us) : clean_%_en_us.ps : $(doc_dir)/en_us/%.ps
@ echo "rm $(source)"
@ if [ -e $(source) ]; then \
$(rm) $(rmflags) $(source); \
fi
$(clean_html_sv_se) : clean_%_sv_se.html : $(doc_dir)/sv_se/orm/%_allclasses.html
@ echo "rm $(source)"
@ if [ -e $(source) ]; then \
$(rm) $(rmflags) $(source); \
fi
$(clean_html_en_us) : clean_%_en_us.html : $(doc_dir)/en_us/orm/%_allclasses.html
@ echo "rm $(source)"
@ if [ -e $(source) ]; then \
$(rm) $(rmflags) $(source); \
fi
$(clean_xtthelp_sv_se) : clean_%_sv_se.xtthelp : $(exe_dir)/sv_se/%_xtthelp.dat
@ echo "rm $(source)"
@ if [ -e $(source) ]; then \
$(rm) $(rmflags) $(source); \
fi
$(clean_xtthelp_en_us) : clean_%_en_us.xtthelp : $(exe_dir)/en_us/%_xtthelp.dat
@ echo "rm $(source)"
@ if [ -e $(source) ]; then \
$(rm) $(rmflags) $(source); \
fi
endif
...@@ -7,13 +7,16 @@ ...@@ -7,13 +7,16 @@
"add", "add:usage_add", "add", "add:usage_add",
"build", "build:usage_build", "build", "build:usage_build",
"build_all", "build_all:usage_build_all", "build_all", "build_all:usage_build_all",
"build_ssab", "build_ssab:usage_build_ssab", "build_all_modules", "build_all_modules:usage_build_all_modules",
"copy", "copy:usage_copy", "copy", "copy:usage_copy",
"create", "create:usage_create", "create", "create:usage_create",
"create_all_modules", "create_all_modules:usage_create_all_modules",
"delete", "dele:usage_dele", "delete", "dele:usage_dele",
"help", "help:usage_help", "help", "help:usage_help",
"list", "list:usage_list", "list", "list:usage_list",
"init", "init:usage_init", "init", "init:usage_init",
"module", "module:usage_module",
"merge", "merge:usage_merge",
"modify", "modify:usage_modify", "modify", "modify:usage_modify",
"show", "show:usage_show", "show", "show:usage_show",
"tags", "tags:usage_tags", "tags", "tags:usage_tags",
...@@ -39,7 +42,6 @@ if ($ENV{"HOSTTYPE"} eq "rs6000") { ...@@ -39,7 +42,6 @@ if ($ENV{"HOSTTYPE"} eq "rs6000") {
$hw = "x86"; $hw = "x86";
} }
$desc = $user. "'s environment"; $desc = $user. "'s environment";
@vars; @vars;
$varstr; $varstr;
...@@ -164,17 +166,102 @@ sub build () # args: branch, subbranch, phase ...@@ -164,17 +166,102 @@ sub build () # args: branch, subbranch, phase
} }
#
# build_all()
#
sub build_all_modules ()
{
_module("kernel");
build_all("lib");
merge();
_module("ssabox");
build_all("lib");
merge();
_module("othermanu");
build_all("lib");
merge();
_module("abb");
build_all("lib");
merge();
_module("siemens");
build_all("lib");
merge();
_module("inor");
build_all("lib");
merge();
_module("klocknermoeller");
build_all("lib");
merge();
_module("telemecanique");
build_all("lib");
merge();
_module("kernel");
build_all("","exe");
merge();
_module("ssabox");
build_all("","exe");
merge();
_module("othermanu");
build_all("","exe");
merge();
_module("abb");
build_all("","exe");
merge();
_module("siemens");
build_all("","exe");
merge();
_module("inor");
build_all("","exe");
merge();
_module("klocknermoeller");
build_all("","exe");
merge();
_module("telemecanique");
build_all("","exe");
merge();
# my($exe_dir) = $ENV{"pwr_exe"};
# system("rm $exe_dir/rt_io_comm");
# _build("exe", "rt_io_comm", "all");
# system("rm $exe_dir/rt_ini");
# _build("exe", "rt_ini", "all");
merge();
}
sub create_all_modules ()
{
_module("kernel");
create();
_module("ssabox");
create();
_module("othermanu");
create();
_module("abb");
create();
_module("siemens");
create();
_module("inor");
create();
_module("klocknermoeller");
create();
_module("telemecanique");
create();
}
# #
# build_all() # build_all()
# #
sub build_all () sub build_all ()
{ {
my($to) = $_[0];
my($from) = $_[1];
if (!defined($ENV{"pwre_env"})) { if (!defined($ENV{"pwre_env"})) {
print("++ Environment is not initialized!\n"); print("++ Environment is not initialized!\n");
exit 1; exit 1;
} }
my($module) = $ENV{"pwre_module"};
printf("--\n"); printf("--\n");
printf("-- Build all\n"); printf("-- Build all\n");
...@@ -190,6 +277,8 @@ sub build_all () ...@@ -190,6 +277,8 @@ sub build_all ()
# } # }
if ( $module eq "kernel") {
if ( $from eq "") {
_build("exp", "inc", "all"); _build("exp", "inc", "all");
_build("exp", "com", "all"); _build("exp", "com", "all");
_build("tools/exe", "*", "all"); _build("tools/exe", "*", "all");
...@@ -209,7 +298,6 @@ sub build_all () ...@@ -209,7 +298,6 @@ sub build_all ()
_build("wbl", "ssab", "copy"); _build("wbl", "ssab", "copy");
_build("wbl", "tlog", "copy"); _build("wbl", "tlog", "copy");
_build("wbl", "bcomp", "copy"); _build("wbl", "bcomp", "copy");
_build("wbl", "mcomp", "copy");
_build("lib", "ge", "all"); _build("lib", "ge", "all");
_build("lib", "wb", "all"); _build("lib", "wb", "all");
_build("lib", "rt", "all"); _build("lib", "rt", "all");
...@@ -217,9 +305,14 @@ sub build_all () ...@@ -217,9 +305,14 @@ sub build_all ()
_build("exp", "rt", "all"); _build("exp", "rt", "all");
_build("exp", "wb", "all"); _build("exp", "wb", "all");
_build("lib", "msg_dummy", "all"); _build("lib", "msg_dummy", "all");
_build("exe", "wb*", "all"); _build("exe", "wb_rtt", "all");
_build("lib", "dtt", "all"); _build("lib", "dtt", "all");
_build("exp", "rt", "all"); _build("exp", "rt", "all");
}
if ( $to eq "lib") {
return;
}
_build("exe", "wb*", "all");
_build("exe", "rt*", "all"); _build("exe", "rt*", "all");
_build("exe", "rs*", "all"); _build("exe", "rs*", "all");
_build("exe", "jpwr*", "all"); _build("exe", "jpwr*", "all");
...@@ -237,7 +330,6 @@ sub build_all () ...@@ -237,7 +330,6 @@ sub build_all ()
_build("wbl", "ssab", "lib"); _build("wbl", "ssab", "lib");
_build("wbl", "tlog", "lib"); _build("wbl", "tlog", "lib");
_build("wbl", "bcomp", "lib"); _build("wbl", "bcomp", "lib");
_build("wbl", "mcomp", "lib");
_build("wbl", "wb", "lib"); _build("wbl", "wb", "lib");
_build("wbl", "rt", "lib"); _build("wbl", "rt", "lib");
_build("doc", "web", "all"); _build("doc", "web", "all");
...@@ -252,8 +344,22 @@ sub build_all () ...@@ -252,8 +344,22 @@ sub build_all ()
_build("wbl", "tlog", "exe"); _build("wbl", "tlog", "exe");
_build("wbl", "ssab", "exe"); _build("wbl", "ssab", "exe");
_build("wbl", "bcomp", "exe"); _build("wbl", "bcomp", "exe");
}
else {
if ( $from eq "") {
_build("wbl", "mcomp", "copy");
_build("mmi", "mcomp", "copy");
_build("lib", "rt", "all");
_build("lib", "wb", "all");
}
if ( $to eq "lib") {
return;
}
_build("wbl", "mcomp", "lib");
_build("wbl", "mcomp", "exe"); _build("wbl", "mcomp", "exe");
_build("doc", "dsh", "copy");
_build("doc", "orm", "copy");
}
} }
...@@ -325,6 +431,7 @@ sub create() ...@@ -325,6 +431,7 @@ sub create()
{ {
my($newdir); my($newdir);
my($root) = $ENV{"pwre_broot"}; my($root) = $ENV{"pwre_broot"};
my($module) = $ENV{"pwre_bmodule"};
if (!defined($root)) { if (!defined($root)) {
printf("++\n++ No build root is defined\n"); printf("++\n++ No build root is defined\n");
...@@ -345,31 +452,14 @@ sub create() ...@@ -345,31 +452,14 @@ sub create()
create_dir($newdir . "/msg"); create_dir($newdir . "/msg");
create_dir($newdir . "/jpwr"); create_dir($newdir . "/jpwr");
if ($module eq "kernel") {
$newdir = $root . "/exp"; $newdir = $root . "/exp";
create_dir($newdir); create_base($newdir);
create_dir($newdir . "/db"); }
create_dir($newdir . "/exe"); # else {
create_dir($newdir . "/exe/sv_se"); $newdir = $root . "/$module";
create_dir($newdir . "/exe/en_us"); create_base($newdir);
create_dir($newdir . "/exe/de_de"); # }
create_dir($newdir . "/inc");
create_dir($newdir . "/load");
create_dir($newdir . "/lib");
create_dir($newdir . "/lis");
create_dir($newdir . "/obj");
create_dir($newdir . "/src");
create_dir($newdir . "/cnf");
create_dir($newdir . "/doc");
create_dir($newdir . "/doc/dox");
create_dir($newdir . "/doc/prm");
create_dir($newdir . "/doc/sv_se");
create_dir($newdir . "/doc/en_us");
create_dir($newdir . "/doc/sv_se/orm");
create_dir($newdir . "/doc/en_us/orm");
create_dir($newdir . "/doc/sv_se/dsh");
create_dir($newdir . "/doc/en_us/dsh");
create_dir($newdir . "/doc/help");
$newdir = $root . "/tmp"; $newdir = $root . "/tmp";
create_dir($newdir); create_dir($newdir);
} }
...@@ -565,6 +655,39 @@ sub _build () # args: branch, subbranch, phase ...@@ -565,6 +655,39 @@ sub _build () # args: branch, subbranch, phase
} }
} }
#
# merge()
#
sub merge ()
{
if (!defined($ENV{"pwre_env"})) {
print("++ Environment is not initialized!\n");
exit 1;
}
my($eroot) = $ENV{"pwre_broot"};
if (!defined($eroot)) {
printf("++\n++ No build root is defined\n");
exit 1;
}
# if ($module eq "kernel") {
# printf("++\n++ No merge for module kernel needed\n");
# exit 1;
# }
$eroot .= "/" . $ENV{"pwre_os"};
$eroot .= "/" . $ENV{"pwre_hw"};
my($mroot) = $eroot;
$mroot .= "/" . $ENV{"pwre_module"};
$eroot .= "/exp";
printf("--\n");
printf("-- Merge $module...\n");
my($cmd) = $ENV{pwre_bin} . "/pwre_merge.sh " . $mroot . " " . $eroot;
system("$cmd");
}
# #
# _exists() # _exists()
# #
...@@ -609,10 +732,64 @@ sub _print () ...@@ -609,10 +732,64 @@ sub _print ()
untie(%envdb)|| die "++ can't untie $dbname!"; untie(%envdb)|| die "++ can't untie $dbname!";
} }
sub _module()
{
my($modu) = $_[0];
my($sroot) = $ENV{"pwre_sroot"};
my($idx) = rindex($sroot,"/");
$sroot = substr($sroot, 0, $idx);
my($broot) = $ENV{"pwre_broot"} . "/" . $ENV{"pwre_os"} . "/" . $ENV{"pwre_hw"};
$ENV{"pwre_module"} = $modu;
$ENV{"pwre_bmodule"} = $modu;
if ( $modu eq "kernel") {
# $ENV{"pwre_bmodule"} = "exp";
$ENV{"pwre_sroot"} = $sroot . "/src";
}
else {
$ENV{"pwre_sroot"} = $sroot . "/" . $modu;
}
$ENV{"pwr_exe"} = $broot . "/" . $ENV{"pwre_bmodule"} . "/exe";
$ENV{"pwr_inc"} = $broot . "/" . $ENV{"pwre_bmodule"} . "/inc";
$ENV{"pwr_load"} = $broot . "/" . $ENV{"pwre_bmodule"} . "/load";
$ENV{"pwr_lib"} = $broot . "/" . $ENV{"pwre_bmodule"} . "/lib";
$ENV{"pwr_lis"} = $broot . "/" . $ENV{"pwre_bmodule"} . "/lis";
$ENV{"pwr_obj"} = $broot . "/" . $ENV{"pwre_bmodule"} . "/obj";
$ENV{"pwr_doc"} = $broot . "/" . "exp" . "/doc";
}
# #
# Misc. subroutines # Misc. subroutines
# #
sub create_base()
{
my($newdir) = $_[0];
create_dir($newdir);
create_dir($newdir . "/db");
create_dir($newdir . "/exe");
create_dir($newdir . "/exe/sv_se");
create_dir($newdir . "/exe/en_us");
create_dir($newdir . "/exe/de_de");
create_dir($newdir . "/inc");
create_dir($newdir . "/load");
create_dir($newdir . "/lib");
create_dir($newdir . "/lis");
create_dir($newdir . "/obj");
create_dir($newdir . "/src");
create_dir($newdir . "/cnf");
create_dir($newdir . "/doc");
create_dir($newdir . "/doc/dox");
create_dir($newdir . "/doc/prm");
create_dir($newdir . "/doc/sv_se");
create_dir($newdir . "/doc/en_us");
create_dir($newdir . "/doc/sv_se/orm");
create_dir($newdir . "/doc/en_us/orm");
create_dir($newdir . "/doc/sv_se/dsh");
create_dir($newdir . "/doc/en_us/dsh");
create_dir($newdir . "/doc/help");
}
sub create_dir() sub create_dir()
{ {
my($dir) = $_[0]; my($dir) = $_[0];
...@@ -632,7 +809,7 @@ sub get_vars () ...@@ -632,7 +809,7 @@ sub get_vars ()
{ {
$sroot = get_var(" Source root [%s]? ", $sroot); $sroot = get_var(" Source root [%s]? ", $sroot);
$vmsinc = get_var(" pwr_inc on VMS [%s]? ", $vmsinc); # $vmsinc = get_var(" pwr_inc on VMS [%s]? ", $vmsinc);
$broot = get_var(" Build root [%s]? ", $broot); $broot = get_var(" Build root [%s]? ", $broot);
$btype = get_var(" Build type [%s]? ", $btype); $btype = get_var(" Build type [%s]? ", $btype);
$os = get_var(" OS [%s]? ", $os); $os = get_var(" OS [%s]? ", $os);
...@@ -668,14 +845,16 @@ sub read_vars () ...@@ -668,14 +845,16 @@ sub read_vars ()
sub show_vars () sub show_vars ()
{ {
my($module) = $ENV{"pwre_module"};
printf("-- Module.........: %s\n", $module);
printf("-- Source root....: %s\n", $sroot); printf("-- Source root....: %s\n", $sroot);
printf("-- pwr_inc on VMS.: %s\n", $vmsinc); # printf("-- pwr_inc on VMS.: %s\n", $vmsinc);
printf("-- Build root.....: %s\n", $broot); printf("-- Build root.....: %s\n", $broot);
printf("-- Build type.....: %s\n", $btype); printf("-- Build type.....: %s\n", $btype);
printf("-- OS.............: %s\n", $os); printf("-- OS.............: %s\n", $os);
printf("-- Hardware.......: %s\n", $hw); printf("-- Hardware.......: %s\n", $hw);
printf("-- Description....: %s\n", $desc); printf("-- Description....: %s\n", $desc);
} }
sub update_db () sub update_db ()
...@@ -692,13 +871,25 @@ sub usage_add () ...@@ -692,13 +871,25 @@ sub usage_add ()
sub usage_build () sub usage_build ()
{ {
printf("++\n"); printf("++\n");
printf("++ build branch subbranch [phase]: Build, eg. pwre build exe rt* all\n"); printf("++ build 'branch' 'subbranch' ['phase']: Build, eg. pwre build exe rt* all\n");
} }
sub usage_build_all () sub usage_build_all ()
{ {
printf("++\n"); printf("++\n");
printf("++ build_all : Builds all\n"); printf("++ build_all : Builds all in current module\n");
}
sub usage_build_all_modules ()
{
printf("++\n");
printf("++ build_all_modules : Builds all in all modules\n");
}
sub usage_create_all_modules ()
{
printf("++\n");
printf("++ create_all_modules : Create build trees for all modules\n");
} }
sub usage_build_ssab () sub usage_build_ssab ()
...@@ -722,7 +913,7 @@ sub usage_create () ...@@ -722,7 +913,7 @@ sub usage_create ()
sub usage_dele () sub usage_dele ()
{ {
printf("++\n"); printf("++\n");
printf("++ delete env : Deletes an environment from the database\n"); printf("++ delete 'env' : Deletes an environment from the database\n");
} }
sub usage_help () sub usage_help ()
...@@ -740,13 +931,25 @@ sub usage_list () ...@@ -740,13 +931,25 @@ sub usage_list ()
sub usage_init () sub usage_init ()
{ {
printf("++\n"); printf("++\n");
printf("++ init env : Inits an environment\n"); printf("++ init 'env' : Inits an environment\n");
}
sub usage_module ()
{
printf("++\n");
printf("++ module 'module' : Set module\n");
}
sub usage_merge ()
{
printf("++\n");
printf("++ merge : Merge module base to exp base\n");
} }
sub usage_modify () sub usage_modify ()
{ {
printf("++\n"); printf("++\n");
printf("++ modify env : Modfies an existing environment\n"); printf("++ modify 'env' : Modfies an existing environment\n");
} }
......
#!/bin/bash
# #
# pwre.source # pwre.source
# #
...@@ -7,25 +8,51 @@ ...@@ -7,25 +8,51 @@
# is handled by pwre.perl # is handled by pwre.perl
# #
# #
# Don't call pwre.perl if it is the init verb # Don't call pwre.perl if it is the init verb
# #
env="$2" env="$2"
local cmd
if [ $# -eq 0 ] || echo "init" | grep $pwre_silent -v "^$1"; then cmd="help"
if [ -z $1 ] || [ $1 = $cmd ] || [ ${cmd#$1} != $cmd ]; then
$pwre_bin/pwre.pl $@ $pwre_bin/pwre.pl $@
elif [ "$env" = "" ]; then return
fi
cmd="init"
if [ $1 = $cmd ]; then
echo "init..."
if [ "$env" = "" ]; then
echo "++ init what?" echo "++ init what?"
else else
export pwre_module=kernel
export pwre_bmodule=kernel
if $pwre_bin/pwre.pl _exists $2; then if $pwre_bin/pwre.pl _exists $2; then
set_env `$pwre_bin/pwre.pl _print $2` set_env `$pwre_bin/pwre.pl _print $2`
else else
echo "++ Environment $2 doesn't exist" echo "++ Environment $2 doesn't exist"
fi fi
source $pwre_bin/pwre_function
fi
return
fi fi
cmd="module"
if [ $1 = $cmd ]; then
echo "module..."
if [ -z $2 ]; then
export pwre_module="kernel"
export pwre_bmodule="kernel"
else
export pwre_module=$2
export pwre_bmodule=$2
fi
env=$pwre_env
set_env `$pwre_bin/pwre.pl _print $env`
return
fi
$pwre_bin/pwre.pl $@
#
# Proview build environment setup
#
# Environment variables
#
# $pwre_sroot Module source root, eg. pwr/ssabox
# $pwre_kroot Kernel source root, pwr/src
# $pwre_broot Common build root
# $pwre_module Module name in source tree, eg. 'ssabox'
# $pwre_bmodule Module name in build tree, eg. 'ssabox'
# $pwre_os Operating system, eg. 'os_linux'
# $pwre_hw Hardware, eg. 'hw_x86'
# $pwr_exe Exe directory for module build root, eg. ssabox/exe
# $pwr_load Load directory for module build root
# $pwr_inc Inc directory for module build root
# $pwr_obj Obj directory for module build root
# $pwr_lib Lib directory for module build root
# $pwr_eexe Exe directory for common build root, ex. exp/exe
# $pwr_eload Load directory for common build root
# $pwr_einc Inc directory for common build root
# $pwr_eobj Obj directory for common build root
# $pwr_elib Lib directory for common build root
pwre() pwre()
{ {
if [ "$HOSTTYPE" = "alpha" ]; then if [ "$HOSTTYPE" = "alpha" ]; then
...@@ -20,8 +43,19 @@ pwre() ...@@ -20,8 +43,19 @@ pwre()
set_env() set_env()
{ {
if [ "$pwr_eexe" != "" ]; then
export PATH=${PATH%:$pwr_eexe}
export PATH=${PATH%:$pwr_exe}
fi
module=$pwre_module
if [ $module = "kernel" ]; then
module=src
fi
sroot=${pwre_sroot%/*}
export pwre_sroot=$sroot/$module
export pwre_kroot=$sroot/src
export pwre_env="$env" export pwre_env="$env"
export pwre_sroot="$1"
export pwre_vmsinc="$2" export pwre_vmsinc="$2"
export pwre_broot="$3" export pwre_broot="$3"
export pwre_btype="$4" export pwre_btype="$4"
...@@ -29,26 +63,38 @@ set_env() ...@@ -29,26 +63,38 @@ set_env()
export pwre_hw="hw_$6" export pwre_hw="hw_$6"
export pwre_target="$pwre_os/$pwre_hw" export pwre_target="$pwre_os/$pwre_hw"
export pwre_bin="$pwre_sroot/tools/pwre/src/$pwre_os" export pwre_bin="$pwre_kroot/tools/pwre/src/$pwre_os"
export pwre_dir_symbols="$pwre_bin/dir_symbols.mk" export pwre_dir_symbols="$pwre_bin/dir_symbols.mk"
export pwr_exe="$pwre_broot/$pwre_os/$pwre_hw/exp/exe" export pwr_exe="$pwre_broot/$pwre_os/$pwre_hw/$pwre_bmodule/exe"
export pwr_inc="$pwre_broot/$pwre_os/$pwre_hw/exp/inc" export pwr_inc="$pwre_broot/$pwre_os/$pwre_hw/$pwre_bmodule/inc"
export pwr_load="$pwre_broot/$pwre_os/$pwre_hw/exp/load" export pwr_load="$pwre_broot/$pwre_os/$pwre_hw/$pwre_bmodule/load"
export pwr_lib="$pwre_broot/$pwre_os/$pwre_hw/exp/lib" export pwr_lib="$pwre_broot/$pwre_os/$pwre_hw/$pwre_bmodule/lib"
export pwr_lis="$pwre_broot/$pwre_os/$pwre_hw/exp/lis" export pwr_lis="$pwre_broot/$pwre_os/$pwre_hw/$pwre_bmodule/lis"
export pwr_obj="$pwre_broot/$pwre_os/$pwre_hw/exp/obj" export pwr_obj="$pwre_broot/$pwre_os/$pwre_hw/$pwre_bmodule/obj"
# Common doc
export pwr_doc="$pwre_broot/$pwre_os/$pwre_hw/exp/doc" export pwr_doc="$pwre_broot/$pwre_os/$pwre_hw/exp/doc"
export co_lib="$pwre_sroot/lib/co/src" export pwr_eexe="$pwre_broot/$pwre_os/$pwre_hw/exp/exe"
export op_lib="$pwre_sroot/lib/op/src" export pwr_einc="$pwre_broot/$pwre_os/$pwre_hw/exp/inc"
export rt_lib="$pwre_sroot/lib/rt/src" export pwr_eload="$pwre_broot/$pwre_os/$pwre_hw/exp/load"
export wb_lib="$pwre_sroot/lib/wb/src" export pwr_elib="$pwre_broot/$pwre_os/$pwre_hw/exp/lib"
export pwr_elis="$pwre_broot/$pwre_os/$pwre_hw/exp/lis"
export pwr_eobj="$pwre_broot/$pwre_os/$pwre_hw/exp/obj"
export pwr_edoc="$pwre_broot/$pwre_os/$pwre_hw/exp/doc"
export pwrp_load="./"
export pwrp_pop="./"
export co_lib="$pwre_kroot/lib/co/src"
export op_lib="$pwre_kroot/lib/op/src"
export rt_lib="$pwre_kroot/lib/rt/src"
export wb_lib="$pwre_kroot/lib/wb/src"
export exe="$pwre_sroot/exe" export exe="$pwre_kroot/exe"
# PWR alias # PWR alias
alias pwr_root="cd $pwre_sroot" alias pwr_root="cd $pwre_kroot"
alias pwr_exe="cd $pwr_exe" alias pwr_exe="cd $pwr_exe"
alias pwr_inc="cd $pwr_inc" alias pwr_inc="cd $pwr_inc"
...@@ -58,21 +104,21 @@ set_env() ...@@ -58,21 +104,21 @@ set_env()
alias pwr_obj="cd $pwr_obj" alias pwr_obj="cd $pwr_obj"
alias co_lib="cd $pwre_sroot/lib/co/src" alias co_lib="cd $pwre_kroot/lib/co/src"
alias op_lib="cd $pwre_sroot/lib/op/src" alias op_lib="cd $pwre_kroot/lib/op/src"
alias rt_lib="cd $pwre_sroot/lib/rt/src" alias rt_lib="cd $pwre_kroot/lib/rt/src"
alias wb_lib="cd $pwre_sroot/lib/wb/src" alias wb_lib="cd $pwre_kroot/lib/wb/src"
alias db="cd $pwre_sroot/db" alias db="cd $pwre_kroot/db"
alias exe="cd $pwre_sroot/exe" alias exe="cd $pwre_kroot/exe"
alias exp="cd $pwre_sroot/exp" alias exp="cd $pwre_kroot/exp"
alias inc="cd $pwre_sroot/exp/inc/src" alias inc="cd $pwre_kroot/exp/inc/src"
alias lib="cd $pwre_sroot/lib" alias lib="cd $pwre_kroot/lib"
alias hlp="cd $pwre_sroot/hlp" alias hlp="cd $pwre_kroot/hlp"
alias mmi="cd $pwre_sroot/mmi" alias mmi="cd $pwre_kroot/mmi"
alias msg="cd $pwre_sroot/msg" alias msg="cd $pwre_kroot/msg"
alias tools="cd $pwre_sroot/tools" alias tools="cd $pwre_kroot/tools"
alias wbl="cd $pwre_sroot/wbl" alias wbl="cd $pwre_kroot/wbl"
alias hw="cd $pwre_target" alias hw="cd $pwre_target"
...@@ -87,6 +133,7 @@ set_env() ...@@ -87,6 +133,7 @@ set_env()
export PWRP_DB=$pwr_my_sqlserver":wb_template_"$pwr_dbversion export PWRP_DB=$pwr_my_sqlserver":wb_template_"$pwr_dbversion
# export CLASSPATH=$pwre_broot/$pwre_os/$pwre_hw/bld/jpwr/rt:$pwre_broot/$pwre_os/$pwre_hw/bld/jpwr/jop:$pwre_broot/$pwre_os/$pwre_hw/bld/jpwr/beans # export CLASSPATH=$pwre_broot/$pwre_os/$pwre_hw/bld/jpwr/rt:$pwre_broot/$pwre_os/$pwre_hw/bld/jpwr/jop:$pwre_broot/$pwre_os/$pwre_hw/bld/jpwr/beans
export CLASSPATH=$pwre_broot/$pwre_target/bld export CLASSPATH=$pwre_broot/$pwre_target/bld
export PATH=$PATH:$pwr_exe:$pwr_eexe
} }
pwre_get_variables() pwre_get_variables()
...@@ -98,8 +145,8 @@ pwre_get_variables() ...@@ -98,8 +145,8 @@ pwre_get_variables()
mysql_socket="--socket $socket" mysql_socket="--socket $socket"
fi fi
if [ -n $pwre_sroot ]; then if [ -n $pwre_kroot ]; then
pwr_dbversion=`eval cat $pwre_sroot/exp/inc/src/pwr_version.h | grep "\bpwrv_cWbdbVersionShortStr\b" | awk '{print $3}'` pwr_dbversion=`eval cat $pwre_kroot/exp/inc/src/pwr_version.h | grep "\bpwrv_cWbdbVersionShortStr\b" | awk '{print $3}'`
if [ -z $pwr_dbversion ]; then if [ -z $pwr_dbversion ]; then
echo "Unable to get pwr db version" echo "Unable to get pwr db version"
......
#!/bin/bash
#
# Merge build tree for a module to common build tree
#
merge_dir_func()
{
local todir=$1
local fromdir=$2
files=`eval ls $fromdir 2>/dev/null`
if [ ! -z "$files" ]; then
for file in $files; do
if [ ! -d $fromdir/$file ]; then
if [ -e $todir/$file ]; then
if [ $todir/$file -ot $fromdir/$file ]; then
echo "Copy $fromdir/$file"
cp $fromdir/$file $todir
if [ ${file##*.} = "dbs" ]; then
# Change access on dbsfiles
chmod a+w $todir/$file
fi
fi
else
echo "Copy $fromdir/$file"
cp $fromdir/$file $todir
fi
fi
done
fi
}
fromroot=$1
toroot=$2
# Copy exe, load, obj and inc
merge_dir_func $toroot/exe $fromroot/exe
merge_dir_func $toroot/exe/sv_se $fromroot/exe/sv_se
merge_dir_func $toroot/exe/en_us $fromroot/exe/en_us
merge_dir_func $toroot/exe/de_de $fromroot/exe/de_de
merge_dir_func $toroot/inc $fromroot/inc
merge_dir_func $toroot/load $fromroot/load
merge_dir_func $toroot/obj $fromroot/obj
# Merge archives
cd ${toroot%/*}/tmp
libraries=`eval ls $fromroot/lib/* 2>/dev/null`
for lib in $libraries; do
arname=${lib##/*/}
if [ $arname = "libpwr_rt.a" ] || [ $arname = "libpwr_wb.a" ]; then
echo "Merge $lib"
modules=`eval ar -tf $lib`
ar -xf $lib
ar -rc $toroot/lib/$arname $modules
rm $modules
else
echo "Copy $lib"
cp $lib $toroot/lib/
fi
done
#Merge io methods
echo "-- Merge io methods"
co_merge io_base $pwr_einc/rt_io_\*.meth $pwr_elib/libpwr_rt.a
echo "-- Merge wb methods"
co_merge wb_base $pwr_einc/wb_\*.meth $pwr_elib/libpwr_wb.a
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 $Id: rt_io_m_ai_ai32up.c,v 1.1 2005-12-30 15:52:05 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_io_m_ai_ai32up.c -- io methods for ssab cards.
OS Linux
*/
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include "pwr.h"
#include "co_cdh.h"
#include "rt_gdh.h"
#include "rt_errh.h"
#include "pwr_baseclasses.h"
#include "pwr_basecomponentclasses.h"
#include "pwr_ssaboxclasses.h"
#include "rt_io_base.h"
#include "rt_io_msg.h"
#include "rt_io_ssab.h"
#include "rt_io_card_init.h"
#include "rt_io_card_close.h"
#include "rt_io_card_read.h"
#include "qbus_io.h"
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
#define IO_MAXCHAN 32
typedef struct {
unsigned int Address;
int Qbus_fp;
int ScanCount[IO_MAXCHAN];
} io_sLocal;
typedef struct {
int Qbus_fp;
} io_sRackLocal;
static pwr_tStatus AiRangeToCoef(
io_sChannel *chanp)
{
pwr_sClass_ChanAi *cop;
char buf[120];
pwr_tStatus sts;
pwr_tFloat32 PolyCoef1;
pwr_tFloat32 PolyCoef0;
cop = chanp->cop;
if ( cop)
{
cop->CalculateNewCoef = 0;
/* Coef for RawValue to SignalValue conversion */
cop->SigValPolyCoef0 = 0;
cop->SigValPolyCoef1 = cop->ChannelSigValRangeHigh / 30000;
/* Coef for SignalValue to ActualValue conversion */
if ( chanp->ChanClass != pwr_cClass_ChanAit && cop->SensorPolyType == 1)
{
if ( cop->SensorSigValRangeHigh != cop->SensorSigValRangeLow)
{
PolyCoef1 = (cop->ActValRangeHigh - cop->ActValRangeLow)/
(cop->SensorSigValRangeHigh - cop->SensorSigValRangeLow);
PolyCoef0 = cop->ActValRangeHigh - cop->SensorSigValRangeHigh *
PolyCoef1;
cop->SensorPolyCoef1 = cop->SigValPolyCoef1 * PolyCoef1;
cop->SensorPolyCoef0 = PolyCoef0 + PolyCoef1*
cop->SigValPolyCoef0;
}
else
{
sts = gdh_ObjidToName( chanp->ChanAref.Objid, buf, sizeof(buf),
cdh_mName_volumeStrict);
if ( EVEN(sts)) return sts;
errh_Error( "Invalid SigValueRange in Ai channel %s", buf);
return IO__CHANRANGE;
}
}
}
return IO__SUCCESS;
}
static pwr_tStatus IoCardInit (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
pwr_sClass_Ai_AI32uP *op;
io_sLocal *local;
int i;
io_sChannel *chanp;
op = (pwr_sClass_Ai_AI32uP *) cp->op;
local = calloc( 1, sizeof(*local));
cp->Local = local;
local->Address = op->RegAddress;
local->Qbus_fp = ((io_sRackLocal *)(rp->Local))->Qbus_fp;
errh_Info( "Init of ai card '%s'", cp->Name);
/* Caluclate polycoeff */
chanp = cp->chanlist;
for ( i = 0; i < cp->ChanListSize; i++)
{
AiRangeToCoef( chanp);
chanp++;
}
return 1;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static pwr_tStatus IoCardClose (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
io_sLocal *local;
errh_Info( "IO closing ai card '%s'", cp->Name);
local = (io_sLocal *) cp->Local;
free( (char *) local);
return 1;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static pwr_tStatus IoCardRead (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
io_sLocal *local;
pwr_tInt16 data = 0;
pwr_sClass_Ai_AI32uP *op;
int i;
pwr_tFloat32 actvalue;
io_sChannel *chanp;
pwr_sClass_ChanAi *cop;
pwr_sClass_Ai *sop;
int sts;
qbus_io_read rb;
local = (io_sLocal *) cp->Local;
op = (pwr_sClass_Ai_AI32uP *) cp->op;
chanp = &cp->chanlist[0];
for ( i = 0; i < cp->ChanListSize; i++)
{
if ( !chanp->cop)
{
chanp++;
continue;
}
cop = (pwr_sClass_ChanAi *) chanp->cop;
sop = (pwr_sClass_Ai *) chanp->sop;
if ( cop->CalculateNewCoef)
AiRangeToCoef( chanp);
if ( cop->ConversionOn)
{
if ( local->ScanCount[i] <= 1)
{
#if defined(OS_ELN)
vaxc$establish(machfailread);
#endif
rb.Address = local->Address + 2*i;
sts = read( local->Qbus_fp, &rb, sizeof(rb));
data = (unsigned short) rb.Data;
if ( sts == -1)
{
#if 0
/* Exceptionhandler was called */
if ( io_fatal_error)
{
/* Activate emergency break */
errh_Error( "Fatal read error, card '%s', IO is stopped", cp->Name);
ctx->Node->EmergBreakTrue = 1;
return IO__ERRDEVICE;
}
#endif
/* Increase error count and check error limits */
op->ErrorCount++;
if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
if ( op->ErrorCount >= op->ErrorHardLimit)
{
errh_Error( "IO Error hard limit reached on card '%s', IO stopped", cp->Name);
ctx->Node->EmergBreakTrue = 1;
return IO__ERRDEVICE;
}
chanp++;
continue;
}
/* Convert rawvalue to sigvalue and actualvalue */
sop->RawValue = data;
sop->SigValue = data * cop->SigValPolyCoef1 + cop->SigValPolyCoef0;
switch ( chanp->ChanClass)
{
case pwr_cClass_ChanAi:
io_ConvertAi( cop, data, &actvalue);
break;
case pwr_cClass_ChanAit:
io_ConvertAit( (pwr_sClass_ChanAit *) cop, data, &actvalue);
break;
}
/* Filter */
if ( sop->FilterType == 1 &&
sop->FilterAttribute[0] > 0 &&
sop->FilterAttribute[0] > ctx->ScanTime)
{
actvalue = *(pwr_tFloat32 *)chanp->vbp +
ctx->ScanTime / sop->FilterAttribute[0] *
(actvalue - *(pwr_tFloat32 *)chanp->vbp);
}
*(pwr_tFloat32 *) chanp->vbp = actvalue;
local->ScanCount[i] = cop->ScanInterval + 1;
}
local->ScanCount[i]--;
}
chanp++;
}
return 1;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindIoMethods(Ai_AI32uP) = {
pwr_BindIoMethod(IoCardInit),
pwr_BindIoMethod(IoCardClose),
pwr_BindIoMethod(IoCardRead),
pwr_NullMethod
};
/*
* Proview $Id: rt_io_m_ai_hvai32.c,v 1.1 2005-12-30 15:52:05 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_io_m_ai_hvai32.c -- io methods for ssab cards.
OS Linux
*/
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include "pwr.h"
#include "co_cdh.h"
#include "rt_gdh.h"
#include "rt_errh.h"
#include "pwr_baseclasses.h"
#include "pwr_basecomponentclasses.h"
#include "pwr_ssaboxclasses.h"
#include "rt_io_base.h"
#include "rt_io_msg.h"
#include "rt_io_ssab.h"
#include "rt_io_card_init.h"
#include "rt_io_card_close.h"
#include "rt_io_card_read.h"
#include "qbus_io.h"
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
#define MASKAI 0xFFF /* No polling bit in output data */
#define READYAI 0x8000 /* AI-read polling ready */
#define RMAX 100 /* Number of AI-read polling */
#define IO_MAXCHAN 32
typedef struct {
unsigned int Address;
int Qbus_fp;
int ScanCount[IO_MAXCHAN];
} io_sLocal;
typedef struct {
int Qbus_fp;
} io_sRackLocal;
static pwr_tStatus AiRangeToCoef(
io_sChannel *chanp)
{
pwr_sClass_ChanAi *cop;
char buf[120];
pwr_tStatus sts;
pwr_tFloat32 PolyCoef1;
pwr_tFloat32 PolyCoef0;
cop = chanp->cop;
if ( cop)
{
cop->CalculateNewCoef = 0;
/* Coef for RawValue to SignalValue conversion */
cop->SigValPolyCoef0 = cop->ChannelSigValRangeHigh * 1.024;
cop->SigValPolyCoef1 = - cop->ChannelSigValRangeHigh / 2048 * 1.024;
/* Coef for RawValue to ActualValue conversion */
if ( chanp->ChanClass != pwr_cClass_ChanAit && cop->SensorPolyType == 1)
{
if ( cop->SensorSigValRangeHigh != cop->SensorSigValRangeLow)
{
PolyCoef1 = (cop->ActValRangeHigh - cop->ActValRangeLow)/
(cop->SensorSigValRangeHigh - cop->SensorSigValRangeLow);
PolyCoef0 = cop->ActValRangeHigh - cop->SensorSigValRangeHigh *
PolyCoef1;
cop->SensorPolyCoef1 = cop->SigValPolyCoef1 * PolyCoef1;
cop->SensorPolyCoef0 = PolyCoef0 + PolyCoef1*
cop->SigValPolyCoef0;
}
else
{
sts = gdh_ObjidToName( chanp->ChanAref.Objid, buf, sizeof(buf),
cdh_mName_volumeStrict);
if ( EVEN(sts)) return sts;
errh_Error( "Invalid SigValueRange in Ai channel %s", buf);
return IO__CHANRANGE;
}
}
}
return IO__SUCCESS;
}
static pwr_tStatus IoCardInit (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
pwr_sClass_Ai_HVAI32 *op;
io_sLocal *local;
int i;
io_sChannel *chanp;
op = (pwr_sClass_Ai_HVAI32 *) cp->op;
local = calloc( 1, sizeof(*local));
cp->Local = local;
local->Address = op->RegAddress;
local->Qbus_fp = ((io_sRackLocal *)(rp->Local))->Qbus_fp;
errh_Info( "Init of ai card '%s'", cp->Name);
/* Caluclate polycoeff */
chanp = cp->chanlist;
for ( i = 0; i < cp->ChanListSize; i++)
{
AiRangeToCoef( chanp);
chanp++;
}
return 1;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static pwr_tStatus IoCardClose (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
io_sLocal *local;
errh_Info( "IO closing ai card '%s'", cp->Name);
local = (io_sLocal *) cp->Local;
free( (char *) local);
return 1;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static pwr_tStatus IoCardRead (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
io_sLocal *local;
pwr_tUInt16 data = 0;
pwr_sClass_Ai_HVAI32 *op;
int i, j;
pwr_tFloat32 actvalue;
io_sChannel *chanp;
pwr_sClass_ChanAi *cop;
pwr_sClass_Ai *sop;
int sts;
qbus_io_read rb;
qbus_io_write wb;
int timeout;
local = (io_sLocal *) cp->Local;
op = (pwr_sClass_Ai_HVAI32 *) cp->op;
chanp = &cp->chanlist[0];
for ( i = 0; i < cp->ChanListSize; i++)
{
if ( !chanp->cop)
{
chanp++;
continue;
}
cop = (pwr_sClass_ChanAi *) chanp->cop;
sop = (pwr_sClass_Ai *) chanp->sop;
if ( cop->CalculateNewCoef)
AiRangeToCoef( chanp);
if ( cop->ConversionOn)
{
if ( local->ScanCount[i] <= 1)
{
#if defined(OS_ELN)
vaxc$establish(machfailread);
#endif
/* Write channel */
wb.Address = local->Address;
wb.Data = i;
sts = write( local->Qbus_fp, &wb, sizeof(wb));
if ( sts != -1)
{
/* Read until ready-bit is set */
rb.Address = local->Address;
timeout = 1;
for ( j = 0; j < RMAX; j++)
{
sts = read( local->Qbus_fp, &rb, sizeof(rb));
if ( sts == -1)
break;
data = (unsigned short) rb.Data;
if( data & READYAI || sts == -1)
{
timeout = 0;
break;
}
}
}
data &= MASKAI;
if ( sts == -1 || timeout)
{
#if 0
if ( io_fatal_error)
{
/* Activate emergency break */
errh_Error( "Fatal read error, card '%s', IO is stopped", cp->Name);
ctx->Node->EmergBreakTrue = 1;
return IO__ERRDEVICE;
}
#endif
/* Increase error count and check error limits */
op->ErrorCount++;
if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
if ( op->ErrorCount >= op->ErrorHardLimit)
{
errh_Error( "IO Error hard limit reached on card '%s', IO stopped", cp->Name);
ctx->Node->EmergBreakTrue = 1;
return IO__ERRDEVICE;
}
chanp++;
continue;
}
/* Convert rawvalue to sigvalue and actualvalue */
sop->RawValue = data;
switch ( chanp->ChanClass)
{
case pwr_cClass_ChanAi:
io_ConvertAi( cop, (pwr_tInt16) data, &actvalue);
break;
case pwr_cClass_ChanAit:
io_ConvertAit( (pwr_sClass_ChanAit *) cop, (pwr_tInt16) data,
&actvalue);
break;
}
/* Check max/min */
if (actvalue > cop->ActValRangeHigh && cop->ActValRangeHigh > cop->ActValRangeLow)
actvalue = cop->ActValRangeHigh;
if (actvalue < cop->ActValRangeLow && cop->ActValRangeHigh > cop->ActValRangeLow)
actvalue = cop->ActValRangeLow;
/* Filter */
if ( sop->FilterType == 1 &&
sop->FilterAttribute[0] > 0 &&
sop->FilterAttribute[0] > ctx->ScanTime)
{
actvalue = *(pwr_tFloat32 *)chanp->vbp +
ctx->ScanTime / sop->FilterAttribute[0] *
(actvalue - *(pwr_tFloat32 *)chanp->vbp);
}
*(pwr_tFloat32 *) chanp->vbp = actvalue;
local->ScanCount[i] = cop->ScanInterval + 1;
}
local->ScanCount[i]--;
}
chanp++;
}
return 1;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindIoMethods(Ai_HVAI32) = {
pwr_BindIoMethod(IoCardInit),
pwr_BindIoMethod(IoCardClose),
pwr_BindIoMethod(IoCardRead),
pwr_NullMethod
};
/*
* Proview $Id: rt_io_m_ao_hvao4.c,v 1.1 2005-12-30 15:52:05 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_io_m_ao_hvao4.c -- io methods for ssab cards.
OS Linux
*/
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include "pwr.h"
#include "rt_errh.h"
#include "co_cdh.h"
#include "rt_gdh.h"
#include "pwr_baseclasses.h"
#include "pwr_basecomponentclasses.h"
#include "pwr_ssaboxclasses.h"
#include "rt_io_base.h"
#include "rt_io_msg.h"
#include "rt_io_ssab.h"
#include "rt_io_card_init.h"
#include "rt_io_card_close.h"
#include "rt_io_card_write.h"
#include "qbus_io.h"
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
#define IO_MAXCHAN 8
typedef struct {
unsigned int Address;
int Qbus_fp;
pwr_tFloat32 OldValue[IO_MAXCHAN];
pwr_tBoolean OldTestOn[IO_MAXCHAN];
int WriteFirst;
} io_sLocal;
typedef struct {
int Qbus_fp;
} io_sRackLocal;
static pwr_tStatus AoRangeToCoef(
io_sChannel *chanp)
{
pwr_sClass_ChanAo *cop;
char buf[120];
pwr_tStatus sts;
pwr_tFloat32 PolyCoef1;
pwr_tFloat32 PolyCoef0;
cop = chanp->cop;
if ( cop)
{
cop->CalculateNewCoef = 0;
/* Coef for ActualValue to RawValue conversion */
if ( cop->ActValRangeHigh != cop->ActValRangeLow)
{
cop->SigValPolyCoef1 = (cop->SensorSigValRangeHigh - cop->SensorSigValRangeLow)/
(cop->ActValRangeHigh - cop->ActValRangeLow);
cop->SigValPolyCoef0 = cop->SensorSigValRangeHigh - cop->ActValRangeHigh *
cop->SigValPolyCoef1;
}
else
{
sts = gdh_ObjidToName( chanp->ChanAref.Objid, buf, sizeof(buf),
cdh_mName_volumeStrict);
if ( EVEN(sts)) return sts;
errh_Error( "Invalid ActValueRange in Ao channel %s", buf);
return IO__CHANRANGE;
}
/* Coef for ActualValue to SignalValue conversion */
if ( cop->ChannelSigValRangeHigh != 0)
{
PolyCoef0 = 0;
PolyCoef1 = cop->RawValRangeHigh / cop->ChannelSigValRangeHigh;
cop->OutPolyCoef1 = cop->SigValPolyCoef1 * PolyCoef1;
cop->OutPolyCoef0 = PolyCoef0 + PolyCoef1*
cop->SigValPolyCoef0;
}
else
{
sts = gdh_ObjidToName( chanp->ChanAref.Objid, buf, sizeof(buf),
cdh_mName_volumeStrict);
if ( EVEN(sts)) return sts;
errh_Error( "Invalid SigValueRange in Ao channel %s", buf);
return IO__CHANRANGE;
}
}
return IO__SUCCESS;
}
static pwr_tStatus IoCardInit (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
pwr_sClass_Ao_HVAO4 *op;
io_sChannel *chanp;
int i;
io_sLocal *local;
op = (pwr_sClass_Ao_HVAO4 *) cp->op;
local = calloc( 1, sizeof(*local));
local->Address = op->RegAddress;
local->Qbus_fp = ((io_sRackLocal *)(rp->Local))->Qbus_fp;
errh_Info( "Init of ao card '%s'", cp->Name);
/* Write the first 50 loops */
local->WriteFirst = 50;
cp->Local = local;
/* Caluclate polycoeff */
chanp = cp->chanlist;
for ( i = 0; i < cp->ChanListSize; i++)
{
AoRangeToCoef( chanp);
chanp++;
}
return 1;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static pwr_tStatus IoCardClose (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
io_sLocal *local;
local = (io_sLocal *) cp->Local;
errh_Info( "IO closing ao card '%s'", cp->Name);
free( (char *) local);
return 1;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static pwr_tStatus IoCardWrite (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
io_sLocal *local;
pwr_sClass_Ao_HVAO4 *op;
int i;
io_sChannel *chanp;
pwr_sClass_ChanAo *cop;
pwr_sClass_Ao *sop;
pwr_tFloat32 value;
int fixout;
pwr_tUInt16 data;
pwr_tFloat32 rawvalue;
qbus_io_write wb;
int sts;
local = (io_sLocal *) cp->Local;
op = (pwr_sClass_Ao_HVAO4 *) cp->op;
fixout = ctx->Node->EmergBreakTrue && ctx->Node->EmergBreakSelect == FIXOUT;
chanp = &cp->chanlist[0];
for ( i = 0; i < cp->ChanListSize; i++)
{
if ( !chanp->cop)
{
chanp++;
continue;
}
cop = (pwr_sClass_ChanAo *) chanp->cop;
sop = (pwr_sClass_Ao *) chanp->sop;
if ( *(pwr_tFloat32 *)chanp->vbp != local->OldValue[i] ||
local->WriteFirst > 0 ||
cop->CalculateNewCoef ||
fixout ||
cop->TestOn || local->OldTestOn[i] != cop->TestOn)
{
if ( fixout)
value = cop->FixedOutValue;
else if ( cop->TestOn)
value = cop->TestValue;
else
value = *(pwr_tFloat32 *) chanp->vbp;
if ( cop->CalculateNewCoef)
AoRangeToCoef( chanp);
/* Convert to rawvalue */
if ( value > cop->ActValRangeHigh)
value = cop->ActValRangeHigh;
else if ( value < cop->ActValRangeLow)
value = cop->ActValRangeLow;
rawvalue = cop->OutPolyCoef1 * value + cop->OutPolyCoef0;
if ( rawvalue > 0)
sop->RawValue = rawvalue + 0.5;
else
sop->RawValue = rawvalue - 0.5;
data = sop->RawValue;
#if defined(OS_ELN)
vaxc$establish(machfailwrite);
#endif
wb.Data = data;
wb.Address = local->Address + 2*i;
sts = write( local->Qbus_fp, &wb, sizeof(wb));
if ( sts == -1)
{
/* Exceptionhandler was called */
#if 0
if ( io_fatal_error)
{
/* Activate emergency break */
errh_Error( "Fatal write error, card '%s', IO is stopped", cp->Name);
ctx->Node->EmergBreakTrue = 1;
return IO__ERRDEVICE;
}
#endif
/* Increase error count and check error limits */
op->ErrorCount++;
if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
if ( op->ErrorCount >= op->ErrorHardLimit)
{
errh_Error( "IO Error hard limit reached on card '%s', IO stopped", cp->Name);
ctx->Node->EmergBreakTrue = 1;
return IO__ERRDEVICE;
}
chanp++;
continue;
}
else
local->OldValue[i] = value;
}
local->OldTestOn[i] = cop->TestOn;
chanp++;
}
if ( local->WriteFirst)
local->WriteFirst--;
return 1;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindIoMethods(Ao_HVAO4) = {
pwr_BindIoMethod(IoCardInit),
pwr_BindIoMethod(IoCardClose),
pwr_BindIoMethod(IoCardWrite),
pwr_NullMethod
};
pwr_dExport pwr_BindIoMethods(Ao_AO8uP) = {
pwr_BindIoMethod(IoCardInit),
pwr_BindIoMethod(IoCardClose),
pwr_BindIoMethod(IoCardWrite),
pwr_NullMethod
};
/*
* Proview $Id: rt_io_m_co_pi24bo.c,v 1.1 2005-12-30 15:52:05 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_io_m_co_pi24bo.c -- io methods for ssab cards.
OS Linux
*/
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include "pwr.h"
#include "rt_errh.h"
#include "pwr_baseclasses.h"
#include "pwr_basecomponentclasses.h"
#include "pwr_ssaboxclasses.h"
#include "rt_io_base.h"
#include "rt_io_msg.h"
#include "rt_io_ssab.h"
#include "rt_io_card_init.h"
#include "rt_io_card_close.h"
#include "rt_io_card_read.h"
#include "qbus_io.h"
#define IO_MAXCHAN 4
#define MIN16 -32767
#define MIN24 -8388607
#define MAXCO16 65536
#define MAXCO24 16777216
#define MAX24 8388607
#define MAX16 32767
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
typedef struct {
unsigned int Address;
int Qbus_fp;
pwr_tInt32 OldValue[IO_MAXCHAN];
int FirstScan[IO_MAXCHAN];
} io_sLocal;
typedef struct {
int Qbus_fp;
} io_sRackLocal;
static pwr_tStatus IoCardInit (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
pwr_tStatus sts;
pwr_sClass_Co_PI24BO *op;
io_sLocal *local;
int i;
pwr_tUInt16 wr_data[2];
pwr_tUInt32 *wr_data_p;
qbus_io_write wb;
op = (pwr_sClass_Co_PI24BO *) cp->op;
local = calloc( 1, sizeof(*local));
for ( i = 0; i < IO_MAXCHAN; i++)
local->FirstScan[i] = 1;
cp->Local = local;
local->Address = op->RegAddress;
local->Qbus_fp = ((io_sRackLocal *)(rp->Local))->Qbus_fp;
errh_Info( "Init of co card '%s'", cp->Name);
/* Configure card */
for ( i = 0; i < op->MaxNoOfCounters; i++)
{
if ( !cp->chanlist[i].cop)
continue;
wr_data_p = (pwr_tUInt32 *) &wr_data;
*wr_data_p = op->SyncRawValue[i];
if ( op->SpeedMeasurement[i] == 1)
wr_data[1] |= (1 << 8);
if ( op->LengthMeasurement[i] == 1)
wr_data[1] |= (1 << 10);
if ( op->MulCount[i] == 2)
wr_data[1] |= (1 << 11);
if ( op->DivCount[i] == 16)
wr_data[1] |= (1 << 9);
if ( op->NoOfBits[i] == 16)
wr_data[1] |= (1 << 12);
if ( op->CopWrRough[i] == 1)
wr_data[1] |= (1 << 13);
if ( op->CopWrFine[i] == 1)
wr_data[1] |= (1 << 14);
if ( op->LoadWrReg[i] == 1)
wr_data[1] |= (1 << 15);
wb.Address = local->Address + 4*i;
wb.Data = wr_data[0];
sts = write( local->Qbus_fp, &wb, sizeof(wb));
if ( sts != -1)
{
wb.Address += 2;
wb.Data = wr_data[1];
sts = write( local->Qbus_fp, &wb, sizeof(wb));
}
if ( sts == -1)
{
errh_Error( "IO init, Fatal write error, card '%s', IO i stopped", cp->Name);
return IO__ERRDEVICE;
}
if ( op->LoadWrReg[i] == 1)
{
* (pwr_tUInt32 *) cp->chanlist[i].vbp = op->SyncRawValue[i];
* (pwr_tUInt32 *) cp->chanlist[i].abs_vbp = op->SyncRawValue[i];
}
else
{
* (pwr_tUInt32 *) cp->chanlist[i].vbp = 0;
}
/* Data is written to device */
op->COWrFlag[i] = 0;
}
return 1;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static pwr_tStatus IoCardClose (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
io_sLocal *local;
local = (io_sLocal *) cp->Local;
errh_Info( "IO closing co card '%s'", cp->Name);
free( (char *) local);
return 1;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static pwr_tStatus IoCardRead (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
io_sLocal *local;
pwr_tUInt16 wr_data[2];
pwr_tUInt16 re_data[2];
pwr_tUInt32 *wr_data_p;
pwr_tUInt32 *re_data_p;
pwr_sClass_Co_PI24BO *op;
pwr_tInt32 numofword;
int i;
pwr_tInt16 co16_data;
pwr_tInt32 newdiff,diff,co24_data;
int sts, sts1, sts2;
qbus_io_read rb;
qbus_io_write wb;
local = (io_sLocal *) cp->Local;
op = (pwr_sClass_Co_PI24BO *) cp->op;
for ( i = 0; i < op->MaxNoOfCounters; i++)
{
if ( !cp->chanlist[i].cop)
continue;
if ( op->ConvMask & (1 << i))
{
/* Conversion is on */
if ( op->COWrFlag[i])
{
/* New configuration of card */
wr_data_p = (pwr_tUInt32 *) &wr_data;
*wr_data_p = op->SyncRawValue[i];
if ( op->SpeedMeasurement[i] == 1)
wr_data[1] |= (1 << 8);
if ( op->LengthMeasurement[i] == 1)
wr_data[1] |= (1 << 10);
if ( op->MulCount[i] == 2)
wr_data[1] |= (1 << 11);
if ( op->DivCount[i] == 16)
wr_data[1] |= (1 << 9);
if ( op->NoOfBits[i] == 16)
wr_data[1] |= (1 << 12);
if ( op->CopWrRough[i] == 1)
wr_data[1] |= (1 << 13);
if ( op->CopWrFine[i] == 1)
wr_data[1] |= (1 << 14);
if ( op->LoadWrReg[i] == 1)
wr_data[1] |= (1 << 15);
wb.Address = local->Address + 4*i;
wb.Data = wr_data[0];
sts = write( local->Qbus_fp, &wb, sizeof(wb));
if ( sts != -1)
{
wb.Address += 2;
wb.Data = wr_data[1];
sts = write( local->Qbus_fp, &wb, sizeof(wb));
}
if ( sts == -1)
{
errh_Error( "IO init, Fatal write error, card '%s', IO i stopped", cp->Name);
}
op->COWrFlag[i] = 0;
}
if ( op->NoOfBits[i] == 24)
numofword = 2;
else
numofword = 1; /* 16 bitscounter */
re_data_p = (pwr_tUInt32 *) &re_data;
#if defined(OS_ELN)
vaxc$establish(machfailread_co);
#endif
rb.Address = local->Address + 4*i;
sts1 = read( local->Qbus_fp, &rb, sizeof(rb));
re_data[0] = (unsigned short) rb.Data;
if ( numofword == 2)
{
rb.Address += 2;
sts2 = read( local->Qbus_fp, &rb, sizeof(rb));
re_data[1] = (unsigned short) rb.Data;
}
else
sts2 = 0;
if ( sts1 == -1 || sts2 == -1)
{
#if 0
if ( io_fatal_error)
{
/* Activate emergency break */
errh_Error( "Fatal read error, card '%s', IO i stopped", cp->Name);
ctx->Node->EmergBreakTrue = 1;
return IO__ERRDEVICE;
}
#endif
/* Increase error count and check error limits */
op->ErrorCount++;
if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
if ( op->ErrorCount >= op->ErrorHardLimit)
{
errh_Error( "IO Error hard limit reached on card '%s', IO stopped", cp->Name);
ctx->Node->EmergBreakTrue = 1;
return IO__ERRDEVICE;
}
continue;
}
}
/* No faults detected calculate countervalue and store them */
if (numofword == 1) /* 16 bits counter */
{
co16_data = re_data[0];
/* If this is the first lap we dont have any correct saved
countvalues. Therefor we save the new value. */
if ( local->FirstScan[i])
local->OldValue[i] = co16_data;
/* Store the counter values into RTDB */
*(pwr_tUInt32 *) cp->chanlist[i].vbp = co16_data;
/* Test if an abs-value should be calculated and stored */
if ( op->COAbsFlag[i] == TRUE)
{
/* Calculate difference between two readings*/
diff = co16_data - local->OldValue[i];
local->OldValue[i] = co16_data; /* Store new value */
/* Check if the counter is passing zero or max,
and calculate if it is counting up or down */
if (diff < MIN16) /* Up count over maxlimit */
newdiff = MAXCO16 + diff;
else if (diff > MAX16)
newdiff = diff - MAXCO16;
else
newdiff = diff;
/* Store the counter abs-values into RTDB */
*(pwr_tUInt32 *) cp->chanlist[i].abs_vbp += newdiff;
}
}
else if (numofword == 2) /* 24 bits counter */
{
co24_data = *re_data_p;
/* If this is the first lap we dont have any correct saved
countvalues. Therefor we save the new value. */
if ( local->FirstScan[i])
local->OldValue[i] = co24_data;
/* Store the counter values into RTDB */
*(pwr_tUInt32 *) cp->chanlist[i].vbp = co24_data;
/* Test if an abs-value should be calaulated and stored */
if ( op->COAbsFlag[i] == TRUE)
{
/* Calculate difference between two readings */
diff = co24_data - local->OldValue[i];
local->OldValue[i] = co24_data; /* Store new value */
/* Check if the counter is passing zero or max,
and calculate if it is counting up or down */
if (diff < MIN24) /* Up count over maxlimit */
newdiff = MAXCO24 + diff;
else if (diff > MAX24 )
newdiff = diff - MAXCO24 ;
else
newdiff = diff ;
/* Store the counter abs-values into RTDB */
*(pwr_tUInt32 *) cp->chanlist[i].abs_vbp += newdiff;
}
}
local->FirstScan[i] = 0;
}
return 1;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindIoMethods(Co_PI24BO) = {
pwr_BindIoMethod(IoCardInit),
pwr_BindIoMethod(IoCardClose),
pwr_BindIoMethod(IoCardRead),
pwr_NullMethod
};
pwr_dExport pwr_BindIoMethods(Co_CO4uP) = {
pwr_BindIoMethod(IoCardInit),
pwr_BindIoMethod(IoCardClose),
pwr_BindIoMethod(IoCardRead),
pwr_NullMethod
};
/*
* Proview $Id: rt_io_m_di_dix2.c,v 1.1 2005-12-30 15:52:05 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_io_m_di_dix2.c -- io methods for ssab cards.
OS Linux
*/
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#include "pwr.h"
#include "rt_errh.h"
#include "pwr_baseclasses.h"
#include "pwr_basecomponentclasses.h"
#include "pwr_ssaboxclasses.h"
#include "rt_io_base.h"
#include "rt_io_msg.h"
#include "rt_io_filter_di.h"
#include "rt_io_ssab.h"
#include "rt_io_card_init.h"
#include "rt_io_card_close.h"
#include "rt_io_card_read.h"
#include "qbus_io.h"
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
typedef struct {
unsigned int Address[2];
int Qbus_fp;
struct {
pwr_sClass_Di *sop[16];
void *Data[16];
pwr_tBoolean Found;
} Filter[2];
} io_sLocal;
typedef struct {
int Qbus_fp;
} io_sRackLocal;
static pwr_tStatus IoCardInit (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
pwr_sClass_Di_DIX2 *op;
io_sLocal *local;
int i, j;
op = (pwr_sClass_Di_DIX2 *) cp->op;
local = calloc( 1, sizeof(*local));
cp->Local = local;
errh_Info( "Init of di card '%s'", cp->Name);
local->Address[0] = op->RegAddress;
local->Address[1] = op->RegAddress + 2;
local->Qbus_fp = ((io_sRackLocal *)(rp->Local))->Qbus_fp;
/* Init filter */
for ( i = 0; i < 2; i++)
{
/* The filter handles one 16-bit word */
for ( j = 0; j < 16; j++)
local->Filter[i].sop[j] = cp->chanlist[i*16+j].sop;
io_InitDiFilter( local->Filter[i].sop, &local->Filter[i].Found,
local->Filter[i].Data, ctx->ScanTime);
}
return 1;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static pwr_tStatus IoCardClose (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
io_sLocal *local;
int i;
local = (io_sLocal *) cp->Local;
errh_Info( "IO closing di card '%s'", cp->Name);
/* Free filter data */
for ( i = 0; i < 2; i++)
{
if ( local->Filter[i].Found)
io_CloseDiFilter( local->Filter[i].Data);
}
free( (char *) local);
return 1;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static pwr_tStatus IoCardRead (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
io_sLocal *local;
pwr_tUInt16 data = 0;
pwr_sClass_Di_DIX2 *op;
pwr_tUInt16 invmask;
pwr_tUInt16 convmask;
int i;
int sts;
qbus_io_read rb;
local = (io_sLocal *) cp->Local;
op = (pwr_sClass_Di_DIX2 *) cp->op;
for ( i = 0; i < 2; i++)
{
if ( i == 0)
{
convmask = op->ConvMask1;
invmask = op->InvMask1;
}
else
{
convmask = op->ConvMask2;
invmask = op->InvMask2;
if ( !convmask)
break;
if ( op->MaxNoOfChannels == 16)
break;
}
rb.Address = local->Address[i];
sts = read( local->Qbus_fp, &rb, sizeof(rb));
data = (unsigned short) rb.Data;
if ( sts == -1)
{
/* Increase error count and check error limits */
op->ErrorCount++;
if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
if ( op->ErrorCount >= op->ErrorHardLimit)
{
errh_Error( "IO Error hard limit reached on card '%s', IO stopped", cp->Name);
ctx->Node->EmergBreakTrue = 1;
return IO__ERRDEVICE;
}
continue;
}
/* Invert */
data = data ^ invmask;
/* Filter ... */
if ( local->Filter[i].Found)
io_DiFilter( local->Filter[i].sop, &data, local->Filter[i].Data);
/* Move data to valuebase */
io_DiUnpackWord( cp, data, convmask, i);
}
return 1;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindIoMethods(Di_DIX2) = {
pwr_BindIoMethod(IoCardInit),
pwr_BindIoMethod(IoCardClose),
pwr_BindIoMethod(IoCardRead),
pwr_NullMethod
};
/*
* Proview $Id: rt_io_m_do_hvdo32.c,v 1.1 2005-12-30 15:52:05 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_io_m_do_hvdo32.c -- io methods for ssab cards.
OS Linux
*/
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#include "pwr.h"
#include "rt_errh.h"
#include "pwr_baseclasses.h"
#include "pwr_basecomponentclasses.h"
#include "pwr_ssaboxclasses.h"
#include "rt_io_base.h"
#include "rt_io_msg.h"
#include "rt_io_filter_po.h"
#include "rt_io_ssab.h"
#include "rt_io_card_init.h"
#include "rt_io_card_close.h"
#include "rt_io_card_write.h"
#include "qbus_io.h"
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
typedef struct {
unsigned int Address[2];
int Qbus_fp;
struct {
pwr_sClass_Po *sop[16];
void *Data[16];
pwr_tBoolean Found;
} Filter[2];
} io_sLocal;
typedef struct {
int Qbus_fp;
} io_sRackLocal;
static pwr_tStatus IoCardInit (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
pwr_sClass_Do_HVDO32 *op;
io_sLocal *local;
int i, j;
op = (pwr_sClass_Do_HVDO32 *) cp->op;
local = calloc( 1, sizeof(*local));
cp->Local = local;
errh_Info( "Init of do card '%s'", cp->Name);
local->Address[0] = op->RegAddress;
local->Address[1] = op->RegAddress + 2;
local->Qbus_fp = ((io_sRackLocal *)(rp->Local))->Qbus_fp;
/* Init filter for Po signals */
for ( i = 0; i < 2; i++)
{
/* The filter handles one 16-bit word */
for ( j = 0; j < 16; j++)
{
if ( cp->chanlist[i*16+j].SigClass == pwr_cClass_Po)
local->Filter[i].sop[j] = cp->chanlist[i*16+j].sop;
}
io_InitPoFilter( local->Filter[i].sop, &local->Filter[i].Found,
local->Filter[i].Data, ctx->ScanTime);
}
return 1;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static pwr_tStatus IoCardClose (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
io_sLocal *local;
int i;
local = (io_sLocal *) cp->Local;
errh_Info( "IO closing do card '%s'", cp->Name);
/* Free filter data */
for ( i = 0; i < 2; i++)
{
if ( local->Filter[i].Found)
io_ClosePoFilter( local->Filter[i].Data);
}
free( (char *) local);
return 1;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static pwr_tStatus IoCardWrite (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
io_sLocal *local;
pwr_tUInt16 data = 0;
pwr_sClass_Do_HVDO32 *op;
pwr_tUInt16 invmask;
pwr_tUInt16 testmask;
pwr_tUInt16 testvalue;
int i;
qbus_io_write wb;
int sts;
local = (io_sLocal *) cp->Local;
op = (pwr_sClass_Do_HVDO32 *) cp->op;
#if defined(OS_ELN)
vaxc$establish(machfailwrite);
#endif
for ( i = 0; i < 2; i++)
{
if ( ctx->Node->EmergBreakTrue && ctx->Node->EmergBreakSelect == FIXOUT)
{
if ( i == 0)
data = op->FixedOutValue1;
else
data = op->FixedOutValue2;
}
else
io_DoPackWord( cp, &data, i);
if ( i == 0)
{
testmask = op->TestMask1;
invmask = op->InvMask1;
}
else
{
testmask = op->TestMask2;
invmask = op->InvMask2;
if ( op->MaxNoOfChannels == 16)
break;
}
/* Invert */
data = data ^ invmask;
/* Filter Po signals */
if ( local->Filter[i].Found)
io_PoFilter( local->Filter[i].sop, &data, local->Filter[i].Data);
/* Testvalues */
if ( testmask)
{
if ( i == 0)
testvalue = op->TestValue1;
else
testvalue = op->TestValue2;
data = (data & ~ testmask) | (testmask & testvalue);
}
wb.Data = data;
wb.Address = local->Address[i];
sts = write( local->Qbus_fp, &wb, sizeof(wb));
if ( sts == -1)
{
#if 0
/* Exceptionhandler was called */
if ( io_fatal_error)
{
/* Activate emergency break */
errh_Error( "Fatal write error, card '%s', IO is stopped", cp->Name);
ctx->Node->EmergBreakTrue = 1;
return IO__ERRDEVICE;
}
#endif
/* Increase error count and check error limits */
op->ErrorCount++;
if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
if ( op->ErrorCount >= op->ErrorHardLimit)
{
errh_Error( "IO Error hard limit reached on card '%s', IO stopped", cp->Name);
ctx->Node->EmergBreakTrue = 1;
return IO__ERRDEVICE;
}
continue;
}
}
return 1;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindIoMethods(Do_HVDO32) = {
pwr_BindIoMethod(IoCardInit),
pwr_BindIoMethod(IoCardClose),
pwr_BindIoMethod(IoCardWrite),
pwr_NullMethod
};
/*
* Proview $Id: rt_io_m_rack_ssab.c,v 1.1 2005-12-30 15:52:05 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_io_m_rack_ssab.c -- io methods for ssab rack objects. */
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "pwr_basecomponentclasses.h"
#include "pwr_ssaboxclasses.h"
#include "rt_io_base.h"
#include "rt_errh.h"
#include "rt_io_rack_init.h"
#include "rt_io_msg.h"
typedef struct {
int Qbus_fp;
} io_sRackLocal;
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static pwr_tStatus IoRackInit (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp
)
{
io_sRackLocal *local;
/* Open Qbus driver */
local = calloc( 1, sizeof(*local));
rp->Local = local;
local->Qbus_fp = open("/dev/qbus", O_RDWR);
if ( local->Qbus_fp == -1)
{
errh_Error( "Qbus initialization error, IO rack %s", rp->Name);
ctx->Node->EmergBreakTrue = 1;
return IO__ERRDEVICE;
}
errh_Info( "Init of IO rack %s", rp->Name);
return 1;
}
static pwr_tStatus IoRackClose (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp
)
{
io_sRackLocal *local;
/* Close Qbus driver */
local = rp->Local;
close( local->Qbus_fp);
free( (char *)local);
return 1;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindIoMethods(Rack_SSAB) = {
pwr_BindIoMethod(IoRackInit),
pwr_BindIoMethod(IoRackClose),
pwr_NullMethod
};
/*
* Proview $Id: rt_io_m_ssab_aiup.c,v 1.1 2005-12-30 15:52:05 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_io_m_ssab_ai.c -- io methods for ssab cards. */
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include "pwr.h"
#include "co_cdh.h"
#include "rt_gdh.h"
#include "rt_errh.h"
#include "pwr_baseclasses.h"
#include "pwr_basecomponentclasses.h"
#include "pwr_ssaboxclasses.h"
#include "rt_io_base.h"
#include "rt_io_msg.h"
#include "rt_io_ssab.h"
#include "rt_io_card_init.h"
#include "rt_io_card_close.h"
#include "rt_io_card_read.h"
#include "qbus_io.h"
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
#define IO_MAXCHAN 32
typedef struct {
unsigned int Address;
int Qbus_fp;
int ScanCount[IO_MAXCHAN];
} io_sLocal;
typedef struct {
int Qbus_fp;
} io_sRackLocal;
static pwr_tStatus AiRangeToCoef(
io_sChannel *chanp)
{
pwr_sClass_ChanAi *cop;
char buf[120];
pwr_tStatus sts;
pwr_tFloat32 PolyCoef1;
pwr_tFloat32 PolyCoef0;
cop = chanp->cop;
if ( cop)
{
cop->CalculateNewCoef = 0;
/* Coef for RawValue to SignalValue conversion */
cop->SigValPolyCoef0 = 0;
cop->SigValPolyCoef1 = cop->ChannelSigValRangeHigh / 30000;
/* Coef for SignalValue to ActualValue conversion */
if ( chanp->ChanClass != pwr_cClass_ChanAit && cop->SensorPolyType == 1)
{
if ( cop->SensorSigValRangeHigh != cop->SensorSigValRangeLow)
{
PolyCoef1 = (cop->ActValRangeHigh - cop->ActValRangeLow)/
(cop->SensorSigValRangeHigh - cop->SensorSigValRangeLow);
PolyCoef0 = cop->ActValRangeHigh - cop->SensorSigValRangeHigh *
PolyCoef1;
cop->SensorPolyCoef1 = cop->SigValPolyCoef1 * PolyCoef1;
cop->SensorPolyCoef0 = PolyCoef0 + PolyCoef1*
cop->SigValPolyCoef0;
}
else
{
sts = gdh_AttrrefToName( &chanp->ChanAref, buf, sizeof(buf),
cdh_mName_volumeStrict);
if ( EVEN(sts)) return sts;
errh_Error( "Invalid SigValueRange in Ai channel %s", buf);
return IO__CHANRANGE;
}
}
}
return IO__SUCCESS;
}
static pwr_tStatus IoCardInit (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
pwr_sClass_Ssab_BaseACard *op;
io_sLocal *local;
int i;
io_sChannel *chanp;
op = (pwr_sClass_Ssab_BaseACard *) cp->op;
local = calloc( 1, sizeof(*local));
cp->Local = local;
local->Address = op->RegAddress;
local->Qbus_fp = ((io_sRackLocal *)(rp->Local))->Qbus_fp;
errh_Info( "Init of ai card '%s'", cp->Name);
/* Caluclate polycoeff */
chanp = cp->chanlist;
for ( i = 0; i < cp->ChanListSize; i++)
{
if ( chanp->sop)
AiRangeToCoef( chanp);
chanp++;
}
return 1;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static pwr_tStatus IoCardClose (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
io_sLocal *local;
errh_Info( "IO closing ai card '%s'", cp->Name);
local = (io_sLocal *) cp->Local;
free( (char *) local);
return 1;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static pwr_tStatus IoCardRead (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
io_sLocal *local;
pwr_tInt16 data = 0;
pwr_sClass_Ssab_BaseACard *op;
int i;
pwr_tFloat32 actvalue;
io_sChannel *chanp;
pwr_sClass_ChanAi *cop;
pwr_sClass_Ai *sop;
int sts;
qbus_io_read rb;
local = (io_sLocal *) cp->Local;
op = (pwr_sClass_Ssab_BaseACard *) cp->op;
chanp = &cp->chanlist[0];
for ( i = 0; i < cp->ChanListSize; i++)
{
if ( !chanp->cop || !chanp->sop)
{
chanp++;
continue;
}
cop = (pwr_sClass_ChanAi *) chanp->cop;
sop = (pwr_sClass_Ai *) chanp->sop;
if ( cop->CalculateNewCoef)
AiRangeToCoef( chanp);
if ( cop->ConversionOn)
{
if ( local->ScanCount[i] <= 1)
{
#if defined(OS_ELN)
vaxc$establish(machfailread);
#endif
rb.Address = local->Address + 2*i;
sts = read( local->Qbus_fp, &rb, sizeof(rb));
data = (unsigned short) rb.Data;
if ( sts == -1)
{
#if 0
/* Exceptionhandler was called */
if ( io_fatal_error)
{
/* Activate emergency break */
errh_Error( "Fatal read error, card '%s', IO is stopped", cp->Name);
ctx->Node->EmergBreakTrue = 1;
return IO__ERRDEVICE;
}
#endif
/* Increase error count and check error limits */
op->ErrorCount++;
if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
if ( op->ErrorCount >= op->ErrorHardLimit)
{
errh_Error( "IO Error hard limit reached on card '%s', IO stopped", cp->Name);
ctx->Node->EmergBreakTrue = 1;
return IO__ERRDEVICE;
}
chanp++;
continue;
}
/* Convert rawvalue to sigvalue and actualvalue */
sop->RawValue = data;
sop->SigValue = data * cop->SigValPolyCoef1 + cop->SigValPolyCoef0;
switch ( chanp->ChanClass)
{
case pwr_cClass_ChanAi:
io_ConvertAi( cop, data, &actvalue);
break;
case pwr_cClass_ChanAit:
io_ConvertAit( (pwr_sClass_ChanAit *) cop, data, &actvalue);
break;
}
/* Filter */
if ( sop->FilterType == 1 &&
sop->FilterAttribute[0] > 0 &&
sop->FilterAttribute[0] > ctx->ScanTime)
{
actvalue = *(pwr_tFloat32 *)chanp->vbp +
ctx->ScanTime / sop->FilterAttribute[0] *
(actvalue - *(pwr_tFloat32 *)chanp->vbp);
}
*(pwr_tFloat32 *) chanp->vbp = actvalue;
local->ScanCount[i] = cop->ScanInterval + 1;
}
local->ScanCount[i]--;
}
chanp++;
}
return 1;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindIoMethods(Ssab_AiuP) = {
pwr_BindIoMethod(IoCardInit),
pwr_BindIoMethod(IoCardClose),
pwr_BindIoMethod(IoCardRead),
pwr_NullMethod
};
/*
* Proview $Id: rt_io_m_ssab_aoup.c,v 1.1 2005-12-30 15:52:05 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_io_m_ssab_aoup.c -- io methods for ssab cards. */
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include "pwr.h"
#include "rt_errh.h"
#include "co_cdh.h"
#include "rt_gdh.h"
#include "pwr_baseclasses.h"
#include "pwr_basecomponentclasses.h"
#include "pwr_ssaboxclasses.h"
#include "rt_io_base.h"
#include "rt_io_msg.h"
#include "rt_io_ssab.h"
#include "rt_io_card_init.h"
#include "rt_io_card_close.h"
#include "rt_io_card_write.h"
#include "qbus_io.h"
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
#define IO_MAXCHAN 8
typedef struct {
unsigned int Address;
int Qbus_fp;
pwr_tFloat32 OldValue[IO_MAXCHAN];
pwr_tBoolean OldTestOn[IO_MAXCHAN];
int WriteFirst;
} io_sLocal;
typedef struct {
int Qbus_fp;
} io_sRackLocal;
static pwr_tStatus AoRangeToCoef(
io_sChannel *chanp)
{
pwr_sClass_ChanAo *cop;
char buf[120];
pwr_tStatus sts;
pwr_tFloat32 PolyCoef1;
pwr_tFloat32 PolyCoef0;
cop = chanp->cop;
if ( cop)
{
cop->CalculateNewCoef = 0;
/* Coef for ActualValue to RawValue conversion */
if ( cop->ActValRangeHigh != cop->ActValRangeLow)
{
cop->SigValPolyCoef1 = (cop->SensorSigValRangeHigh - cop->SensorSigValRangeLow)/
(cop->ActValRangeHigh - cop->ActValRangeLow);
cop->SigValPolyCoef0 = cop->SensorSigValRangeHigh - cop->ActValRangeHigh *
cop->SigValPolyCoef1;
}
else
{
sts = gdh_AttrrefToName( &chanp->ChanAref, buf, sizeof(buf),
cdh_mName_volumeStrict);
if ( EVEN(sts)) return sts;
errh_Error( "Invalid ActValueRange in Ao channel %s", buf);
return IO__CHANRANGE;
}
/* Coef for ActualValue to SignalValue conversion */
if ( cop->ChannelSigValRangeHigh != 0)
{
PolyCoef0 = 0;
PolyCoef1 = cop->RawValRangeHigh / cop->ChannelSigValRangeHigh;
cop->OutPolyCoef1 = cop->SigValPolyCoef1 * PolyCoef1;
cop->OutPolyCoef0 = PolyCoef0 + PolyCoef1*
cop->SigValPolyCoef0;
}
else
{
sts = gdh_AttrrefToName( &chanp->ChanAref, buf, sizeof(buf),
cdh_mName_volumeStrict);
if ( EVEN(sts)) return sts;
errh_Error( "Invalid SigValueRange in Ao channel %s", buf);
return IO__CHANRANGE;
}
}
return IO__SUCCESS;
}
static pwr_tStatus IoCardInit (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
pwr_sClass_Ssab_BaseACard *op;
io_sChannel *chanp;
int i;
io_sLocal *local;
op = (pwr_sClass_Ssab_BaseACard *) cp->op;
local = calloc( 1, sizeof(*local));
local->Address = op->RegAddress;
local->Qbus_fp = ((io_sRackLocal *)(rp->Local))->Qbus_fp;
errh_Info( "Init of ao card '%s'", cp->Name);
/* Write the first 50 loops */
local->WriteFirst = 50;
cp->Local = local;
/* Caluclate polycoeff */
chanp = cp->chanlist;
for ( i = 0; i < cp->ChanListSize; i++)
{
if ( chanp->sop)
AoRangeToCoef( chanp);
chanp++;
}
return 1;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static pwr_tStatus IoCardClose (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
io_sLocal *local;
local = (io_sLocal *) cp->Local;
errh_Info( "IO closing ao card '%s'", cp->Name);
free( (char *) local);
return 1;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static pwr_tStatus IoCardWrite (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
io_sLocal *local;
pwr_sClass_Ssab_BaseACard *op;
int i;
io_sChannel *chanp;
pwr_sClass_ChanAo *cop;
pwr_sClass_Ao *sop;
pwr_tFloat32 value;
int fixout;
pwr_tUInt16 data;
pwr_tFloat32 rawvalue;
qbus_io_write wb;
int sts;
local = (io_sLocal *) cp->Local;
op = (pwr_sClass_Ssab_BaseACard *) cp->op;
fixout = ctx->Node->EmergBreakTrue && ctx->Node->EmergBreakSelect == FIXOUT;
chanp = &cp->chanlist[0];
for ( i = 0; i < cp->ChanListSize; i++)
{
if ( !chanp->cop || !chanp->sop)
{
chanp++;
continue;
}
cop = (pwr_sClass_ChanAo *) chanp->cop;
sop = (pwr_sClass_Ao *) chanp->sop;
if ( *(pwr_tFloat32 *)chanp->vbp != local->OldValue[i] ||
local->WriteFirst > 0 ||
cop->CalculateNewCoef ||
fixout ||
cop->TestOn || local->OldTestOn[i] != cop->TestOn)
{
if ( fixout)
value = cop->FixedOutValue;
else if ( cop->TestOn)
value = cop->TestValue;
else
value = *(pwr_tFloat32 *) chanp->vbp;
if ( cop->CalculateNewCoef)
AoRangeToCoef( chanp);
/* Convert to rawvalue */
if ( value > cop->ActValRangeHigh)
value = cop->ActValRangeHigh;
else if ( value < cop->ActValRangeLow)
value = cop->ActValRangeLow;
rawvalue = cop->OutPolyCoef1 * value + cop->OutPolyCoef0;
if ( rawvalue > 0)
sop->RawValue = rawvalue + 0.5;
else
sop->RawValue = rawvalue - 0.5;
data = sop->RawValue;
#if defined(OS_ELN)
vaxc$establish(machfailwrite);
#endif
wb.Data = data;
wb.Address = local->Address + 2*i;
sts = write( local->Qbus_fp, &wb, sizeof(wb));
if ( sts == -1)
{
/* Exceptionhandler was called */
#if 0
if ( io_fatal_error)
{
/* Activate emergency break */
errh_Error( "Fatal write error, card '%s', IO is stopped", cp->Name);
ctx->Node->EmergBreakTrue = 1;
return IO__ERRDEVICE;
}
#endif
/* Increase error count and check error limits */
op->ErrorCount++;
if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
if ( op->ErrorCount >= op->ErrorHardLimit)
{
errh_Error( "IO Error hard limit reached on card '%s', IO stopped", cp->Name);
ctx->Node->EmergBreakTrue = 1;
return IO__ERRDEVICE;
}
chanp++;
continue;
}
else
local->OldValue[i] = value;
}
local->OldTestOn[i] = cop->TestOn;
chanp++;
}
if ( local->WriteFirst)
local->WriteFirst--;
return 1;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindIoMethods(Ssab_AouP) = {
pwr_BindIoMethod(IoCardInit),
pwr_BindIoMethod(IoCardClose),
pwr_BindIoMethod(IoCardWrite),
pwr_NullMethod
};
/*
* Proview $Id: rt_io_m_ssab_co.c,v 1.1 2005-12-30 15:52:05 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_io_m_ssab_co.c -- io methods for ssab cards. */
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include "pwr.h"
#include "rt_errh.h"
#include "pwr_baseclasses.h"
#include "pwr_basecomponentclasses.h"
#include "pwr_ssaboxclasses.h"
#include "rt_io_base.h"
#include "rt_io_msg.h"
#include "rt_io_ssab.h"
#include "rt_io_card_init.h"
#include "rt_io_card_close.h"
#include "rt_io_card_read.h"
#include "qbus_io.h"
#define IO_MAXCHAN 4
#define MIN16 -32767
#define MIN24 -8388607
#define MAXCO16 65536
#define MAXCO24 16777216
#define MAX24 8388607
#define MAX16 32767
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
typedef struct {
unsigned int Address;
int Qbus_fp;
pwr_tInt32 OldValue[IO_MAXCHAN];
int FirstScan[IO_MAXCHAN];
} io_sLocal;
typedef struct {
int Qbus_fp;
} io_sRackLocal;
static pwr_tStatus IoCardInit (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
pwr_tStatus sts;
pwr_sClass_Ssab_CO4uP *op;
io_sLocal *local;
int i;
pwr_tUInt16 wr_data[2];
pwr_tUInt32 *wr_data_p;
qbus_io_write wb;
op = (pwr_sClass_Ssab_CO4uP *) cp->op;
local = calloc( 1, sizeof(*local));
for ( i = 0; i < IO_MAXCHAN; i++)
local->FirstScan[i] = 1;
cp->Local = local;
local->Address = op->RegAddress;
local->Qbus_fp = ((io_sRackLocal *)(rp->Local))->Qbus_fp;
errh_Info( "Init of co card '%s'", cp->Name);
/* Configure card */
for ( i = 0; i < op->MaxNoOfCounters; i++)
{
if ( !cp->chanlist[i].cop || !cp->chanlist[i].sop)
continue;
wr_data_p = (pwr_tUInt32 *) &wr_data;
*wr_data_p = op->SyncRawValue[i];
if ( op->SpeedMeasurement[i] == 1)
wr_data[1] |= (1 << 8);
if ( op->LengthMeasurement[i] == 1)
wr_data[1] |= (1 << 10);
if ( op->MulCount[i] == 2)
wr_data[1] |= (1 << 11);
if ( op->DivCount[i] == 16)
wr_data[1] |= (1 << 9);
if ( op->NoOfBits[i] == 16)
wr_data[1] |= (1 << 12);
if ( op->CopWrRough[i] == 1)
wr_data[1] |= (1 << 13);
if ( op->CopWrFine[i] == 1)
wr_data[1] |= (1 << 14);
if ( op->LoadWrReg[i] == 1)
wr_data[1] |= (1 << 15);
wb.Address = local->Address + 4*i;
wb.Data = wr_data[0];
sts = write( local->Qbus_fp, &wb, sizeof(wb));
if ( sts != -1)
{
wb.Address += 2;
wb.Data = wr_data[1];
sts = write( local->Qbus_fp, &wb, sizeof(wb));
}
if ( sts == -1)
{
errh_Error( "IO init, Fatal write error, card '%s', IO i stopped", cp->Name);
return IO__ERRDEVICE;
}
if ( op->LoadWrReg[i] == 1)
{
* (pwr_tUInt32 *) cp->chanlist[i].vbp = op->SyncRawValue[i];
* (pwr_tUInt32 *) cp->chanlist[i].abs_vbp = op->SyncRawValue[i];
}
else
{
* (pwr_tUInt32 *) cp->chanlist[i].vbp = 0;
}
/* Data is written to device */
op->COWrFlag[i] = 0;
}
return 1;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static pwr_tStatus IoCardClose (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
io_sLocal *local;
local = (io_sLocal *) cp->Local;
errh_Info( "IO closing co card '%s'", cp->Name);
free( (char *) local);
return 1;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static pwr_tStatus IoCardRead (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
io_sLocal *local;
pwr_tUInt16 wr_data[2];
pwr_tUInt16 re_data[2];
pwr_tUInt32 *wr_data_p;
pwr_tUInt32 *re_data_p;
pwr_sClass_Ssab_CO4uP *op;
pwr_tInt32 numofword;
int i;
pwr_tInt16 co16_data;
pwr_tInt32 newdiff,diff,co24_data;
int sts, sts1, sts2;
qbus_io_read rb;
qbus_io_write wb;
local = (io_sLocal *) cp->Local;
op = (pwr_sClass_Ssab_CO4uP *) cp->op;
for ( i = 0; i < op->MaxNoOfCounters; i++)
{
if ( !cp->chanlist[i].cop || !cp->chanlist[i].sop)
continue;
if ( op->ConvMask & (1 << i))
{
/* Conversion is on */
if ( op->COWrFlag[i])
{
/* New configuration of card */
wr_data_p = (pwr_tUInt32 *) &wr_data;
*wr_data_p = op->SyncRawValue[i];
if ( op->SpeedMeasurement[i] == 1)
wr_data[1] |= (1 << 8);
if ( op->LengthMeasurement[i] == 1)
wr_data[1] |= (1 << 10);
if ( op->MulCount[i] == 2)
wr_data[1] |= (1 << 11);
if ( op->DivCount[i] == 16)
wr_data[1] |= (1 << 9);
if ( op->NoOfBits[i] == 16)
wr_data[1] |= (1 << 12);
if ( op->CopWrRough[i] == 1)
wr_data[1] |= (1 << 13);
if ( op->CopWrFine[i] == 1)
wr_data[1] |= (1 << 14);
if ( op->LoadWrReg[i] == 1)
wr_data[1] |= (1 << 15);
wb.Address = local->Address + 4*i;
wb.Data = wr_data[0];
sts = write( local->Qbus_fp, &wb, sizeof(wb));
if ( sts != -1)
{
wb.Address += 2;
wb.Data = wr_data[1];
sts = write( local->Qbus_fp, &wb, sizeof(wb));
}
if ( sts == -1)
{
errh_Error( "IO init, Fatal write error, card '%s', IO i stopped", cp->Name);
}
op->COWrFlag[i] = 0;
}
if ( op->NoOfBits[i] == 24)
numofword = 2;
else
numofword = 1; /* 16 bitscounter */
re_data_p = (pwr_tUInt32 *) &re_data;
#if defined(OS_ELN)
vaxc$establish(machfailread_co);
#endif
rb.Address = local->Address + 4*i;
sts1 = read( local->Qbus_fp, &rb, sizeof(rb));
re_data[0] = (unsigned short) rb.Data;
if ( numofword == 2)
{
rb.Address += 2;
sts2 = read( local->Qbus_fp, &rb, sizeof(rb));
re_data[1] = (unsigned short) rb.Data;
}
else
sts2 = 0;
if ( sts1 == -1 || sts2 == -1)
{
#if 0
if ( io_fatal_error)
{
/* Activate emergency break */
errh_Error( "Fatal read error, card '%s', IO i stopped", cp->Name);
ctx->Node->EmergBreakTrue = 1;
return IO__ERRDEVICE;
}
#endif
/* Increase error count and check error limits */
op->ErrorCount++;
if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
if ( op->ErrorCount >= op->ErrorHardLimit)
{
errh_Error( "IO Error hard limit reached on card '%s', IO stopped", cp->Name);
ctx->Node->EmergBreakTrue = 1;
return IO__ERRDEVICE;
}
continue;
}
}
/* No faults detected calculate countervalue and store them */
if (numofword == 1) /* 16 bits counter */
{
co16_data = re_data[0];
/* If this is the first lap we dont have any correct saved
countvalues. Therefor we save the new value. */
if ( local->FirstScan[i])
local->OldValue[i] = co16_data;
/* Store the counter values into RTDB */
*(pwr_tUInt32 *) cp->chanlist[i].vbp = co16_data;
/* Test if an abs-value should be calculated and stored */
if ( op->COAbsFlag[i] == TRUE)
{
/* Calculate difference between two readings*/
diff = co16_data - local->OldValue[i];
local->OldValue[i] = co16_data; /* Store new value */
/* Check if the counter is passing zero or max,
and calculate if it is counting up or down */
if (diff < MIN16) /* Up count over maxlimit */
newdiff = MAXCO16 + diff;
else if (diff > MAX16)
newdiff = diff - MAXCO16;
else
newdiff = diff;
/* Store the counter abs-values into RTDB */
*(pwr_tUInt32 *) cp->chanlist[i].abs_vbp += newdiff;
}
}
else if (numofword == 2) /* 24 bits counter */
{
co24_data = *re_data_p;
/* If this is the first lap we dont have any correct saved
countvalues. Therefor we save the new value. */
if ( local->FirstScan[i])
local->OldValue[i] = co24_data;
/* Store the counter values into RTDB */
*(pwr_tUInt32 *) cp->chanlist[i].vbp = co24_data;
/* Test if an abs-value should be calaulated and stored */
if ( op->COAbsFlag[i] == TRUE)
{
/* Calculate difference between two readings */
diff = co24_data - local->OldValue[i];
local->OldValue[i] = co24_data; /* Store new value */
/* Check if the counter is passing zero or max,
and calculate if it is counting up or down */
if (diff < MIN24) /* Up count over maxlimit */
newdiff = MAXCO24 + diff;
else if (diff > MAX24 )
newdiff = diff - MAXCO24 ;
else
newdiff = diff ;
/* Store the counter abs-values into RTDB */
*(pwr_tUInt32 *) cp->chanlist[i].abs_vbp += newdiff;
}
}
local->FirstScan[i] = 0;
}
return 1;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindIoMethods(Ssab_Co) = {
pwr_BindIoMethod(IoCardInit),
pwr_BindIoMethod(IoCardClose),
pwr_BindIoMethod(IoCardRead),
pwr_NullMethod
};
/*
* Proview $Id: rt_io_m_ssab_di.c,v 1.1 2005-12-30 15:52:05 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_io_m_ssab_di.c -- io methods for ssab cards.
OS Linux
*/
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#include "pwr.h"
#include "rt_errh.h"
#include "pwr_baseclasses.h"
#include "pwr_basecomponentclasses.h"
#include "pwr_ssaboxclasses.h"
#include "rt_io_base.h"
#include "rt_io_msg.h"
#include "rt_io_filter_di.h"
#include "rt_io_ssab.h"
#include "rt_io_card_init.h"
#include "rt_io_card_close.h"
#include "rt_io_card_read.h"
#include "qbus_io.h"
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
typedef struct {
unsigned int Address[2];
int Qbus_fp;
struct {
pwr_sClass_Di *sop[16];
void *Data[16];
pwr_tBoolean Found;
} Filter[2];
} io_sLocal;
typedef struct {
int Qbus_fp;
} io_sRackLocal;
static pwr_tStatus IoCardInit (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
pwr_sClass_Ssab_BaseDiCard *op;
io_sLocal *local;
int i, j;
op = (pwr_sClass_Ssab_BaseDiCard *) cp->op;
local = calloc( 1, sizeof(*local));
cp->Local = local;
errh_Info( "Init of di card '%s'", cp->Name);
local->Address[0] = op->RegAddress;
local->Address[1] = op->RegAddress + 2;
local->Qbus_fp = ((io_sRackLocal *)(rp->Local))->Qbus_fp;
/* Init filter */
for ( i = 0; i < 2; i++)
{
/* The filter handles one 16-bit word */
for ( j = 0; j < 16; j++)
local->Filter[i].sop[j] = cp->chanlist[i*16+j].sop;
io_InitDiFilter( local->Filter[i].sop, &local->Filter[i].Found,
local->Filter[i].Data, ctx->ScanTime);
}
return 1;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static pwr_tStatus IoCardClose (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
io_sLocal *local;
int i;
local = (io_sLocal *) cp->Local;
errh_Info( "IO closing di card '%s'", cp->Name);
/* Free filter data */
for ( i = 0; i < 2; i++)
{
if ( local->Filter[i].Found)
io_CloseDiFilter( local->Filter[i].Data);
}
free( (char *) local);
return 1;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static pwr_tStatus IoCardRead (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
io_sLocal *local;
pwr_tUInt16 data = 0;
pwr_sClass_Ssab_BaseDiCard *op;
pwr_tUInt16 invmask;
pwr_tUInt16 convmask;
int i;
int sts;
qbus_io_read rb;
local = (io_sLocal *) cp->Local;
op = (pwr_sClass_Ssab_BaseDiCard *) cp->op;
for ( i = 0; i < 2; i++)
{
if ( i == 0)
{
convmask = op->ConvMask1;
invmask = op->InvMask1;
}
else
{
convmask = op->ConvMask2;
invmask = op->InvMask2;
if ( !convmask)
break;
if ( op->MaxNoOfChannels == 16)
break;
}
rb.Address = local->Address[i];
sts = read( local->Qbus_fp, &rb, sizeof(rb));
data = (unsigned short) rb.Data;
if ( sts == -1)
{
/* Increase error count and check error limits */
op->ErrorCount++;
if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
if ( op->ErrorCount >= op->ErrorHardLimit)
{
errh_Error( "IO Error hard limit reached on card '%s', IO stopped", cp->Name);
ctx->Node->EmergBreakTrue = 1;
return IO__ERRDEVICE;
}
continue;
}
/* Invert */
data = data ^ invmask;
/* Filter ... */
if ( local->Filter[i].Found)
io_DiFilter( local->Filter[i].sop, &data, local->Filter[i].Data);
/* Move data to valuebase */
io_DiUnpackWord( cp, data, convmask, i);
}
return 1;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindIoMethods(Ssab_Di) = {
pwr_BindIoMethod(IoCardInit),
pwr_BindIoMethod(IoCardClose),
pwr_BindIoMethod(IoCardRead),
pwr_NullMethod
};
/*
* Proview $Id: rt_io_m_ssab_do.c,v 1.1 2005-12-30 15:52:05 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_io_m_ssab_do.c -- io methods for ssab cards.
OS Linux
*/
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#include "pwr.h"
#include "rt_errh.h"
#include "pwr_baseclasses.h"
#include "pwr_basecomponentclasses.h"
#include "pwr_ssaboxclasses.h"
#include "rt_io_base.h"
#include "rt_io_msg.h"
#include "rt_io_filter_po.h"
#include "rt_io_ssab.h"
#include "rt_io_card_init.h"
#include "rt_io_card_close.h"
#include "rt_io_card_write.h"
#include "qbus_io.h"
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
typedef struct {
unsigned int Address[2];
int Qbus_fp;
struct {
pwr_sClass_Po *sop[16];
void *Data[16];
pwr_tBoolean Found;
} Filter[2];
} io_sLocal;
typedef struct {
int Qbus_fp;
} io_sRackLocal;
static pwr_tStatus IoCardInit (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
pwr_sClass_Ssab_BaseDoCard *op;
io_sLocal *local;
int i, j;
op = (pwr_sClass_Ssab_BaseDoCard *) cp->op;
local = calloc( 1, sizeof(*local));
cp->Local = local;
errh_Info( "Init of do card '%s'", cp->Name);
local->Address[0] = op->RegAddress;
local->Address[1] = op->RegAddress + 2;
local->Qbus_fp = ((io_sRackLocal *)(rp->Local))->Qbus_fp;
/* Init filter for Po signals */
for ( i = 0; i < 2; i++)
{
/* The filter handles one 16-bit word */
for ( j = 0; j < 16; j++)
{
if ( cp->chanlist[i*16+j].SigClass == pwr_cClass_Po)
local->Filter[i].sop[j] = cp->chanlist[i*16+j].sop;
}
io_InitPoFilter( local->Filter[i].sop, &local->Filter[i].Found,
local->Filter[i].Data, ctx->ScanTime);
}
return 1;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static pwr_tStatus IoCardClose (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
io_sLocal *local;
int i;
local = (io_sLocal *) cp->Local;
errh_Info( "IO closing do card '%s'", cp->Name);
/* Free filter data */
for ( i = 0; i < 2; i++)
{
if ( local->Filter[i].Found)
io_ClosePoFilter( local->Filter[i].Data);
}
free( (char *) local);
return 1;
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static pwr_tStatus IoCardWrite (
io_tCtx ctx,
io_sAgent *ap,
io_sRack *rp,
io_sCard *cp
)
{
io_sLocal *local;
pwr_tUInt16 data = 0;
pwr_sClass_Ssab_BaseDoCard *op;
pwr_tUInt16 invmask;
pwr_tUInt16 testmask;
pwr_tUInt16 testvalue;
int i;
qbus_io_write wb;
int sts;
local = (io_sLocal *) cp->Local;
op = (pwr_sClass_Ssab_BaseDoCard *) cp->op;
#if defined(OS_ELN)
vaxc$establish(machfailwrite);
#endif
for ( i = 0; i < 2; i++)
{
if ( ctx->Node->EmergBreakTrue && ctx->Node->EmergBreakSelect == FIXOUT)
{
if ( i == 0)
data = op->FixedOutValue1;
else
data = op->FixedOutValue2;
}
else
io_DoPackWord( cp, &data, i);
if ( i == 0)
{
testmask = op->TestMask1;
invmask = op->InvMask1;
}
else
{
testmask = op->TestMask2;
invmask = op->InvMask2;
if ( op->MaxNoOfChannels == 16)
break;
}
/* Invert */
data = data ^ invmask;
/* Filter Po signals */
if ( local->Filter[i].Found)
io_PoFilter( local->Filter[i].sop, &data, local->Filter[i].Data);
/* Testvalues */
if ( testmask)
{
if ( i == 0)
testvalue = op->TestValue1;
else
testvalue = op->TestValue2;
data = (data & ~ testmask) | (testmask & testvalue);
}
wb.Data = data;
wb.Address = local->Address[i];
sts = write( local->Qbus_fp, &wb, sizeof(wb));
if ( sts == -1)
{
#if 0
/* Exceptionhandler was called */
if ( io_fatal_error)
{
/* Activate emergency break */
errh_Error( "Fatal write error, card '%s', IO is stopped", cp->Name);
ctx->Node->EmergBreakTrue = 1;
return IO__ERRDEVICE;
}
#endif
/* Increase error count and check error limits */
op->ErrorCount++;
if ( op->ErrorCount == op->ErrorSoftLimit)
errh_Error( "IO Error soft limit reached on card '%s'", cp->Name);
if ( op->ErrorCount >= op->ErrorHardLimit)
{
errh_Error( "IO Error hard limit reached on card '%s', IO stopped", cp->Name);
ctx->Node->EmergBreakTrue = 1;
return IO__ERRDEVICE;
}
continue;
}
}
return 1;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindIoMethods(Ssab_Do) = {
pwr_BindIoMethod(IoCardInit),
pwr_BindIoMethod(IoCardClose),
pwr_BindIoMethod(IoCardWrite),
pwr_NullMethod
};
/*
* Proview $Id: rt_io_ssab.h,v 1.1 2005-12-30 15:52:05 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_io_ssab.h -- init, read and write ssab cards. */
typedef int DEVICE;
int ssab_close(
void *hv_device);
int ssabai_ini(
char *inidev,
void *adressini,
void *hv_device,
int relvec);
unsigned short ssabai_read(
void *reg_diP,
int grupp);
int ssabao_ini(
char *inidev,
void *adressini,
void *hv_device,
int relvec);
void ssabao_write(
short data,
void *reg_diP,
int channel);
int ssabd_ini(
char *inidev,
void *adressini,
void *hv_device,
int relvec);
unsigned short ssabdi_read(
void *reg_diP,
int grupp);
void ssabdo_write(
short data,
void *reg_diP,
int grupp);
void ssabco_read(
void *reg_diP,
int numofword,
int *co_id,
unsigned short *data,
int channel);
void ssabco_write(
unsigned short *data,
void *reg_P,
int channel);
unsigned short ssabaiup_read(
void *reg_diP,
int grupp);
Rack_SSAB
Ssab_AiuP
Ssab_AouP
Ssab_Di
Ssab_Do
Ssab_Co
Di_DIX2
Do_HVDO32
Ao_HVAO4
Ao_AO8uP
Ai_HVAI32
Ai_AI32uP
Co_PI24BO
Co_CO4uP
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 $Id: wb_c_ai_ai32up.c,v 1.1 2005-12-30 15:52:05 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.
**/
/* wb_c_ai_ai32up.c -- work bench methods of the Ai_AI32uP class */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_ldh_msg.h"
#include "wb_pwrb_msg.h"
#include "pwr_baseclasses.h"
#include "pwr_basecomponentclasses.h"
#include "pwr_ssaboxclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_nav_macros.h"
/*----------------------------------------------------------------------------*\
Check if it's ok to adopt a new object.
\*----------------------------------------------------------------------------*/
static pwr_tStatus AnteAdopt (
ldh_tSesContext Session,
pwr_tObjid Card, /* current card object */
pwr_tClassId Class /* class of child to adopt */
) {
pwr_tStatus sts;
pwr_sClass_Ai_AI32uP RCard;
pwr_sdClass_Ai_AI32uP DCard;
pwr_tUInt32 MaxChan;
pwr_tUInt32 Chan;
int i;
if (Class != pwr_cClass_ChanAi && Class != pwr_cClass_ChanAit)
return PWRB__CHANCLASS;
sts = ldh_ReadObjectBody(Session, Card, "RtBody", &RCard, sizeof(RCard));
if (EVEN(sts)) return sts;
sts = ldh_ReadObjectBody(Session, Card, "DevBody", &DCard, sizeof(DCard));
if (EVEN(sts)) return sts;
MaxChan = min(32, RCard.MaxNoOfChannels);
for (i = 0, Chan = 1; i < MaxChan; i++, Chan <<= 1) {
if ((DCard.ChannelAllocation & Chan) == 0)
break;
}
if (i >= MaxChan)
return PWRB__ALOCHAN;
else
return LDH__ADOPTRENAME;
}
/*----------------------------------------------------------------------------*\
Adopt a new channel.
\*----------------------------------------------------------------------------*/
static pwr_tStatus PostAdopt (
ldh_tSesContext Session,
pwr_tObjid Card, /* current card object */
pwr_tObjid Channel,
pwr_tClassId Class /* class of child to adopt */
) {
pwr_tStatus sts;
pwr_sClass_Ai_AI32uP RCard;
pwr_sdClass_Ai_AI32uP DCard;
pwr_sClass_ChanAi ChanAi;
pwr_sClass_ChanAit ChanAit;
pwr_tUInt32 MaxChan;
pwr_tUInt32 Chan;
pwr_tString80 NewName;
pwr_tString80 Description;
pwr_tString80 Identity;
pwr_tString80 DefName;
pwr_sObject DefBody;
pwr_tObjid DefObject;
int i;
if (Class != pwr_cClass_ChanAi && Class != pwr_cClass_ChanAit)
return PWRB__CHANCLASS;
sts = ldh_ReadObjectBody(Session, Card, "RtBody", &RCard, sizeof(RCard));
if (EVEN(sts)) return sts;
sts = ldh_ReadObjectBody(Session, Card, "DevBody", &DCard, sizeof(DCard));
if (EVEN(sts)) return sts;
MaxChan = min(32, RCard.MaxNoOfChannels);
for (i = 0, Chan = 1; i < MaxChan; i++, Chan <<= 1) {
if ((DCard.ChannelAllocation & Chan) == 0)
break;
}
if (i >= MaxChan)
return PWRB__ALOCHAN;
/* allocate new channel */
DCard.ChannelAllocation |= Chan;
sts = ldh_SetObjectBody(Session, Card, "DevBody", (char *)&DCard, sizeof(DCard));
if (EVEN(sts)) return sts;
/*
change attributes of channel
NOTE !
this should be done by a method of the channel object,
but is not implemented in this version of PROVIEW/R.
*/
switch (Class) {
case pwr_cClass_ChanAi:
sts = ldh_ReadObjectBody(Session, Channel, "RtBody", &ChanAi,
sizeof(ChanAi));
if (EVEN(sts)) return sts;
if (ChanAi.Description[0] != '\0') {
sprintf(Description, ChanAi.Description, i);
if (strlen(Description) <= sizeof(ChanAi.Description) - 1) {
strcpy(ChanAi.Description, Description);
}
}
if (ChanAi.Identity[0] != '\0') {
sprintf(Identity, ChanAi.Identity, i);
if (strlen(Identity) <= sizeof(ChanAi.Identity) - 1) {
strcpy(ChanAi.Identity, Identity);
}
}
ChanAi.Number = i;
sts = ldh_SetObjectBody(Session, Channel, "RtBody", (char *)&ChanAi, sizeof(ChanAi));
strcpy(DefName, "pwrb:Class-ChanAi-Defaults");
break;
case pwr_cClass_ChanAit:
sts = ldh_ReadObjectBody(Session, Channel, "RtBody", &ChanAit,
sizeof(ChanAit));
if (EVEN(sts)) return sts;
if (ChanAit.Description[0] != '\0') {
sprintf(Description, ChanAit.Description, i);
if (strlen(Description) <= sizeof(ChanAit.Description) - 1) {
strcpy(ChanAit.Description, Description);
}
}
if (ChanAit.Identity[0] != '\0') {
sprintf(Identity, ChanAit.Identity, i);
if (strlen(Identity) <= sizeof(ChanAit.Identity) - 1) {
strcpy(ChanAit.Identity, Identity);
}
}
ChanAit.Number = i;
sts = ldh_SetObjectBody(Session, Channel, "RtBody", (char *)&ChanAit, sizeof(ChanAit));
strcpy(DefName, "pwrb:Class-ChanAit-Defaults");
break;
}
/* change name of channel */
sts = ldh_NameToObjid(Session, &DefObject, DefName);
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_ReadObjectBody(Session, DefObject, "SysBody", &DefBody,
sizeof(DefBody));
if (DefBody.Name[0] != '\0') {
sprintf(NewName, DefBody.Name, i+1);
NewName[31] = '\0';
sts = ldh_SetObjectName(Session, Channel, NewName);
}
return PWRB__SUCCESS;
}
/*----------------------------------------------------------------------------*\
Unadopt a channel.
\*----------------------------------------------------------------------------*/
static pwr_tStatus PostUnadopt (
ldh_tSesContext Session,
pwr_tObjid Card, /* current card object */
pwr_tObjid Channel,
pwr_tClassId Class /* class of child to adopt */
) {
pwr_tStatus sts;
pwr_sClass_Ai_AI32uP RCard;
pwr_sClass_ChanAi ChanAi;
pwr_sClass_ChanAit ChanAit;
pwr_sdClass_Ai_AI32uP DCard;
pwr_tUInt32 MaxChan;
pwr_tUInt32 Chan;
pwr_tString80 NewName;
if (Class != pwr_cClass_ChanAi && Class != pwr_cClass_ChanAit)
return PWRB__SUCCESS;
sts = ldh_ReadObjectBody(Session, Card, "RtBody", &RCard, sizeof(RCard));
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_ReadObjectBody(Session, Card, "DevBody", &DCard, sizeof(DCard));
if (EVEN(sts)) return PWRB__SUCCESS;
MaxChan = min(32, RCard.MaxNoOfChannels);
/*
get attributes of channel
NOTE !
this should be done by a method of the channel object,
but is not implemented in this version of PROVIEW/R.
*/
switch (Class) {
case pwr_cClass_ChanAi:
sts = ldh_ReadObjectBody(Session, Channel, "RtBody", &ChanAi,
sizeof(ChanAi));
if (EVEN(sts)) return PWRB__SUCCESS;
Chan = ChanAi.Number;
break;
case pwr_cClass_ChanAit:
sts = ldh_ReadObjectBody(Session, Channel, "RtBody", &ChanAit,
sizeof(ChanAit));
if (EVEN(sts)) return PWRB__SUCCESS;
Chan = ChanAit.Number;
break;
}
/* deallocate channel */
if (Chan > MaxChan)
return PWRB__SUCCESS;
DCard.ChannelAllocation &= ~(1 << Chan);
sts = ldh_SetObjectBody(Session, Card, "DevBody", (char *)&DCard, sizeof(DCard));
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_GetUniqueObjectName(Session, Channel, NewName);
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_SetObjectName(Session, Channel, NewName);
if (EVEN(sts)) return PWRB__SUCCESS;
return PWRB__SUCCESS;
}
/*----------------------------------------------------------------------------*\
Syntax check.
\*----------------------------------------------------------------------------*/
static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session,
pwr_tObjid Object, /* current object */
int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */
) {
pwr_tStatus sts;
sts = wsx_CheckCard( Session, Object, ErrorCount, WarningCount,
wsx_mCardOption_DevName);
if (EVEN(sts)) return sts;
return PWRB__SUCCESS;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindMethods(Ai_AI32uP) = {
pwr_BindMethod(AnteAdopt),
pwr_BindMethod(PostUnadopt),
pwr_BindMethod(PostAdopt),
pwr_BindMethod(SyntaxCheck),
pwr_NullMethod
};
/*
* Proview $Id: wb_c_ai_hvai32.c,v 1.1 2005-12-30 15:52:05 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.
**/
/* wb_c_ai_hvai32.c -- work bench methods of the Ai_HVAI32 class */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_ldh_msg.h"
#include "wb_pwrb_msg.h"
#include "pwr_baseclasses.h"
#include "pwr_basecomponentclasses.h"
#include "pwr_ssaboxclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_nav_macros.h"
/*----------------------------------------------------------------------------*\
Check if it's ok to adopt a new object.
\*----------------------------------------------------------------------------*/
static pwr_tStatus AnteAdopt (
ldh_tSesContext Session,
pwr_tObjid Card, /* current card object */
pwr_tClassId Class /* class of child to adopt */
) {
pwr_tStatus sts;
pwr_sClass_Ai_HVAI32 RCard;
pwr_sdClass_Ai_HVAI32 DCard;
pwr_tUInt32 MaxChan;
pwr_tUInt32 Chan;
int i;
if (Class != pwr_cClass_ChanAi && Class != pwr_cClass_ChanAit)
return PWRB__CHANCLASS;
sts = ldh_ReadObjectBody(Session, Card, "RtBody", &RCard, sizeof(RCard));
if (EVEN(sts)) return sts;
sts = ldh_ReadObjectBody(Session, Card, "DevBody", &DCard, sizeof(DCard));
if (EVEN(sts)) return sts;
MaxChan = min(32, RCard.MaxNoOfChannels);
for (i = 0, Chan = 1; i < MaxChan; i++, Chan <<= 1) {
if ((DCard.ChannelAllocation & Chan) == 0)
break;
}
if (i >= MaxChan)
return PWRB__ALOCHAN;
else
return LDH__ADOPTRENAME;
}
/*----------------------------------------------------------------------------*\
Adopt a new channel.
\*----------------------------------------------------------------------------*/
static pwr_tStatus PostAdopt (
ldh_tSesContext Session,
pwr_tObjid Card, /* current card object */
pwr_tObjid Channel,
pwr_tClassId Class /* class of child to adopt */
) {
pwr_tStatus sts;
pwr_sClass_Ai_HVAI32 RCard;
pwr_sdClass_Ai_HVAI32 DCard;
pwr_sClass_ChanAi ChanAi;
pwr_sClass_ChanAit ChanAit;
pwr_tUInt32 MaxChan;
pwr_tUInt32 Chan;
pwr_tString80 NewName;
pwr_tString80 Description;
pwr_tString80 Identity;
pwr_tString80 DefName;
pwr_sObject DefBody;
pwr_tObjid DefObject;
int i;
if (Class != pwr_cClass_ChanAi && Class != pwr_cClass_ChanAit)
return PWRB__CHANCLASS;
sts = ldh_ReadObjectBody(Session, Card, "RtBody", &RCard, sizeof(RCard));
if (EVEN(sts)) return sts;
sts = ldh_ReadObjectBody(Session, Card, "DevBody", &DCard, sizeof(DCard));
if (EVEN(sts)) return sts;
MaxChan = min(32, RCard.MaxNoOfChannels);
for (i = 0, Chan = 1; i < MaxChan; i++, Chan <<= 1) {
if ((DCard.ChannelAllocation & Chan) == 0)
break;
}
if (i >= MaxChan)
return PWRB__ALOCHAN;
/* allocate new channel */
DCard.ChannelAllocation |= Chan;
sts = ldh_SetObjectBody(Session, Card, "DevBody", (char *)&DCard, sizeof(DCard));
if (EVEN(sts)) return sts;
/*
change attributes of channel
NOTE !
this should be done by a method of the channel object,
but is not implemented in this version of PROVIEW/R.
*/
switch (Class) {
case pwr_cClass_ChanAi:
sts = ldh_ReadObjectBody(Session, Channel, "RtBody", &ChanAi,
sizeof(ChanAi));
if (EVEN(sts)) return sts;
if (ChanAi.Description[0] != '\0') {
sprintf(Description, ChanAi.Description, i);
if (strlen(Description) <= sizeof(ChanAi.Description) - 1) {
strcpy(ChanAi.Description, Description);
}
}
if (ChanAi.Identity[0] != '\0') {
sprintf(Identity, ChanAi.Identity, i);
if (strlen(Identity) <= sizeof(ChanAi.Identity) - 1) {
strcpy(ChanAi.Identity, Identity);
}
}
ChanAi.Number = i;
sts = ldh_SetObjectBody(Session, Channel, "RtBody", (char *)&ChanAi, sizeof(ChanAi));
strcpy(DefName, "pwrb:Class-ChanAi-Defaults");
break;
case pwr_cClass_ChanAit:
sts = ldh_ReadObjectBody(Session, Channel, "RtBody", &ChanAit,
sizeof(ChanAit));
if (EVEN(sts)) return sts;
if (ChanAit.Description[0] != '\0') {
sprintf(Description, ChanAit.Description, i);
if (strlen(Description) <= sizeof(ChanAit.Description) - 1) {
strcpy(ChanAit.Description, Description);
}
}
if (ChanAit.Identity[0] != '\0') {
sprintf(Identity, ChanAit.Identity, i);
if (strlen(Identity) <= sizeof(ChanAit.Identity) - 1) {
strcpy(ChanAit.Identity, Identity);
}
}
ChanAit.Number = i;
sts = ldh_SetObjectBody(Session, Channel, "RtBody", (char *)&ChanAit, sizeof(ChanAit));
strcpy(DefName, "pwrb:Class-ChanAit-Defaults");
break;
}
/* change name of channel */
sts = ldh_NameToObjid(Session, &DefObject, DefName);
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_ReadObjectBody(Session, DefObject, "SysBody", &DefBody,
sizeof(DefBody));
if (DefBody.Name[0] != '\0') {
sprintf(NewName, DefBody.Name, i+1);
NewName[31] = '\0';
sts = ldh_SetObjectName(Session, Channel, NewName);
}
return PWRB__SUCCESS;
}
/*----------------------------------------------------------------------------*\
Unadopt a channel.
\*----------------------------------------------------------------------------*/
static pwr_tStatus PostUnadopt (
ldh_tSesContext Session,
pwr_tObjid Card, /* current card object */
pwr_tObjid Channel,
pwr_tClassId Class /* class of child to adopt */
) {
pwr_tStatus sts;
pwr_sClass_Ai_HVAI32 RCard;
pwr_sClass_ChanAi ChanAi;
pwr_sClass_ChanAit ChanAit;
pwr_sdClass_Ai_HVAI32 DCard;
pwr_tUInt32 MaxChan;
pwr_tUInt32 Chan;
pwr_tString80 NewName;
if (Class != pwr_cClass_ChanAi && Class != pwr_cClass_ChanAit)
return PWRB__SUCCESS;
sts = ldh_ReadObjectBody(Session, Card, "RtBody", &RCard, sizeof(RCard));
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_ReadObjectBody(Session, Card, "DevBody", &DCard, sizeof(DCard));
if (EVEN(sts)) return PWRB__SUCCESS;
MaxChan = min(32, RCard.MaxNoOfChannels);
/*
get attributes of channel
NOTE !
this should be done by a method of the channel object,
but is not implemented in this version of PROVIEW/R.
*/
switch (Class) {
case pwr_cClass_ChanAi:
sts = ldh_ReadObjectBody(Session, Channel, "RtBody", &ChanAi,
sizeof(ChanAi));
if (EVEN(sts)) return PWRB__SUCCESS;
Chan = ChanAi.Number;
break;
case pwr_cClass_ChanAit:
sts = ldh_ReadObjectBody(Session, Channel, "RtBody", &ChanAit,
sizeof(ChanAit));
if (EVEN(sts)) return PWRB__SUCCESS;
Chan = ChanAit.Number;
break;
}
/* deallocate channel */
if (Chan > MaxChan)
return PWRB__SUCCESS;
DCard.ChannelAllocation &= ~(1 << Chan);
sts = ldh_SetObjectBody(Session, Card, "DevBody", (char *)&DCard, sizeof(DCard));
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_GetUniqueObjectName(Session, Channel, NewName);
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_SetObjectName(Session, Channel, NewName);
if (EVEN(sts)) return PWRB__SUCCESS;
return PWRB__SUCCESS;
}
/*----------------------------------------------------------------------------*\
Syntax check.
\*----------------------------------------------------------------------------*/
static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session,
pwr_tObjid Object, /* current object */
int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */
) {
pwr_tStatus sts;
sts = wsx_CheckCard( Session, Object, ErrorCount, WarningCount,
wsx_mCardOption_DevName);
if (EVEN(sts)) return sts;
return PWRB__SUCCESS;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindMethods(Ai_HVAI32) = {
pwr_BindMethod(AnteAdopt),
pwr_BindMethod(PostUnadopt),
pwr_BindMethod(PostAdopt),
pwr_BindMethod(SyntaxCheck),
pwr_NullMethod
};
/*
* Proview $Id: wb_c_ao_ao8up.c,v 1.1 2005-12-30 15:52:05 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.
**/
/* wb_c_ao_ao8up.c -- work bench methods of the Ao_AO8uP class */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_ldh_msg.h"
#include "wb_pwrb_msg.h"
#include "pwr_baseclasses.h"
#include "pwr_basecomponentclasses.h"
#include "pwr_ssaboxclasses.h"
#include "pwrb_c_chanao.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_nav_macros.h"
/* AnteAdopt -- check if it's ok to adopt a new object */
static pwr_tStatus AnteAdopt (
ldh_tSesContext Session,
pwr_tObjid Card, /* current card object */
pwr_tClassId Class /* class of child to adopt */
) {
pwr_tStatus sts;
pwr_sClass_Ao_AO8uP RCard;
pwr_sdClass_Ao_AO8uP DCard;
pwr_tUInt32 MaxChan;
pwr_tUInt32 Chan;
int i;
if (Class != pwr_cClass_ChanAo)
return PWRB__CHANCLASS;
sts = ldh_ReadObjectBody(Session, Card, "RtBody", &RCard, sizeof(RCard));
if (EVEN(sts)) return sts;
sts = ldh_ReadObjectBody(Session, Card, "DevBody", &DCard, sizeof(DCard));
if (EVEN(sts)) return sts;
MaxChan = min(32, RCard.MaxNoOfChannels);
for (i = 0, Chan = 1; i < MaxChan; i++, Chan <<= 1) {
if ((DCard.ChannelAllocation & Chan) == 0)
break;
}
if (i >= MaxChan)
return PWRB__ALOCHAN;
else
return LDH__ADOPTRENAME;
}
/*----------------------------------------------------------------------------*\
Adopt a new channel.
\*----------------------------------------------------------------------------*/
static pwr_tStatus PostAdopt (
ldh_tSesContext Session,
pwr_tObjid Card, /* current card object */
pwr_tObjid Channel,
pwr_tClassId Class /* class of child to adopt */
) {
pwr_tStatus sts;
pwr_sClass_Ao_AO8uP RCard;
pwr_sdClass_Ao_AO8uP DCard;
pwr_sClass_ChanAo ChanAo;
pwr_tUInt32 MaxChan;
pwr_tUInt32 Chan;
pwr_tString80 NewName;
pwr_tString80 Description;
pwr_tString80 Identity;
pwr_tString80 DefName;
pwr_sObject DefBody;
pwr_tObjid DefObject;
int i;
if (Class != pwr_cClass_ChanAo)
return PWRB__CHANCLASS;
sts = ldh_ReadObjectBody(Session, Card, "RtBody", &RCard, sizeof(RCard));
if (EVEN(sts)) return sts;
sts = ldh_ReadObjectBody(Session, Card, "DevBody", &DCard, sizeof(DCard));
if (EVEN(sts)) return sts;
MaxChan = min(32, RCard.MaxNoOfChannels);
for (i = 0, Chan = 1; i < MaxChan; i++, Chan <<= 1) {
if ((DCard.ChannelAllocation & Chan) == 0)
break;
}
if (i >= MaxChan)
return PWRB__ALOCHAN;
/* allocate new channel */
DCard.ChannelAllocation |= Chan;
sts = ldh_SetObjectBody(Session, Card, "DevBody", (char *)&DCard, sizeof(DCard));
if (EVEN(sts)) return sts;
/*
change attributes of channel
NOTE !
this should be done by a method of the channel object,
but is not implemented in this version of PROVIEW/R.
*/
switch (Class) {
case pwr_cClass_ChanAo:
sts = ldh_ReadObjectBody(Session, Channel, "RtBody", &ChanAo,
sizeof(ChanAo));
if (EVEN(sts)) return sts;
if (ChanAo.Description[0] != '\0') {
sprintf(Description, ChanAo.Description, i);
if (strlen(Description) <= sizeof(ChanAo.Description) - 1) {
strcpy(ChanAo.Description, Description);
}
}
if (ChanAo.Identity[0] != '\0') {
sprintf(Identity, ChanAo.Identity, i);
if (strlen(Identity) <= sizeof(ChanAo.Identity) - 1) {
strcpy(ChanAo.Identity, Identity);
}
}
ChanAo.Number = i;
sts = ldh_SetObjectBody(Session, Channel, "RtBody", (char *)&ChanAo, sizeof(ChanAo));
strcpy(DefName, "pwrb:Class-ChanAo-Defaults");
break;
}
/* change name of channel */
sts = ldh_NameToObjid(Session, &DefObject, DefName);
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_ReadObjectBody(Session, DefObject, "SysBody", &DefBody,
sizeof(DefBody));
if (DefBody.Name[0] != '\0') {
sprintf(NewName, DefBody.Name, i+1);
NewName[31] = '\0';
sts = ldh_SetObjectName(Session, Channel, NewName);
}
return PWRB__SUCCESS;
}
/*----------------------------------------------------------------------------*\
Unadopt a channel.
\*----------------------------------------------------------------------------*/
static pwr_tStatus PostUnadopt (
ldh_tSesContext Session,
pwr_tObjid Card, /* current card object */
pwr_tObjid Channel,
pwr_tClassId Class /* class of child to adopt */
) {
pwr_tStatus sts;
pwr_sClass_Ao_AO8uP RCard;
pwr_sClass_ChanAo ChanAo;
pwr_sdClass_Ao_AO8uP DCard;
pwr_tUInt32 MaxChan;
pwr_tUInt32 Chan;
pwr_tString80 NewName;
if (Class != pwr_cClass_ChanAo)
return PWRB__SUCCESS;
sts = ldh_ReadObjectBody(Session, Card, "RtBody", &RCard, sizeof(RCard));
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_ReadObjectBody(Session, Card, "DevBody", &DCard, sizeof(DCard));
if (EVEN(sts)) return PWRB__SUCCESS;
MaxChan = min(32, RCard.MaxNoOfChannels);
/*
get attributes of channel
NOTE !
this should be done by a method of the channel object,
but is not implemented in this version of PROVIEW/R.
*/
switch (Class) {
case pwr_cClass_ChanAo:
sts = ldh_ReadObjectBody(Session, Channel, "RtBody", &ChanAo,
sizeof(ChanAo));
if (EVEN(sts)) return PWRB__SUCCESS;
Chan = ChanAo.Number;
break;
}
/* deallocate channel */
if (Chan > MaxChan)
return PWRB__SUCCESS;
DCard.ChannelAllocation &= ~(1 << Chan);
sts = ldh_SetObjectBody(Session, Card, "DevBody", (char *)&DCard, sizeof(DCard));
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_GetUniqueObjectName(Session, Channel, NewName);
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_SetObjectName(Session, Channel, NewName);
if (EVEN(sts)) return PWRB__SUCCESS;
return PWRB__SUCCESS;
}
/*----------------------------------------------------------------------------*\
Syntax check.
\*----------------------------------------------------------------------------*/
static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session,
pwr_tObjid Object, /* current object */
int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */
) {
pwr_tStatus sts;
sts = wsx_CheckCard( Session, Object, ErrorCount, WarningCount,
wsx_mCardOption_DevName);
if (EVEN(sts)) return sts;
return PWRB__SUCCESS;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindMethods(Ao_AO8uP) = {
pwr_BindMethod(AnteAdopt),
pwr_BindMethod(PostUnadopt),
pwr_BindMethod(PostAdopt),
pwr_BindMethod(SyntaxCheck),
pwr_NullMethod
};
/*
* Proview $Id: wb_c_ao_hvao4.c,v 1.1 2005-12-30 15:52:05 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.
**/
/* wb_c_ao_hvao4.c -- work bench methods of the Ao_HVAO4 class */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_ldh_msg.h"
#include "wb_pwrb_msg.h"
#include "pwr_baseclasses.h"
#include "pwr_basecomponentclasses.h"
#include "pwr_ssaboxclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_nav_macros.h"
/* AnteAdopt -- check if it's ok to adopt a new object */
static pwr_tStatus AnteAdopt (
ldh_tSesContext Session,
pwr_tObjid Card, /* current card object */
pwr_tClassId Class /* class of child to adopt */
) {
pwr_tStatus sts;
pwr_sClass_Ao_HVAO4 RCard;
pwr_sdClass_Ao_HVAO4 DCard;
pwr_tUInt32 MaxChan;
pwr_tUInt32 Chan;
int i;
if (Class != pwr_cClass_ChanAo)
return PWRB__CHANCLASS;
sts = ldh_ReadObjectBody(Session, Card, "RtBody", &RCard, sizeof(RCard));
if (EVEN(sts)) return sts;
sts = ldh_ReadObjectBody(Session, Card, "DevBody", &DCard, sizeof(DCard));
if (EVEN(sts)) return sts;
MaxChan = min(32, RCard.MaxNoOfChannels);
for (i = 0, Chan = 1; i < MaxChan; i++, Chan <<= 1) {
if ((DCard.ChannelAllocation & Chan) == 0)
break;
}
if (i >= MaxChan)
return PWRB__ALOCHAN;
else
return LDH__ADOPTRENAME;
}
/*----------------------------------------------------------------------------*\
Adopt a new channel.
\*----------------------------------------------------------------------------*/
static pwr_tStatus PostAdopt (
ldh_tSesContext Session,
pwr_tObjid Card, /* current card object */
pwr_tObjid Channel,
pwr_tClassId Class /* class of child to adopt */
) {
pwr_tStatus sts;
pwr_sClass_Ao_HVAO4 RCard;
pwr_sdClass_Ao_HVAO4 DCard;
pwr_sClass_ChanAo ChanAo;
pwr_tUInt32 MaxChan;
pwr_tUInt32 Chan;
pwr_tString80 NewName;
pwr_tString80 Description;
pwr_tString80 Identity;
pwr_tString80 DefName;
pwr_sObject DefBody;
pwr_tObjid DefObject;
int i;
if (Class != pwr_cClass_ChanAo)
return PWRB__CHANCLASS;
sts = ldh_ReadObjectBody(Session, Card, "RtBody", &RCard, sizeof(RCard));
if (EVEN(sts)) return sts;
sts = ldh_ReadObjectBody(Session, Card, "DevBody", &DCard, sizeof(DCard));
if (EVEN(sts)) return sts;
MaxChan = min(32, RCard.MaxNoOfChannels);
for (i = 0, Chan = 1; i < MaxChan; i++, Chan <<= 1) {
if ((DCard.ChannelAllocation & Chan) == 0)
break;
}
if (i >= MaxChan)
return PWRB__ALOCHAN;
/* allocate new channel */
DCard.ChannelAllocation |= Chan;
sts = ldh_SetObjectBody(Session, Card, "DevBody", (char *)&DCard, sizeof(DCard));
if (EVEN(sts)) return sts;
/*
change attributes of channel
NOTE !
this should be done by a method of the channel object,
but is not implemented in this version of PROVIEW/R.
*/
switch (Class) {
case pwr_cClass_ChanAo:
sts = ldh_ReadObjectBody(Session, Channel, "RtBody", &ChanAo,
sizeof(ChanAo));
if (EVEN(sts)) return sts;
if (ChanAo.Description[0] != '\0') {
sprintf(Description, ChanAo.Description, i);
if (strlen(Description) <= sizeof(ChanAo.Description) - 1) {
strcpy(ChanAo.Description, Description);
}
}
if (ChanAo.Identity[0] != '\0') {
sprintf(Identity, ChanAo.Identity, i);
if (strlen(Identity) <= sizeof(ChanAo.Identity) - 1) {
strcpy(ChanAo.Identity, Identity);
}
}
ChanAo.Number = i;
sts = ldh_SetObjectBody(Session, Channel, "RtBody", (char *)&ChanAo, sizeof(ChanAo));
strcpy(DefName, "pwrb:Class-ChanAo-Defaults");
break;
}
/* change name of channel */
sts = ldh_NameToObjid(Session, &DefObject, DefName);
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_ReadObjectBody(Session, DefObject, "SysBody", &DefBody,
sizeof(DefBody));
if (DefBody.Name[0] != '\0') {
sprintf(NewName, DefBody.Name, i+1);
NewName[31] = '\0';
sts = ldh_SetObjectName(Session, Channel, NewName);
}
return PWRB__SUCCESS;
}
/*----------------------------------------------------------------------------*\
Unadopt a channel.
\*----------------------------------------------------------------------------*/
static pwr_tStatus PostUnadopt (
ldh_tSesContext Session,
pwr_tObjid Card, /* current card object */
pwr_tObjid Channel,
pwr_tClassId Class /* class of child to adopt */
) {
pwr_tStatus sts;
pwr_sClass_Ao_HVAO4 RCard;
pwr_sClass_ChanAo ChanAo;
pwr_sdClass_Ao_HVAO4 DCard;
pwr_tUInt32 MaxChan;
pwr_tUInt32 Chan;
pwr_tString80 NewName;
if (Class != pwr_cClass_ChanAo)
return PWRB__SUCCESS;
sts = ldh_ReadObjectBody(Session, Card, "RtBody", &RCard, sizeof(RCard));
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_ReadObjectBody(Session, Card, "DevBody", &DCard, sizeof(DCard));
if (EVEN(sts)) return PWRB__SUCCESS;
MaxChan = min(32, RCard.MaxNoOfChannels);
/*
get attributes of channel
NOTE !
this should be done by a method of the channel object,
but is not implemented in this version of PROVIEW/R.
*/
switch (Class) {
case pwr_cClass_ChanAo:
sts = ldh_ReadObjectBody(Session, Channel, "RtBody", &ChanAo,
sizeof(ChanAo));
if (EVEN(sts)) return PWRB__SUCCESS;
Chan = ChanAo.Number;
break;
}
/* deallocate channel */
if (Chan > MaxChan)
return PWRB__SUCCESS;
DCard.ChannelAllocation &= ~(1 << Chan);
sts = ldh_SetObjectBody(Session, Card, "DevBody", (char *)&DCard, sizeof(DCard));
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_GetUniqueObjectName(Session, Channel, NewName);
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_SetObjectName(Session, Channel, NewName);
if (EVEN(sts)) return PWRB__SUCCESS;
return PWRB__SUCCESS;
}
/*----------------------------------------------------------------------------*\
Syntax check.
\*----------------------------------------------------------------------------*/
static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session,
pwr_tObjid Object, /* current object */
int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */
) {
pwr_tStatus sts;
sts = wsx_CheckCard( Session, Object, ErrorCount, WarningCount,
wsx_mCardOption_DevName);
if (EVEN(sts)) return sts;
return PWRB__SUCCESS;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindMethods(Ao_HVAO4) = {
pwr_BindMethod(AnteAdopt),
pwr_BindMethod(PostUnadopt),
pwr_BindMethod(PostAdopt),
pwr_BindMethod(SyntaxCheck),
pwr_NullMethod
};
/*
* Proview $Id: wb_c_co_co4up.c,v 1.1 2005-12-30 15:52:05 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.
**/
/* wb_c_co_co4up.c -- work bench methods of the Co_CO4uP class. */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_ldh_msg.h"
#include "wb_pwrb_msg.h"
#include "pwr_baseclasses.h"
#include "pwr_basecomponentclasses.h"
#include "pwr_ssaboxclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_nav_macros.h"
/* Check if it's ok to adopt a new object. */
static pwr_tStatus
AnteAdopt (
ldh_tSesContext Session,
pwr_tObjid Card, /* current card object */
pwr_tClassId Class /* class of child to adopt */
) {
pwr_tStatus sts;
pwr_sClass_Co_CO4uP RCard;
pwr_sdClass_Co_CO4uP DCard;
pwr_tUInt32 MaxCounter;
pwr_tUInt32 Chan;
int i;
if (Class != pwr_cClass_ChanCo)
return PWRB__CHANCLASS;
sts = ldh_ReadObjectBody(Session, Card, "RtBody", &RCard, sizeof(RCard));
if (EVEN(sts)) return sts;
sts = ldh_ReadObjectBody(Session, Card, "DevBody", &DCard, sizeof(DCard));
if (EVEN(sts)) return sts;
MaxCounter = min(32, RCard.MaxNoOfCounters);
for (i = 0, Chan = 1; i < MaxCounter; i++, Chan <<= 1) {
if ((DCard.ChannelAllocation & Chan) == 0)
break;
}
if (i >= MaxCounter)
return PWRB__ALOCHAN;
else
return LDH__ADOPTRENAME;
}
/* Adopt a new channel. */
static pwr_tStatus
PostAdopt (
ldh_tSesContext Session,
pwr_tObjid Card, /* current card object */
pwr_tObjid Channel,
pwr_tClassId Class /* class of child to adopt */
) {
pwr_tStatus sts;
pwr_sClass_Co_CO4uP RCard;
pwr_sdClass_Co_CO4uP DCard;
pwr_sClass_ChanCo ChanCo;
pwr_tUInt32 MaxCounter;
pwr_tUInt32 Chan;
pwr_tString80 NewName;
pwr_tString80 Description;
pwr_tString80 Identity;
pwr_tString80 DefName;
pwr_sObject DefBody;
pwr_tObjid DefObject;
int i;
if (Class != pwr_cClass_ChanCo)
return PWRB__CHANCLASS;
sts = ldh_ReadObjectBody(Session, Card, "RtBody", &RCard, sizeof(RCard));
if (EVEN(sts)) return sts;
sts = ldh_ReadObjectBody(Session, Card, "DevBody", &DCard, sizeof(DCard));
if (EVEN(sts)) return sts;
MaxCounter = min(32, RCard.MaxNoOfCounters);
for (i = 0, Chan = 1; i < MaxCounter; i++, Chan <<= 1) {
if ((DCard.ChannelAllocation & Chan) == 0)
break;
}
if (i >= MaxCounter)
return PWRB__ALOCHAN;
/* allocate new channel */
DCard.ChannelAllocation |= Chan;
sts = ldh_SetObjectBody(Session, Card, "DevBody", (char *)&DCard, sizeof(DCard));
if (EVEN(sts)) return sts;
/* Change attributes of channel.
NOTE !
this should be done by a method of the channel object,
but is not implemented in this version of PROVIEW/R. */
switch (Class) {
case pwr_cClass_ChanCo:
sts = ldh_ReadObjectBody(Session, Channel, "RtBody", &ChanCo,
sizeof(ChanCo));
if (EVEN(sts)) return sts;
if (ChanCo.Description[0] != '\0') {
sprintf(Description, ChanCo.Description, i);
if (strlen(Description) <= sizeof(ChanCo.Description) - 1) {
strcpy(ChanCo.Description, Description);
}
}
if (ChanCo.Identity[0] != '\0') {
sprintf(Identity, ChanCo.Identity, i);
if (strlen(Identity) <= sizeof(ChanCo.Identity) - 1) {
strcpy(ChanCo.Identity, Identity);
}
}
ChanCo.Number = i;
sts = ldh_SetObjectBody(Session, Channel, "RtBody", (char *)&ChanCo,
sizeof(ChanCo));
strcpy(DefName, "pwrb:Class-ChanCo-Defaults");
break;
}
/* change name of channel */
sts = ldh_NameToObjid(Session, &DefObject, DefName);
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_ReadObjectBody(Session, DefObject, "SysBody", &DefBody,
sizeof(DefBody));
if (DefBody.Name[0] != '\0') {
sprintf(NewName, DefBody.Name, i+1);
NewName[31] = '\0';
sts = ldh_SetObjectName(Session, Channel, NewName);
}
return PWRB__SUCCESS;
}
/* Unadopt a channel. */
static pwr_tStatus
PostUnadopt (
ldh_tSesContext Session,
pwr_tObjid Card, /* current card object */
pwr_tObjid Channel,
pwr_tClassId Class /* class of child to adopt */
) {
pwr_tStatus sts;
pwr_sClass_Co_CO4uP RCard;
pwr_sClass_ChanCo ChanCo;
pwr_sdClass_Co_CO4uP DCard;
pwr_tUInt32 MaxCounter;
pwr_tUInt32 Chan;
pwr_tString80 NewName;
if (Class != pwr_cClass_ChanCo)
return PWRB__SUCCESS;
sts = ldh_ReadObjectBody(Session, Card, "RtBody", &RCard, sizeof(RCard));
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_ReadObjectBody(Session, Card, "DevBody", &DCard, sizeof(DCard));
if (EVEN(sts)) return PWRB__SUCCESS;
MaxCounter = min(32, RCard.MaxNoOfCounters);
/* Get attributes of channel
NOTE !
this should be done by a method of the channel object,
but is not implemented in this version of PROVIEW/R. */
switch (Class) {
case pwr_cClass_ChanCo:
sts = ldh_ReadObjectBody(Session, Channel, "RtBody", &ChanCo,
sizeof(ChanCo));
if (EVEN(sts)) return PWRB__SUCCESS;
Chan = ChanCo.Number;
break;
}
/* deallocate channel */
if (Chan > MaxCounter)
return PWRB__SUCCESS;
DCard.ChannelAllocation &= ~(1 << Chan);
sts = ldh_SetObjectBody(Session, Card, "DevBody", (char *)&DCard,
sizeof(DCard));
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_GetUniqueObjectName(Session, Channel, NewName);
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_SetObjectName(Session, Channel, NewName);
if (EVEN(sts)) return PWRB__SUCCESS;
return PWRB__SUCCESS;
}
/*----------------------------------------------------------------------------*\
Syntax check.
\*----------------------------------------------------------------------------*/
static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session,
pwr_tObjid Object, /* current object */
int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */
) {
pwr_tStatus sts;
sts = wsx_CheckCoCard( Session, Object, ErrorCount, WarningCount);
if (EVEN(sts)) return sts;
return PWRB__SUCCESS;
}
/* Every method to be exported to the workbench should be registred here. */
pwr_dExport pwr_BindMethods(Co_CO4uP) = {
pwr_BindMethod(AnteAdopt),
pwr_BindMethod(PostUnadopt),
pwr_BindMethod(PostAdopt),
pwr_BindMethod(SyntaxCheck),
pwr_NullMethod
};
/*
* Proview $Id: wb_c_co_pi24bo.c,v 1.1 2005-12-30 15:52:05 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.
**/
/* wb_c_co_pi24bo.c -- work bench methods of the Co_PI24BO class. */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_ldh_msg.h"
#include "wb_pwrb_msg.h"
#include "pwr_baseclasses.h"
#include "pwr_basecomponentclasses.h"
#include "pwr_ssaboxclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_nav_macros.h"
/* Check if it's ok to adopt a new object. */
static pwr_tStatus
AnteAdopt (
ldh_tSesContext Session,
pwr_tObjid Card, /* current card object */
pwr_tClassId Class /* class of child to adopt */
) {
pwr_tStatus sts;
pwr_sClass_Co_PI24BO RCard;
pwr_sdClass_Co_PI24BO DCard;
pwr_tUInt32 MaxCounter;
pwr_tUInt32 Chan;
int i;
if (Class != pwr_cClass_ChanCo)
return PWRB__CHANCLASS;
sts = ldh_ReadObjectBody(Session, Card, "RtBody", &RCard, sizeof(RCard));
if (EVEN(sts)) return sts;
sts = ldh_ReadObjectBody(Session, Card, "DevBody", &DCard, sizeof(DCard));
if (EVEN(sts)) return sts;
MaxCounter = min(32, RCard.MaxNoOfCounters);
for (i = 0, Chan = 1; i < MaxCounter; i++, Chan <<= 1) {
if ((DCard.ChannelAllocation & Chan) == 0)
break;
}
if (i >= MaxCounter)
return PWRB__ALOCHAN;
else
return LDH__ADOPTRENAME;
}
/* Adopt a new channel. */
static pwr_tStatus
PostAdopt (
ldh_tSesContext Session,
pwr_tObjid Card, /* current card object */
pwr_tObjid Channel,
pwr_tClassId Class /* class of child to adopt */
) {
pwr_tStatus sts;
pwr_sClass_Co_PI24BO RCard;
pwr_sdClass_Co_PI24BO DCard;
pwr_sClass_ChanCo ChanCo;
pwr_tUInt32 MaxCounter;
pwr_tUInt32 Chan;
pwr_tString80 NewName;
pwr_tString80 Description;
pwr_tString80 Identity;
pwr_tString80 DefName;
pwr_sObject DefBody;
pwr_tObjid DefObject;
int i;
if (Class != pwr_cClass_ChanCo)
return PWRB__CHANCLASS;
sts = ldh_ReadObjectBody(Session, Card, "RtBody", &RCard, sizeof(RCard));
if (EVEN(sts)) return sts;
sts = ldh_ReadObjectBody(Session, Card, "DevBody", &DCard, sizeof(DCard));
if (EVEN(sts)) return sts;
MaxCounter = min(32, RCard.MaxNoOfCounters);
for (i = 0, Chan = 1; i < MaxCounter; i++, Chan <<= 1) {
if ((DCard.ChannelAllocation & Chan) == 0)
break;
}
if (i >= MaxCounter)
return PWRB__ALOCHAN;
/* allocate new channel */
DCard.ChannelAllocation |= Chan;
sts = ldh_SetObjectBody(Session, Card, "DevBody", (char *)&DCard, sizeof(DCard));
if (EVEN(sts)) return sts;
/* Change attributes of channel.
NOTE !
this should be done by a method of the channel object,
but is not implemented in this version of PROVIEW/R. */
switch (Class) {
case pwr_cClass_ChanCo:
sts = ldh_ReadObjectBody(Session, Channel, "RtBody", &ChanCo,
sizeof(ChanCo));
if (EVEN(sts)) return sts;
if (ChanCo.Description[0] != '\0') {
sprintf(Description, ChanCo.Description, i);
if (strlen(Description) <= sizeof(ChanCo.Description) - 1) {
strcpy(ChanCo.Description, Description);
}
}
if (ChanCo.Identity[0] != '\0') {
sprintf(Identity, ChanCo.Identity, i);
if (strlen(Identity) <= sizeof(ChanCo.Identity) - 1) {
strcpy(ChanCo.Identity, Identity);
}
}
ChanCo.Number = i;
sts = ldh_SetObjectBody(Session, Channel, "RtBody", (char *)&ChanCo,
sizeof(ChanCo));
strcpy(DefName, "pwrb:Class-ChanCo-Defaults");
break;
}
/* change name of channel */
sts = ldh_NameToObjid(Session, &DefObject, DefName);
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_ReadObjectBody(Session, DefObject, "SysBody", &DefBody,
sizeof(DefBody));
if (DefBody.Name[0] != '\0') {
sprintf(NewName, DefBody.Name, i+1);
NewName[31] = '\0';
sts = ldh_SetObjectName(Session, Channel, NewName);
}
return PWRB__SUCCESS;
}
/* Unadopt a channel. */
static pwr_tStatus
PostUnadopt (
ldh_tSesContext Session,
pwr_tObjid Card, /* current card object */
pwr_tObjid Channel,
pwr_tClassId Class /* class of child to adopt */
) {
pwr_tStatus sts;
pwr_sClass_Co_PI24BO RCard;
pwr_sClass_ChanCo ChanCo;
pwr_sdClass_Co_PI24BO DCard;
pwr_tUInt32 MaxCounter;
pwr_tUInt32 Chan;
pwr_tString80 NewName;
if (Class != pwr_cClass_ChanCo)
return PWRB__SUCCESS;
sts = ldh_ReadObjectBody(Session, Card, "RtBody", &RCard, sizeof(RCard));
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_ReadObjectBody(Session, Card, "DevBody", &DCard, sizeof(DCard));
if (EVEN(sts)) return PWRB__SUCCESS;
MaxCounter = min(32, RCard.MaxNoOfCounters);
/* Get attributes of channel
NOTE !
this should be done by a method of the channel object,
but is not implemented in this version of PROVIEW/R. */
switch (Class) {
case pwr_cClass_ChanCo:
sts = ldh_ReadObjectBody(Session, Channel, "RtBody", &ChanCo,
sizeof(ChanCo));
if (EVEN(sts)) return PWRB__SUCCESS;
Chan = ChanCo.Number;
break;
}
/* deallocate channel */
if (Chan > MaxCounter)
return PWRB__SUCCESS;
DCard.ChannelAllocation &= ~(1 << Chan);
sts = ldh_SetObjectBody(Session, Card, "DevBody", (char *)&DCard,
sizeof(DCard));
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_GetUniqueObjectName(Session, Channel, NewName);
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_SetObjectName(Session, Channel, NewName);
if (EVEN(sts)) return PWRB__SUCCESS;
return PWRB__SUCCESS;
}
/*----------------------------------------------------------------------------*\
Syntax check.
\*----------------------------------------------------------------------------*/
static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session,
pwr_tObjid Object, /* current object */
int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */
) {
pwr_tStatus sts;
sts = wsx_CheckCoCard( Session, Object, ErrorCount, WarningCount);
if (EVEN(sts)) return sts;
return PWRB__SUCCESS;
}
/* Every method to be exported to the workbench should be registred here. */
pwr_dExport pwr_BindMethods(Co_PI24BO) = {
pwr_BindMethod(AnteAdopt),
pwr_BindMethod(PostUnadopt),
pwr_BindMethod(PostAdopt),
pwr_BindMethod(SyntaxCheck),
pwr_NullMethod
};
/*
* Proview $Id: wb_c_di_dix2.c,v 1.1 2005-12-30 15:52:05 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.
**/
/* wb_c_di_dix2.c -- work bench methods of the Di_DIX2 class. */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_ldh_msg.h"
#include "wb_pwrb_msg.h"
#include "pwr_baseclasses.h"
#include "pwr_basecomponentclasses.h"
#include "pwr_ssaboxclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_nav_macros.h"
/*----------------------------------------------------------------------------*\
Check if it's ok to adopt a new object.
\*----------------------------------------------------------------------------*/
static pwr_tStatus AnteAdopt (
ldh_tSesContext Session,
pwr_tObjid Card, /* current card object */
pwr_tClassId Class /* class of child to adopt */
) {
pwr_tStatus sts;
pwr_sClass_Di_DIX2 RCard;
pwr_sdClass_Di_DIX2 DCard;
pwr_tUInt32 MaxChan;
pwr_tUInt32 Chan;
int i;
if (Class != pwr_cClass_ChanDi)
return PWRB__CHANCLASS;
sts = ldh_ReadObjectBody(Session, Card, "RtBody", &RCard, sizeof(RCard));
if (EVEN(sts)) return sts;
sts = ldh_ReadObjectBody(Session, Card, "DevBody", &DCard, sizeof(DCard));
if (EVEN(sts)) return sts;
MaxChan = min(32, RCard.MaxNoOfChannels);
for (i = 0, Chan = 1; i < MaxChan; i++, Chan <<= 1) {
if ((DCard.ChannelAllocation & Chan) == 0)
break;
}
if (i >= MaxChan)
return PWRB__ALOCHAN;
else
return LDH__ADOPTRENAME;
}
/*----------------------------------------------------------------------------*\
Adopt a new channel.
\*----------------------------------------------------------------------------*/
static pwr_tStatus PostAdopt (
ldh_tSesContext Session,
pwr_tObjid Card, /* current card object */
pwr_tObjid Channel,
pwr_tClassId Class /* class of child to adopt */
) {
pwr_tStatus sts;
pwr_sClass_Di_DIX2 RCard;
pwr_sdClass_Di_DIX2 DCard;
pwr_sClass_ChanDi ChanDi;
pwr_tUInt32 MaxChan;
pwr_tUInt32 Chan;
pwr_tString80 NewName;
pwr_tString80 Description;
pwr_tString80 Identity;
pwr_tString80 DefName;
pwr_sObject DefBody;
pwr_tObjid DefObject;
int i;
if (Class != pwr_cClass_ChanDi)
return PWRB__CHANCLASS;
sts = ldh_ReadObjectBody(Session, Card, "RtBody", &RCard, sizeof(RCard));
if (EVEN(sts)) return sts;
sts = ldh_ReadObjectBody(Session, Card, "DevBody", &DCard, sizeof(DCard));
if (EVEN(sts)) return sts;
MaxChan = min(32, RCard.MaxNoOfChannels);
for (i = 0, Chan = 1; i < MaxChan; i++, Chan <<= 1) {
if ((DCard.ChannelAllocation & Chan) == 0)
break;
}
if (i >= MaxChan)
return PWRB__ALOCHAN;
/* allocate new channel */
DCard.ChannelAllocation |= Chan;
sts = ldh_SetObjectBody(Session, Card, "DevBody", (char *)&DCard, sizeof(DCard));
if (EVEN(sts)) return sts;
/*
change attributes of channel
NOTE !
this should be done by a method of the channel object,
but is not implemented in this version of PROVIEW/R.
*/
switch (Class) {
case pwr_cClass_ChanDi:
sts = ldh_ReadObjectBody(Session, Channel, "RtBody", &ChanDi,
sizeof(ChanDi));
if (EVEN(sts)) return sts;
if (ChanDi.Description[0] != '\0') {
sprintf(Description, ChanDi.Description, i);
if (strlen(Description) <= sizeof(ChanDi.Description) - 1) {
strcpy(ChanDi.Description, Description);
}
}
if (ChanDi.Identity[0] != '\0') {
sprintf(Identity, ChanDi.Identity, i);
if (strlen(Identity) <= sizeof(ChanDi.Identity) - 1) {
strcpy(ChanDi.Identity, Identity);
}
}
ChanDi.Number = i;
sts = ldh_SetObjectBody(Session, Channel, "RtBody", (char *)&ChanDi, sizeof(ChanDi));
strcpy(DefName, "pwrb:Class-ChanDi-Defaults");
break;
}
/* change name of channel */
sts = ldh_NameToObjid(Session, &DefObject, DefName);
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_ReadObjectBody(Session, DefObject, "SysBody", &DefBody,
sizeof(DefBody));
if (DefBody.Name[0] != '\0') {
sprintf(NewName, DefBody.Name, i+1);
NewName[31] = '\0';
sts = ldh_SetObjectName(Session, Channel, NewName);
}
return PWRB__SUCCESS;
}
/*----------------------------------------------------------------------------*\
Unadopt a channel.
\*----------------------------------------------------------------------------*/
static pwr_tStatus PostUnadopt (
ldh_tSesContext Session,
pwr_tObjid Card, /* current card object */
pwr_tObjid Channel,
pwr_tClassId Class /* class of child to adopt */
) {
pwr_tStatus sts;
pwr_sClass_Di_DIX2 RCard;
pwr_sClass_ChanDi ChanDi;
pwr_sdClass_Di_DIX2 DCard;
pwr_tUInt32 MaxChan;
pwr_tUInt32 Chan;
pwr_tString80 NewName;
if (Class != pwr_cClass_ChanDi)
return PWRB__SUCCESS;
sts = ldh_ReadObjectBody(Session, Card, "RtBody", &RCard, sizeof(RCard));
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_ReadObjectBody(Session, Card, "DevBody", &DCard, sizeof(DCard));
if (EVEN(sts)) return PWRB__SUCCESS;
MaxChan = min(32, RCard.MaxNoOfChannels);
/*
get attributes of channel
NOTE !
this should be done by a method of the channel object,
but is not implemented in this version of PROVIEW/R.
*/
switch (Class) {
case pwr_cClass_ChanDi:
sts = ldh_ReadObjectBody(Session, Channel, "RtBody", &ChanDi,
sizeof(ChanDi));
if (EVEN(sts)) return PWRB__SUCCESS;
Chan = ChanDi.Number;
break;
}
/* deallocate channel */
if (Chan > MaxChan)
return PWRB__SUCCESS;
DCard.ChannelAllocation &= ~(1 << Chan);
sts = ldh_SetObjectBody(Session, Card, "DevBody", (char *)&DCard, sizeof(DCard));
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_GetUniqueObjectName(Session, Channel, NewName);
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_SetObjectName(Session, Channel, NewName);
if (EVEN(sts)) return PWRB__SUCCESS;
return PWRB__SUCCESS;
}
/*----------------------------------------------------------------------------*\
Syntax check.
\*----------------------------------------------------------------------------*/
static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session,
pwr_tObjid Object, /* current object */
int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */
) {
pwr_tStatus sts;
sts = wsx_CheckCard( Session, Object, ErrorCount, WarningCount,
wsx_mCardOption_DevName);
if (EVEN(sts)) return sts;
return PWRB__SUCCESS;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindMethods(Di_DIX2) = {
pwr_BindMethod(AnteAdopt),
pwr_BindMethod(PostUnadopt),
pwr_BindMethod(PostAdopt),
pwr_BindMethod(SyntaxCheck),
pwr_NullMethod
};
/*
* Proview $Id: wb_c_do_hvdo32.c,v 1.1 2005-12-30 15:52:05 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.
**/
/* wb_c_do_hvdo32.c -- work bench methods of the Do_HVDO32 class. */
#include <stdio.h>
#include <string.h>
#include "wb_pwrs.h"
#include "wb_ldh_msg.h"
#include "wb_pwrb_msg.h"
#include "pwr_baseclasses.h"
#include "pwr_basecomponentclasses.h"
#include "pwr_ssaboxclasses.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
#include "wb_nav_macros.h"
/*----------------------------------------------------------------------------*\
Check if it's ok to adopt a new object.
\*----------------------------------------------------------------------------*/
static pwr_tStatus AnteAdopt (
ldh_tSesContext Session,
pwr_tObjid Card, /* current card object */
pwr_tClassId Class /* class of child to adopt */
) {
pwr_tStatus sts;
pwr_sClass_Do_HVDO32 RCard;
pwr_sdClass_Do_HVDO32 DCard;
pwr_tUInt32 MaxChan;
pwr_tUInt32 Chan;
int i;
if (Class != pwr_cClass_ChanDo)
return PWRB__CHANCLASS;
sts = ldh_ReadObjectBody(Session, Card, "RtBody", &RCard, sizeof(RCard));
if (EVEN(sts)) return sts;
sts = ldh_ReadObjectBody(Session, Card, "DevBody", &DCard, sizeof(DCard));
if (EVEN(sts)) return sts;
MaxChan = min(32, RCard.MaxNoOfChannels);
for (i = 0, Chan = 1; i < MaxChan; i++, Chan <<= 1) {
if ((DCard.ChannelAllocation & Chan) == 0)
break;
}
if (i >= MaxChan)
return PWRB__ALOCHAN;
else
return LDH__ADOPTRENAME;
}
/*----------------------------------------------------------------------------*\
Adopt a new channel.
\*----------------------------------------------------------------------------*/
static pwr_tStatus PostAdopt (
ldh_tSesContext Session,
pwr_tObjid Card, /* current card object */
pwr_tObjid Channel,
pwr_tClassId Class /* class of child to adopt */
) {
pwr_tStatus sts;
pwr_sClass_Do_HVDO32 RCard;
pwr_sdClass_Do_HVDO32 DCard;
pwr_sClass_ChanDo ChanDo;
pwr_tUInt32 MaxChan;
pwr_tUInt32 Chan;
pwr_tString80 NewName;
pwr_tString80 Description;
pwr_tString80 Identity;
pwr_tString80 DefName;
pwr_sObject DefBody;
pwr_tObjid DefObject;
int i;
if (Class != pwr_cClass_ChanDo)
return PWRB__CHANCLASS;
sts = ldh_ReadObjectBody(Session, Card, "RtBody", &RCard, sizeof(RCard));
if (EVEN(sts)) return sts;
sts = ldh_ReadObjectBody(Session, Card, "DevBody", &DCard, sizeof(DCard));
if (EVEN(sts)) return sts;
MaxChan = min(32, RCard.MaxNoOfChannels);
for (i = 0, Chan = 1; i < MaxChan; i++, Chan <<= 1) {
if ((DCard.ChannelAllocation & Chan) == 0)
break;
}
if (i >= MaxChan)
return PWRB__ALOCHAN;
/* allocate new channel */
DCard.ChannelAllocation |= Chan;
sts = ldh_SetObjectBody(Session, Card, "DevBody", (char *)&DCard, sizeof(DCard));
if (EVEN(sts)) return sts;
/*
change attributes of channel
NOTE !
this should be done by a method of the channel object,
but is not implemented in this version of PROVIEW/R.
*/
switch (Class) {
case pwr_cClass_ChanDo:
sts = ldh_ReadObjectBody(Session, Channel, "RtBody", &ChanDo,
sizeof(ChanDo));
if (EVEN(sts)) return sts;
if (ChanDo.Description[0] != '\0') {
sprintf(Description, ChanDo.Description, i);
if (strlen(Description) <= sizeof(ChanDo.Description) - 1) {
strcpy(ChanDo.Description, Description);
}
}
if (ChanDo.Identity[0] != '\0') {
sprintf(Identity, ChanDo.Identity, i);
if (strlen(Identity) <= sizeof(ChanDo.Identity) - 1) {
strcpy(ChanDo.Identity, Identity);
}
}
ChanDo.Number = i;
sts = ldh_SetObjectBody(Session, Channel, "RtBody", (char *)&ChanDo, sizeof(ChanDo));
strcpy(DefName, "pwrb:Class-ChanDo-Defaults");
break;
}
/* change name of channel */
sts = ldh_NameToObjid(Session, &DefObject, DefName);
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_ReadObjectBody(Session, DefObject, "SysBody", &DefBody,
sizeof(DefBody));
if (DefBody.Name[0] != '\0') {
sprintf(NewName, DefBody.Name, i+1);
NewName[31] = '\0';
sts = ldh_SetObjectName(Session, Channel, NewName);
}
return PWRB__SUCCESS;
}
/*----------------------------------------------------------------------------*\
Unadopt a channel.
\*----------------------------------------------------------------------------*/
static pwr_tStatus PostUnadopt (
ldh_tSesContext Session,
pwr_tObjid Card, /* current card object */
pwr_tObjid Channel,
pwr_tClassId Class /* class of child to adopt */
) {
pwr_tStatus sts;
pwr_sClass_Do_HVDO32 RCard;
pwr_sClass_ChanDo ChanDo;
pwr_sdClass_Do_HVDO32 DCard;
pwr_tUInt32 MaxChan;
pwr_tUInt32 Chan;
pwr_tString80 NewName;
if (Class != pwr_cClass_ChanDo)
return PWRB__SUCCESS;
sts = ldh_ReadObjectBody(Session, Card, "RtBody", &RCard, sizeof(RCard));
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_ReadObjectBody(Session, Card, "DevBody", &DCard, sizeof(DCard));
if (EVEN(sts)) return PWRB__SUCCESS;
MaxChan = min(32, RCard.MaxNoOfChannels);
/*
get attributes of channel
NOTE !
this should be done by a method of the channel object,
but is not implemented in this version of PROVIEW/R.
*/
switch (Class) {
case pwr_cClass_ChanDo:
sts = ldh_ReadObjectBody(Session, Channel, "RtBody", &ChanDo,
sizeof(ChanDo));
if (EVEN(sts)) return PWRB__SUCCESS;
Chan = ChanDo.Number;
break;
}
/* deallocate channel */
if (Chan > MaxChan)
return PWRB__SUCCESS;
DCard.ChannelAllocation &= ~(1 << Chan);
sts = ldh_SetObjectBody(Session, Card, "DevBody", (char *)&DCard, sizeof(DCard));
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_GetUniqueObjectName(Session, Channel, NewName);
if (EVEN(sts)) return PWRB__SUCCESS;
sts = ldh_SetObjectName(Session, Channel, NewName);
if (EVEN(sts)) return PWRB__SUCCESS;
return PWRB__SUCCESS;
}
/*----------------------------------------------------------------------------*\
Syntax check.
\*----------------------------------------------------------------------------*/
static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session,
pwr_tObjid Object, /* current object */
int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */
) {
pwr_tStatus sts;
sts = wsx_CheckCard( Session, Object, ErrorCount, WarningCount,
wsx_mCardOption_DevName);
if (EVEN(sts)) return sts;
return PWRB__SUCCESS;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindMethods(Do_HVDO32) = {
pwr_BindMethod(AnteAdopt),
pwr_BindMethod(PostUnadopt),
pwr_BindMethod(PostAdopt),
pwr_BindMethod(SyntaxCheck),
pwr_NullMethod
};
Ai_HVAI32
Ai_AI32uP
Ao_HVAO4
Ao_AO8uP
Backup
Co_PI24BO
Co_CO4uP
Di_DIX2
Do_HVDO32
#
# Script to export all classgraphs to java
#
#
#
function int process( string graph)
open 'graph'
printf( "Exporting %s...\n", graph);
export java
endfunction
main()
process( "pwr_c_ssab_safetyswitch");
endmain
Volume SsabOx $ClassVolume 0.0.250.5 Volume SsabOx $ClassVolume 0.0.250.5
Body SysBody 01-JAN-1970 01:00:00.00 Body SysBody 01-JAN-1970 01:00:00.00
Attr NextOix = "_X57" Attr NextOix = "_X147"
Attr NextCix = "_X16" Attr NextCix = "_X25"
Attr NextTix[0] = "_X4"
EndBody EndBody
Object Class $ClassHier 1 06-OCT-2005 14:45:53.00 Object Type $TypeHier 138 30-DEC-2005 14:28:03.99
Object SsabCoDivCountEnum $TypeDef 1 30-DEC-2005 14:28:31.10
Body SysBody 30-DEC-2005 14:28:31.10
Attr TypeRef = "pwrs:Type-$Enum"
Attr Elements = 1
Attr PgmName = "SsabCoDivCount"
EndBody
Object No $Value 139 30-DEC-2005 14:28:31.10
Body SysBody 30-DEC-2005 14:28:31.10
Attr Text = "No"
Attr PgmName = "No"
EndBody
EndObject
Object 16 $Value 140 30-DEC-2005 14:28:31.10
Body SysBody 30-DEC-2005 14:28:31.10
Attr Text = "16"
Attr PgmName = "16"
Attr Value = 16
EndBody
EndObject
EndObject
Object SsabCoMulCountEnum $TypeDef 2 30-DEC-2005 14:28:31.10
Body SysBody 30-DEC-2005 14:28:31.10
Attr TypeRef = "pwrs:Type-$Enum"
Attr Elements = 1
Attr PgmName = "SsabCoMulCount"
EndBody
Object 2 $Value 141 30-DEC-2005 14:28:31.10
Body SysBody 30-DEC-2005 14:28:31.10
Attr Text = "2"
Attr PgmName = "2"
Attr Value = 2
EndBody
EndObject
Object 4 $Value 142 30-DEC-2005 14:28:31.10
Body SysBody 30-DEC-2005 14:28:31.10
Attr Text = "4"
Attr PgmName = "4"
Attr Value = 4
EndBody
EndObject
EndObject
Object SsabCoNoOfBitsEnum $TypeDef 3 30-DEC-2005 14:28:31.10
Body SysBody 30-DEC-2005 14:28:31.10
Attr TypeRef = "pwrs:Type-$Enum"
Attr Elements = 1
Attr PgmName = "SsabCoNoOfBits"
EndBody
Object 16 $Value 143 30-DEC-2005 14:28:31.10
Body SysBody 30-DEC-2005 14:28:31.10
Attr Text = "16"
Attr PgmName = "16"
Attr Value = 16
EndBody
EndObject
Object 24 $Value 144 30-DEC-2005 14:28:31.10
Body SysBody 30-DEC-2005 14:28:31.10
Attr Text = "24"
Attr PgmName = "24"
Attr Value = 24
EndBody
EndObject
EndObject
EndObject
Object Class $ClassHier 1 30-DEC-2005 14:28:05.82
Object Rack_SSAB $ClassDef 24 30-DEC-2005 14:44:19.65
Body SysBody 30-DEC-2005 14:40:05.50
Attr Editor = 0
Attr Method = 1
Attr Flags = 8208
EndBody
Object RtBody $ObjBodyDef 1 30-DEC-2005 14:40:05.50
Body SysBody 30-DEC-2005 14:44:27.57
Attr StructName = "Rack_SSAB"
Attr NextAix = "_X5"
EndBody
Object IOSysType $Attribute 1 30-DEC-2005 14:40:05.50
Body SysBody 30-DEC-2005 14:40:05.50
Attr PgmName = "IOSysType"
Attr Flags = 32
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
Object Description $Attribute 2 30-DEC-2005 14:40:05.50
Body SysBody 30-DEC-2005 14:40:05.50
Attr PgmName = "Description"
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
Object MaxNoOfCards $Attribute 3 30-DEC-2005 14:40:05.50
Body SysBody 30-DEC-2005 14:40:05.50
Attr PgmName = "MaxNoOfCards"
Attr Flags = 32
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
Object DataSheet $Attribute 4 30-DEC-2005 14:40:05.50
Body SysBody 30-DEC-2005 14:40:05.50
Attr PgmName = "DataSheet"
Attr TypeRef = "pwrs:Type-$URL"
EndBody
EndObject
EndObject
Object IoMethods $RtMethod 145 30-DEC-2005 14:40:05.50
Object IoRackInit $Method 146 30-DEC-2005 14:40:05.50
Body SysBody 30-DEC-2005 14:40:05.50
Attr MethodName = "Rack_SSAB-IoRackInit"
EndBody
EndObject
Object IoRackClose $Method 147 30-DEC-2005 14:40:05.50
Body SysBody 30-DEC-2005 14:40:05.50
Attr MethodName = "Rack_SSAB-IoRackClose"
EndBody
EndObject
EndObject
Object Template Rack_SSAB 2154004480 01-JAN-1970 01:00:00.00
Body RtBody 30-DEC-2005 14:46:17.32
Attr IOSysType = 1
Attr MaxNoOfCards = 16
Attr DataSheet = "$pwr_lang/dsh/ssab_rack_ssab.pdf"
EndBody
EndObject
EndObject
!/** !/**
! @Version 1.0 ! @Version 1.0
! @Group SafetySwitch ! @Group SafetySwitch
...@@ -3790,11 +3913,11 @@ Volume SsabOx $ClassVolume 0.0.250.5 ...@@ -3790,11 +3913,11 @@ Volume SsabOx $ClassVolume 0.0.250.5
! If NoOfBits is 16, bit 12 is set in the configuration word of the counter. ! If NoOfBits is 16, bit 12 is set in the configuration word of the counter.
!*/ !*/
Object NoOfBits $Attribute 10 06-OCT-2005 14:45:53.00 Object NoOfBits $Attribute 10 06-OCT-2005 14:45:53.00
Body SysBody 01-JAN-1970 01:00:00.00 Body SysBody 30-DEC-2005 14:30:21.06
Attr PgmName = "NoOfBits" Attr PgmName = "NoOfBits"
Attr Flags = 2 Attr Flags = 2
Attr Elements = 4 Attr Elements = 4
Attr TypeRef = "pwrb:Type-SsabCoNoOfBitsEnum" Attr TypeRef = "SsabOx:Type-SsabCoNoOfBitsEnum"
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -3814,11 +3937,11 @@ Volume SsabOx $ClassVolume 0.0.250.5 ...@@ -3814,11 +3937,11 @@ Volume SsabOx $ClassVolume 0.0.250.5
! If MulCount is 2, bit 11 is set in the configuration word of the counter. ! If MulCount is 2, bit 11 is set in the configuration word of the counter.
!*/ !*/
Object MulCount $Attribute 12 06-OCT-2005 14:45:53.00 Object MulCount $Attribute 12 06-OCT-2005 14:45:53.00
Body SysBody 01-JAN-1970 01:00:00.00 Body SysBody 30-DEC-2005 14:29:27.64
Attr PgmName = "MulCount" Attr PgmName = "MulCount"
Attr Flags = 2 Attr Flags = 2
Attr Elements = 4 Attr Elements = 4
Attr TypeRef = "pwrb:Type-SsabCoMulCountEnum" Attr TypeRef = "SsabOx:Type-SsabCoMulCountEnum"
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -3827,11 +3950,11 @@ Volume SsabOx $ClassVolume 0.0.250.5 ...@@ -3827,11 +3950,11 @@ Volume SsabOx $ClassVolume 0.0.250.5
! If DivCount is 16, bit 9 is set in the configuration word of the counter. ! If DivCount is 16, bit 9 is set in the configuration word of the counter.
!*/ !*/
Object DivCount $Attribute 13 06-OCT-2005 14:45:53.00 Object DivCount $Attribute 13 06-OCT-2005 14:45:53.00
Body SysBody 01-JAN-1970 01:00:00.00 Body SysBody 30-DEC-2005 14:29:57.43
Attr PgmName = "DivCount" Attr PgmName = "DivCount"
Attr Flags = 2 Attr Flags = 2
Attr Elements = 4 Attr Elements = 4
Attr TypeRef = "pwrb:Type-SsabCoDivCountEnum" Attr TypeRef = "SsabOx:Type-SsabCoDivCountEnum"
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -4090,5 +4213,1553 @@ Volume SsabOx $ClassVolume 0.0.250.5 ...@@ -4090,5 +4213,1553 @@ Volume SsabOx $ClassVolume 0.0.250.5
EndObject EndObject
EndObject EndObject
EndObject EndObject
Object Ai_AI32uP $ClassDef 16 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr Editor = 0
Attr Method = 5
Attr Flags = 49232
EndBody
Object RtBody $ObjBodyDef 1 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr StructName = "Ai_AI32uP"
Attr NextAix = "_X12"
EndBody
Object Description $Attribute 1 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "Description"
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
Object DevName $Attribute 2 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "DevName"
Attr TypeRef = "pwrs:Type-$String40"
EndBody
EndObject
Object ErrorCount $Attribute 3 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ErrorCount"
Attr Flags = 16
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ErrorSoftLimit $Attribute 4 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ErrorSoftLimit"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ErrorHardLimit $Attribute 5 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ErrorHardLimit"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object MaxNoOfChannels $Attribute 6 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "MaxNoOfChannels"
Attr Flags = 32
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
Object RegAddress $Attribute 7 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "RegAddress"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object VectAddress $Attribute 8 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "VectAddress"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object Process $Attribute 9 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "Process"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ThreadObject $Intern 10 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ThreadObject"
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
Object DataSheet $Attribute 11 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "DataSheet"
Attr TypeRef = "pwrs:Type-$URL"
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr NextAix = "_X2"
EndBody
Object ChannelAllocation $Attribute 1 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ChannelAllocation"
Attr Flags = 1024
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
EndObject
Object AnteAdopt $DbCallBack 58 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Ai_AI32uP-AnteAdopt"
EndBody
EndObject
Object PostUnadopt $DbCallBack 59 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Ai_AI32uP-PostUnadopt"
EndBody
EndObject
Object PostAdopt $DbCallBack 60 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Ai_AI32uP-PostAdopt"
EndBody
EndObject
Object ConfiguratorPoson $Menu 61 30-DEC-2005 11:26:36.69
Object Pointed $Menu 62 30-DEC-2005 11:26:36.69
Object Connect $MenuButton 63 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr ButtonName = "Connect PlcThread"
Attr MethodName = "$Objid-Connect"
Attr MethodArguments[0] = "ThreadObject"
Attr MethodArguments[1] = "PlcThread"
Attr FilterName = "$Objid-IsOkConnect"
Attr FilterArguments[0] = "ThreadObject"
Attr FilterArguments[1] = "PlcThread"
EndBody
EndObject
EndObject
EndObject
Object IoMethods $RtMethod 64 30-DEC-2005 11:26:36.69
Object IoCardInit $Method 65 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Ai_AI32uP-IoCardInit"
EndBody
EndObject
Object IoCardClose $Method 66 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Ai_AI32uP-IoCardClose"
EndBody
EndObject
Object IoCardRead $Method 67 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Ai_AI32uP-IoCardRead"
EndBody
EndObject
EndObject
Object Template Ai_AI32uP 2151907328 01-JAN-1970 01:00:00.00
Body RtBody 30-DEC-2005 11:43:21.78
Attr ErrorSoftLimit = 15
Attr ErrorHardLimit = 50
Attr MaxNoOfChannels = 32
Attr Process = 1
Attr DataSheet = "$pwr_lang/dsh/ssab_ai_ai32up.pdf"
EndBody
Body DevBody 01-JAN-1970 01:00:00.00
EndBody
EndObject
EndObject
Object Ai_HVAI32 $ClassDef 17 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr Editor = 0
Attr Method = 5
Attr Flags = 49232
EndBody
Object RtBody $ObjBodyDef 1 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr StructName = "Ai_HVAI32"
Attr NextAix = "_X14"
EndBody
Object Description $Attribute 1 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "Description"
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
Object DevName $Attribute 2 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "DevName"
Attr TypeRef = "pwrs:Type-$String40"
EndBody
EndObject
Object ErrorCount $Attribute 3 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ErrorCount"
Attr Flags = 16
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ErrorSoftLimit $Attribute 4 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ErrorSoftLimit"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ErrorHardLimit $Attribute 5 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ErrorHardLimit"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object DevPolyCoef0 $Attribute 6 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "DevPolyCoef0"
Attr Flags = 2048
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
Object DevPolyCoef1 $Attribute 7 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "DevPolyCoef1"
Attr Flags = 2048
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
Object MaxNoOfChannels $Attribute 8 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "MaxNoOfChannels"
Attr Flags = 32
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
Object RegAddress $Attribute 9 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "RegAddress"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object VectAddress $Attribute 10 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "VectAddress"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object Process $Attribute 11 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "Process"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ThreadObject $Intern 12 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ThreadObject"
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
Object DataSheet $Attribute 13 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "DataSheet"
Attr TypeRef = "pwrs:Type-$URL"
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr NextAix = "_X2"
EndBody
Object ChannelAllocation $Attribute 1 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ChannelAllocation"
Attr Flags = 1024
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
EndObject
Object AnteAdopt $DbCallBack 68 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Ai_HVAI32-AnteAdopt"
EndBody
EndObject
Object PostUnadopt $DbCallBack 69 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Ai_HVAI32-PostUnadopt"
EndBody
EndObject
Object PostAdopt $DbCallBack 70 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Ai_HVAI32-PostAdopt"
EndBody
EndObject
Object ConfiguratorPoson $Menu 71 30-DEC-2005 11:26:36.69
Object Pointed $Menu 72 30-DEC-2005 11:26:36.69
Object Connect $MenuButton 73 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr ButtonName = "Connect PlcThread"
Attr MethodName = "$Objid-Connect"
Attr MethodArguments[0] = "ThreadObject"
Attr MethodArguments[1] = "PlcThread"
Attr FilterName = "$Objid-IsOkConnect"
Attr FilterArguments[0] = "ThreadObject"
Attr FilterArguments[1] = "PlcThread"
EndBody
EndObject
EndObject
EndObject
Object IoMethods $RtMethod 74 30-DEC-2005 11:26:36.69
Object IoCardInit $Method 75 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Ai_HVAI32-IoCardInit"
EndBody
EndObject
Object IoCardClose $Method 76 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Ai_HVAI32-IoCardClose"
EndBody
EndObject
Object IoCardRead $Method 77 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Ai_HVAI32-IoCardRead"
EndBody
EndObject
EndObject
Object Template Ai_HVAI32 2152169472 01-JAN-1970 01:00:00.00
Body RtBody 30-DEC-2005 11:43:15.01
Attr MaxNoOfChannels = 32
Attr Process = 2
Attr DataSheet = "$pwr_lang/dsh/ssab_ai_hvai32.pdf"
EndBody
Body DevBody 01-JAN-1970 01:00:00.00
EndBody
EndObject
EndObject
Object Ao_AO8uP $ClassDef 18 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr Editor = 0
Attr Method = 5
Attr Flags = 49232
EndBody
Object RtBody $ObjBodyDef 1 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr StructName = "Ao_AO8uP"
Attr NextAix = "_X14"
EndBody
Object Description $Attribute 1 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "Description"
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
Object DevName $Attribute 2 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "DevName"
Attr TypeRef = "pwrs:Type-$String40"
EndBody
EndObject
Object ErrorCount $Attribute 3 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ErrorCount"
Attr Flags = 16
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ErrorSoftLimit $Attribute 4 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ErrorSoftLimit"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ErrorHardLimit $Attribute 5 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ErrorHardLimit"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object DevPolyCoef0 $Attribute 6 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "DevPolyCoef0"
Attr Flags = 2048
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
Object DevPolyCoef1 $Attribute 7 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "DevPolyCoef1"
Attr Flags = 2048
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
Object MaxNoOfChannels $Attribute 8 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "MaxNoOfChannels"
Attr Flags = 32
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
Object RegAddress $Attribute 9 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "RegAddress"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object VectAddress $Attribute 10 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "VectAddress"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object Process $Attribute 11 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "Process"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ThreadObject $Intern 12 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ThreadObject"
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
Object DataSheet $Attribute 13 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "DataSheet"
Attr TypeRef = "pwrs:Type-$URL"
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr NextAix = "_X2"
EndBody
Object ChannelAllocation $Attribute 1 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ChannelAllocation"
Attr Flags = 1024
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
EndObject
Object AnteAdopt $DbCallBack 78 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Ao_HVAO4-AnteAdopt"
EndBody
EndObject
Object PostUnadopt $DbCallBack 79 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Ao_HVAO4-PostUnadopt"
EndBody
EndObject
Object PostAdopt $DbCallBack 80 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Ao_HVAO4-PostAdopt"
EndBody
EndObject
Object ConfiguratorPoson $Menu 81 30-DEC-2005 11:26:36.69
Object Pointed $Menu 82 30-DEC-2005 11:26:36.69
Object Connect $MenuButton 83 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr ButtonName = "Connect PlcThread"
Attr MethodName = "$Objid-Connect"
Attr MethodArguments[0] = "ThreadObject"
Attr MethodArguments[1] = "PlcThread"
Attr FilterName = "$Objid-IsOkConnect"
Attr FilterArguments[0] = "ThreadObject"
Attr FilterArguments[1] = "PlcThread"
EndBody
EndObject
EndObject
EndObject
Object IoMethods $RtMethod 84 30-DEC-2005 11:26:36.69
Object IoCardInit $Method 85 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Ao_AO8uP-IoCardInit"
EndBody
EndObject
Object IoCardClose $Method 86 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Ao_AO8uP-IoCardClose"
EndBody
EndObject
Object IoCardWrite $Method 87 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Ao_AO8uP-IoCardWrite"
EndBody
EndObject
EndObject
Object Template Ao_AO8uP 2152431616 01-JAN-1970 01:00:00.00
Body RtBody 30-DEC-2005 11:43:07.74
Attr ErrorSoftLimit = 15
Attr ErrorHardLimit = 50
Attr MaxNoOfChannels = 8
Attr Process = 1
Attr DataSheet = "$pwr_lang/dsh/ssab_ao_ao8up.pdf"
EndBody
Body DevBody 01-JAN-1970 01:00:00.00
EndBody
EndObject
EndObject
Object Ao_HVAO4 $ClassDef 19 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr Editor = 0
Attr Method = 5
Attr Flags = 49232
EndBody
Object RtBody $ObjBodyDef 1 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr StructName = "Ao_HVAO4"
Attr NextAix = "_X14"
EndBody
Object Description $Attribute 1 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "Description"
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
Object DevName $Attribute 2 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "DevName"
Attr TypeRef = "pwrs:Type-$String40"
EndBody
EndObject
Object ErrorCount $Attribute 3 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ErrorCount"
Attr Flags = 16
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ErrorSoftLimit $Attribute 4 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ErrorSoftLimit"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ErrorHardLimit $Attribute 5 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ErrorHardLimit"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object DevPolyCoef0 $Attribute 6 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "DevPolyCoef0"
Attr Flags = 2048
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
Object DevPolyCoef1 $Attribute 7 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "DevPolyCoef1"
Attr Flags = 2048
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
Object MaxNoOfChannels $Attribute 8 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "MaxNoOfChannels"
Attr Flags = 32
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
Object RegAddress $Attribute 9 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "RegAddress"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object VectAddress $Attribute 10 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "VectAddress"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object Process $Attribute 11 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "Process"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ThreadObject $Intern 12 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ThreadObject"
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
Object DataSheet $Attribute 13 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "DataSheet"
Attr TypeRef = "pwrs:Type-$URL"
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr NextAix = "_X2"
EndBody
Object ChannelAllocation $Attribute 1 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ChannelAllocation"
Attr Flags = 1024
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
EndObject
Object AnteAdopt $DbCallBack 88 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Ao_HVAO4-AnteAdopt"
EndBody
EndObject
Object PostUnadopt $DbCallBack 89 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Ao_HVAO4-PostUnadopt"
EndBody
EndObject
Object PostAdopt $DbCallBack 90 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Ao_HVAO4-PostAdopt"
EndBody
EndObject
Object ConfiguratorPoson $Menu 91 30-DEC-2005 11:26:36.69
Object Pointed $Menu 92 30-DEC-2005 11:26:36.69
Object Connect $MenuButton 93 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr ButtonName = "Connect PlcThread"
Attr MethodName = "$Objid-Connect"
Attr MethodArguments[0] = "ThreadObject"
Attr MethodArguments[1] = "PlcThread"
Attr FilterName = "$Objid-IsOkConnect"
Attr FilterArguments[0] = "ThreadObject"
Attr FilterArguments[1] = "PlcThread"
EndBody
EndObject
EndObject
EndObject
Object IoMethods $RtMethod 94 30-DEC-2005 11:26:36.69
Object IoCardInit $Method 95 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Ao_HVAO4-IoCardInit"
EndBody
EndObject
Object IoCardClose $Method 96 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Ao_HVAO4-IoCardClose"
EndBody
EndObject
Object IoCardWrite $Method 97 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Ao_HVAO4-IoCardWrite"
EndBody
EndObject
EndObject
Object Template Ao_HVAO4 2152693760 01-JAN-1970 01:00:00.00
Body RtBody 30-DEC-2005 11:42:39.04
Attr MaxNoOfChannels = 4
Attr Process = 2
Attr DataSheet = "$pwr_lang/dsh/ssab_ao_hvao4.pdf"
EndBody
Body DevBody 01-JAN-1970 01:00:00.00
EndBody
EndObject
EndObject
Object Co_CO4uP $ClassDef 20 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr Editor = 0
Attr Method = 5
Attr Flags = 49232
EndBody
Object RtBody $ObjBodyDef 1 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr StructName = "Co_CO4uP"
Attr NextAix = "_X24"
EndBody
Object Description $Attribute 1 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "Description"
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
Object DevName $Attribute 2 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "DevName"
Attr TypeRef = "pwrs:Type-$String40"
EndBody
EndObject
Object ErrorCount $Attribute 3 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ErrorCount"
Attr Flags = 16
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ErrorSoftLimit $Attribute 4 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ErrorSoftLimit"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ErrorHardLimit $Attribute 5 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ErrorHardLimit"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ConvMask $Attribute 6 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ConvMask"
Attr TypeRef = "pwrs:Type-$Mask"
EndBody
EndObject
Object MaxNoOfCounters $Attribute 7 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "MaxNoOfCounters"
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
Object COAbsFlag $Attribute 8 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "COAbsFlag"
Attr Flags = 2
Attr Elements = 4
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object NoOfBits $Attribute 9 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 14:30:39.00
Attr PgmName = "NoOfBits"
Attr Flags = 2
Attr Elements = 4
Attr TypeRef = "SsabOx:Type-SsabCoNoOfBitsEnum"
EndBody
EndObject
Object COWrFlag $Attribute 10 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "COWrFlag"
Attr Flags = 2
Attr Elements = 4
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object MulCount $Attribute 11 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 14:30:50.25
Attr PgmName = "MulCount"
Attr Flags = 2
Attr Elements = 4
Attr TypeRef = "SsabOx:Type-SsabCoMulCountEnum"
EndBody
EndObject
Object DivCount $Attribute 12 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 14:30:58.25
Attr PgmName = "DivCount"
Attr Flags = 2
Attr Elements = 4
Attr TypeRef = "SsabOx:Type-SsabCoDivCountEnum"
EndBody
EndObject
Object CopWrRough $Attribute 13 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "CopWrRough"
Attr Flags = 2
Attr Elements = 4
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object CopWrFine $Attribute 14 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "CopWrFine"
Attr Flags = 2
Attr Elements = 4
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object LoadWrReg $Attribute 15 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "LoadWrReg"
Attr Flags = 2
Attr Elements = 4
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object LengthMeasurement $Attribute 16 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "LengthMeasurement"
Attr Flags = 2
Attr Elements = 4
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object SpeedMeasurement $Attribute 17 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "SpeedMeasurement"
Attr Flags = 2
Attr Elements = 4
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object SyncRawValue $Attribute 18 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "SyncRawValue"
Attr Flags = 2
Attr Elements = 4
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object RegAddress $Attribute 19 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "RegAddress"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object VectAddress $Attribute 20 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "VectAddress"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object Process $Attribute 21 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "Process"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ThreadObject $Intern 22 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ThreadObject"
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
Object DataSheet $Attribute 23 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "DataSheet"
Attr TypeRef = "pwrs:Type-$URL"
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr NextAix = "_X2"
EndBody
Object ChannelAllocation $Attribute 1 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ChannelAllocation"
Attr Flags = 1024
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
EndObject
Object AnteAdopt $DbCallBack 98 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Co_PI24BO-AnteAdopt"
EndBody
EndObject
Object PostUnadopt $DbCallBack 99 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Co_PI24BO-PostUnadopt"
EndBody
EndObject
Object PostAdopt $DbCallBack 100 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Co_PI24BO-PostAdopt"
EndBody
EndObject
Object ConfiguratorPoson $Menu 101 30-DEC-2005 11:26:36.69
Object Pointed $Menu 102 30-DEC-2005 11:26:36.69
Object Connect $MenuButton 103 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr ButtonName = "Connect PlcThread"
Attr MethodName = "$Objid-Connect"
Attr MethodArguments[0] = "ThreadObject"
Attr MethodArguments[1] = "PlcThread"
Attr FilterName = "$Objid-IsOkConnect"
Attr FilterArguments[0] = "ThreadObject"
Attr FilterArguments[1] = "PlcThread"
EndBody
EndObject
EndObject
EndObject
Object IoMethods $RtMethod 104 30-DEC-2005 11:26:36.69
Object IoCardInit $Method 105 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Co_CO4uP-IoCardInit"
EndBody
EndObject
Object IoCardClose $Method 106 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Co_CO4uP-IoCardClose"
EndBody
EndObject
Object IoCardRead $Method 107 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Co_CO4uP-IoCardRead"
EndBody
EndObject
EndObject
Object Template Co_CO4uP 2152955904 01-JAN-1970 01:00:00.00
Body RtBody 30-DEC-2005 11:44:27.44
Attr ConvMask = 65535
Attr COAbsFlag[0] = 1
Attr COAbsFlag[1] = 1
Attr COAbsFlag[2] = 1
Attr COAbsFlag[3] = 1
Attr NoOfBits[0] = 24
Attr NoOfBits[1] = 24
Attr NoOfBits[2] = 24
Attr NoOfBits[3] = 24
Attr MulCount[0] = 4
Attr MulCount[1] = 4
Attr MulCount[2] = 4
Attr MulCount[3] = 4
Attr CopWrRough[0] = 1
Attr CopWrRough[1] = 1
Attr CopWrRough[2] = 1
Attr CopWrRough[3] = 1
Attr CopWrFine[0] = 1
Attr CopWrFine[1] = 1
Attr CopWrFine[2] = 1
Attr CopWrFine[3] = 1
Attr MaxNoOfCounters = 4
Attr Process = 1
Attr DataSheet = "$pwr_lang/dsh/ssab_co_co4up.pdf"
EndBody
Body DevBody 01-JAN-1970 01:00:00.00
EndBody
EndObject
EndObject
Object Co_PI24BO $ClassDef 21 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr Editor = 0
Attr Method = 5
Attr Flags = 49232
EndBody
Object RtBody $ObjBodyDef 1 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr StructName = "Co_PI24BO"
Attr NextAix = "_X24"
EndBody
Object Description $Attribute 1 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "Description"
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
Object DevName $Attribute 2 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "DevName"
Attr TypeRef = "pwrs:Type-$String40"
EndBody
EndObject
Object ErrorCount $Attribute 3 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ErrorCount"
Attr Flags = 16
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ErrorSoftLimit $Attribute 4 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ErrorSoftLimit"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ErrorHardLimit $Attribute 5 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ErrorHardLimit"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ConvMask $Attribute 6 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ConvMask"
Attr TypeRef = "pwrs:Type-$Mask"
EndBody
EndObject
Object MaxNoOfCounters $Attribute 7 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "MaxNoOfCounters"
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
Object COAbsFlag $Attribute 8 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "COAbsFlag"
Attr Flags = 2
Attr Elements = 4
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object NoOfBits $Attribute 9 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 14:31:16.33
Attr PgmName = "NoOfBits"
Attr Flags = 2
Attr Elements = 4
Attr TypeRef = "SsabOx:Type-SsabCoNoOfBitsEnum"
EndBody
EndObject
Object COWrFlag $Attribute 10 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "COWrFlag"
Attr Flags = 2
Attr Elements = 4
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object MulCount $Attribute 11 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 14:31:25.83
Attr PgmName = "MulCount"
Attr Flags = 2
Attr Elements = 4
Attr TypeRef = "SsabOx:Type-SsabCoMulCountEnum"
EndBody
EndObject
Object DivCount $Attribute 12 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 14:31:33.34
Attr PgmName = "DivCount"
Attr Flags = 2
Attr Elements = 4
Attr TypeRef = "SsabOx:Type-SsabCoDivCountEnum"
EndBody
EndObject
Object CopWrRough $Attribute 13 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "CopWrRough"
Attr Flags = 2
Attr Elements = 4
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object CopWrFine $Attribute 14 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "CopWrFine"
Attr Flags = 2
Attr Elements = 4
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object LoadWrReg $Attribute 15 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "LoadWrReg"
Attr Flags = 2
Attr Elements = 4
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object LengthMeasurement $Attribute 16 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "LengthMeasurement"
Attr Flags = 2
Attr Elements = 4
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object SpeedMeasurement $Attribute 17 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "SpeedMeasurement"
Attr Flags = 2
Attr Elements = 4
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object SyncRawValue $Attribute 18 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "SyncRawValue"
Attr Flags = 2
Attr Elements = 4
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object RegAddress $Attribute 19 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "RegAddress"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object VectAddress $Attribute 20 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "VectAddress"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object Process $Attribute 21 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "Process"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ThreadObject $Intern 22 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ThreadObject"
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
Object DataSheet $Attribute 23 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "DataSheet"
Attr TypeRef = "pwrs:Type-$URL"
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr NextAix = "_X2"
EndBody
Object ChannelAllocation $Attribute 1 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ChannelAllocation"
Attr Flags = 1024
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
EndObject
Object AnteAdopt $DbCallBack 108 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Co_PI24BO-AnteAdopt"
EndBody
EndObject
Object PostUnadopt $DbCallBack 109 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Co_PI24BO-PostUnadopt"
EndBody
EndObject
Object PostAdopt $DbCallBack 110 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Co_PI24BO-PostAdopt"
EndBody
EndObject
Object ConfiguratorPoson $Menu 111 30-DEC-2005 11:26:36.69
Object Pointed $Menu 112 30-DEC-2005 11:26:36.69
Object Connect $MenuButton 113 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr ButtonName = "Connect PlcThread"
Attr MethodName = "$Objid-Connect"
Attr MethodArguments[0] = "ThreadObject"
Attr MethodArguments[1] = "PlcThread"
Attr FilterName = "$Objid-IsOkConnect"
Attr FilterArguments[0] = "ThreadObject"
Attr FilterArguments[1] = "PlcThread"
EndBody
EndObject
EndObject
EndObject
Object IoMethods $RtMethod 114 30-DEC-2005 11:26:36.69
Object IoCardInit $Method 115 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Co_PI24BO-IoCardInit"
EndBody
EndObject
Object IoCardClose $Method 116 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Co_PI24BO-IoCardClose"
EndBody
EndObject
Object IoCardRead $Method 117 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Co_PI24BO-IoCardRead"
EndBody
EndObject
EndObject
Object Template Co_PI24BO 2153218048 01-JAN-1970 01:00:00.00
Body RtBody 30-DEC-2005 11:45:40.31
Attr ConvMask = 65535
Attr COAbsFlag[0] = 1
Attr COAbsFlag[1] = 1
Attr COAbsFlag[2] = 1
Attr COAbsFlag[3] = 1
Attr NoOfBits[0] = 24
Attr NoOfBits[1] = 24
Attr NoOfBits[2] = 24
Attr NoOfBits[3] = 24
Attr MulCount[0] = 4
Attr MulCount[1] = 4
Attr MulCount[2] = 4
Attr MulCount[3] = 4
Attr CopWrRough[0] = 1
Attr CopWrRough[1] = 1
Attr CopWrRough[2] = 1
Attr CopWrRough[3] = 1
Attr CopWrFine[0] = 1
Attr CopWrFine[1] = 1
Attr CopWrFine[2] = 1
Attr CopWrFine[3] = 1
Attr MaxNoOfCounters = 1
Attr Process = 1
Attr DataSheet = "$pwr_lang/dsh/ssab_co_pi24bo.pdf"
EndBody
Body DevBody 01-JAN-1970 01:00:00.00
EndBody
EndObject
EndObject
Object Di_DIX2 $ClassDef 22 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr Editor = 0
Attr Method = 5
Attr Flags = 49232
EndBody
Object RtBody $ObjBodyDef 1 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr StructName = "Di_DIX2"
Attr NextAix = "_X16"
EndBody
Object Description $Attribute 1 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "Description"
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
Object DevName $Attribute 2 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "DevName"
Attr TypeRef = "pwrs:Type-$String40"
EndBody
EndObject
Object ErrorCount $Attribute 3 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ErrorCount"
Attr Flags = 16
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ErrorSoftLimit $Attribute 4 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ErrorSoftLimit"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ErrorHardLimit $Attribute 5 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ErrorHardLimit"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ConvMask1 $Attribute 6 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ConvMask1"
Attr TypeRef = "pwrs:Type-$Mask"
EndBody
EndObject
Object ConvMask2 $Attribute 7 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ConvMask2"
Attr TypeRef = "pwrs:Type-$Mask"
EndBody
EndObject
Object InvMask1 $Attribute 8 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "InvMask1"
Attr TypeRef = "pwrs:Type-$Mask"
EndBody
EndObject
Object InvMask2 $Attribute 9 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "InvMask2"
Attr TypeRef = "pwrs:Type-$Mask"
EndBody
EndObject
Object MaxNoOfChannels $Attribute 10 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "MaxNoOfChannels"
Attr Flags = 32
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
Object RegAddress $Attribute 11 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "RegAddress"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object VectAddress $Attribute 12 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "VectAddress"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object Process $Attribute 13 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "Process"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ThreadObject $Intern 14 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ThreadObject"
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
Object DataSheet $Attribute 15 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "DataSheet"
Attr TypeRef = "pwrs:Type-$URL"
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr NextAix = "_X2"
EndBody
Object ChannelAllocation $Attribute 1 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ChannelAllocation"
Attr Flags = 1024
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
EndObject
Object AnteAdopt $DbCallBack 118 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Di_DIX2-AnteAdopt"
EndBody
EndObject
Object PostUnadopt $DbCallBack 119 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Di_DIX2-PostUnadopt"
EndBody
EndObject
Object PostAdopt $DbCallBack 120 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Di_DIX2-PostAdopt"
EndBody
EndObject
Object ConfiguratorPoson $Menu 121 30-DEC-2005 11:26:36.69
Object Pointed $Menu 122 30-DEC-2005 11:26:36.69
Object Connect $MenuButton 123 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr ButtonName = "Connect PlcThread"
Attr MethodName = "$Objid-Connect"
Attr MethodArguments[0] = "ThreadObject"
Attr MethodArguments[1] = "PlcThread"
Attr FilterName = "$Objid-IsOkConnect"
Attr FilterArguments[0] = "ThreadObject"
Attr FilterArguments[1] = "PlcThread"
EndBody
EndObject
EndObject
EndObject
Object IoMethods $RtMethod 124 30-DEC-2005 11:26:36.69
Object IoCardInit $Method 125 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Di_DIX2-IoCardInit"
EndBody
EndObject
Object IoCardClose $Method 126 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Di_DIX2-IoCardClose"
EndBody
EndObject
Object IoCardRead $Method 127 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Di_DIX2-IoCardRead"
EndBody
EndObject
EndObject
Object Template Di_DIX2 2153480192 01-JAN-1970 01:00:00.00
Body RtBody 30-DEC-2005 11:46:48.47
Attr ErrorSoftLimit = 15
Attr ErrorHardLimit = 50
Attr ConvMask1 = 65535
Attr ConvMask2 = 65535
Attr MaxNoOfChannels = 32
Attr Process = 1
Attr DataSheet = "$pwr_lang/dsh/ssab_di_dix2.pdf"
EndBody
Body DevBody 01-JAN-1970 01:00:00.00
EndBody
EndObject
EndObject
Object Do_HVDO32 $ClassDef 23 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr Editor = 0
Attr Method = 5
Attr Flags = 49232
EndBody
Object RtBody $ObjBodyDef 1 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr StructName = "Do_HVDO32"
Attr NextAix = "_X20"
EndBody
Object Description $Attribute 1 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "Description"
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
Object DevName $Attribute 2 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "DevName"
Attr TypeRef = "pwrs:Type-$String40"
EndBody
EndObject
Object ErrorCount $Attribute 3 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ErrorCount"
Attr Flags = 16
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ErrorSoftLimit $Attribute 4 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ErrorSoftLimit"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ErrorHardLimit $Attribute 5 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ErrorHardLimit"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object InvMask1 $Attribute 6 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "InvMask1"
Attr TypeRef = "pwrs:Type-$Mask"
EndBody
EndObject
Object InvMask2 $Attribute 7 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "InvMask2"
Attr TypeRef = "pwrs:Type-$Mask"
EndBody
EndObject
Object TestMask1 $Attribute 8 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "TestMask1"
Attr Flags = 16
Attr TypeRef = "pwrs:Type-$Mask"
EndBody
EndObject
Object TestMask2 $Attribute 9 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "TestMask2"
Attr Flags = 16
Attr TypeRef = "pwrs:Type-$Mask"
EndBody
EndObject
Object TestValue1 $Attribute 10 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "TestValue1"
Attr Flags = 16
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
Object TestValue2 $Attribute 11 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "TestValue2"
Attr Flags = 16
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
Object FixedOutValue1 $Attribute 12 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "FixedOutValue1"
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
Object FixedOutValue2 $Attribute 13 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "FixedOutValue2"
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
Object MaxNoOfChannels $Attribute 14 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "MaxNoOfChannels"
Attr Flags = 32
Attr TypeRef = "pwrs:Type-$UInt16"
EndBody
EndObject
Object RegAddress $Attribute 15 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "RegAddress"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object VectAddress $Attribute 16 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "VectAddress"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object Process $Attribute 17 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "Process"
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ThreadObject $Intern 18 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ThreadObject"
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
Object DataSheet $Attribute 19 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "DataSheet"
Attr TypeRef = "pwrs:Type-$URL"
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr NextAix = "_X2"
EndBody
Object ChannelAllocation $Attribute 1 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr PgmName = "ChannelAllocation"
Attr Flags = 1024
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
EndObject
Object AnteAdopt $DbCallBack 128 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Do_HVDO32-AnteAdopt"
EndBody
EndObject
Object PostUnadopt $DbCallBack 129 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Do_HVDO32-PostUnadopt"
EndBody
EndObject
Object PostAdopt $DbCallBack 130 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Do_HVDO32-PostAdopt"
EndBody
EndObject
Object ConfiguratorPoson $Menu 131 30-DEC-2005 11:26:36.69
Object Pointed $Menu 132 30-DEC-2005 11:26:36.69
Object Connect $MenuButton 133 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr ButtonName = "Connect PlcThread"
Attr MethodName = "$Objid-Connect"
Attr MethodArguments[0] = "ThreadObject"
Attr MethodArguments[1] = "PlcThread"
Attr FilterName = "$Objid-IsOkConnect"
Attr FilterArguments[0] = "ThreadObject"
Attr FilterArguments[1] = "PlcThread"
EndBody
EndObject
EndObject
EndObject
Object IoMethods $RtMethod 134 30-DEC-2005 11:26:36.69
Object IoCardInit $Method 135 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Do_HVDO32-IoCardInit"
EndBody
EndObject
Object IoCardClose $Method 136 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Do_HVDO32-IoCardClose"
EndBody
EndObject
Object IoCardWrite $Method 137 30-DEC-2005 11:26:36.69
Body SysBody 30-DEC-2005 11:26:36.69
Attr MethodName = "Do_HVDO32-IoCardWrite"
EndBody
EndObject
EndObject
Object Template Do_HVDO32 2153742336 01-JAN-1970 01:00:00.00
Body RtBody 30-DEC-2005 11:47:49.85
Attr ErrorSoftLimit = 15
Attr ErrorHardLimit = 50
Attr MaxNoOfChannels = 32
Attr Process = 1
Attr DataSheet = "$pwr_lang/dsh/ssab_do_hvdo32.pdf"
EndBody
Body DevBody 01-JAN-1970 01:00:00.00
EndBody
EndObject
EndObject
EndObject EndObject
EndVolume EndVolume
Volume Telemecanique $ClassVolume 0.0.250.4
Body SysBody 05-SEP-2005 17:51:40.00
Attr NextOix = "_X1"
Attr NextCix = "_X2"
EndBody
Object Class $ClassHier 1 05-SEP-2005 17:51:40.00
Object Dum2 $ClassDef 1 05-SEP-2005 17:51:40.00
Body SysBody 05-SEP-2005 17:51:40.00
Attr Editor = 0
Attr Method = 0
Attr Flags = 16
EndBody
Object RtBody $ObjBodyDef 1 05-SEP-2005 17:51:40.00
Body SysBody 05-SEP-2005 17:59:37.06
Attr StructName = "Dum2"
EndBody
EndObject
Object Template Dum2 2147975168 05-SEP-2005 17:51:40.00
Body RtBody 05-SEP-2005 17:51:40.00
EndBody
EndObject
EndObject
EndObject
EndVolume
ifndef link_rule_mk ifndef link_rule_mk
link_rule_mk := 1 link_rule_mk := 1
link = $(ldxx) $(linkflags) $(domap) -o $(export_exe) \ link = $(ldxx) $(elinkflags) $(domap) -o $(export_exe) \
$(export_obj) $(objects) $(wb_msg_objs) $(rt_msg_objs) \ $(export_obj) $(objects) $(wb_msg_objs) $(rt_msg_objs) \
$(pwr_obj)/rt_io_user.o $(pwr_obj)/wb_provider.o \ $(pwr_obj)/rt_io_user.o $(pwr_obj)/wb_provider.o \
-L/usr/X11R6/lib -L/usr/local/BerkeleyDB.4.0/lib \ -L/usr/X11R6/lib -L/usr/local/BerkeleyDB.4.0/lib \
......
ASup
DsFast
DsHist
DsTrend
DSup
PlcPgm
ProjectReg
RootVolumeConfig
SubVolumeConfig
SharedVolumeConfig
ClassVolumeConfig
ChanDi
ChanDo
ChanAi
ChanAit
ChanAo
ChanCo
ChanIi
ChanIo
Di
Do
Ai
Ao
Co
Po
Ii
Io
XttGraph
WebGraph
OpPlace
RttConfig
WebHandler
PlcProcess
PlcThread
NodeConfig
Pb_DP_Slave
/* /*
* Proview $Id: xtt_xattnav.cpp,v 1.13 2005-10-21 16:11:22 claes Exp $ * Proview $Id: xtt_xattnav.cpp,v 1.14 2005-12-30 15:47:16 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
extern "C" { extern "C" {
#include "co_cdh.h" #include "co_cdh.h"
#include "co_time.h" #include "co_time.h"
#include "rt_types.h"
#include "pwr_baseclasses.h" #include "pwr_baseclasses.h"
#include "rt_xatt_msg.h" #include "rt_xatt_msg.h"
#include "rt_mh_net.h" #include "rt_mh_net.h"
......
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