[Oberon] HELP with array of object and how to acess them???
Fernando Passold
fpassold at das.ufsc.br
Tue Aug 12 22:04:34 CEST 2003
Hello people,
I am using:
Oberon System 3 for WindowsTM
Win32 2.3 (25.2.1999) on Windows NT 5.0 (Win2000)
TFTPd Threaded/rb, dd/ 7.4.99
XOClient v1.0.2 /rb/ 7.4.99
XO/Client handler started.
TFTPd Started
System.ChangeDirectory D:/users/passold/XOberon3Teste
XO/2 PowerPC Browser, running on Intel /rb/ Q1 2000
XO/2 PowerPC Cross-Compiler, running on Intel /rb/ Q1 2000 / rev4c
Oberon Portable Compiler / nw & rc
PowerPC Code Generator / MB, tk 7.8.95
Mutator and Fixes / rb 23.2.00
That means, I compile the Modules on a PC due a cross-compiler
and then download de "packet" to the host machine (equiped
with Mottoral Power PC).
My problems is with this "enigmatic" run-time error mesage:
XO> NeuralTool.InitRedeJointPosControl ~
[BEGIN | EXCEPTION]
- Trap kind: Stream not Open (26) <---- What does it mean??????? And
where???
- Task Entry: TelnetServer.SessionHandler.Run
- Task Id: 11
- Task Status: Halted
- Trapped Procedure Frame: Modules.ReadStringCompressed
- Current Instruction Pointer: 0003958CH
- Relative PC: 124
- Stack Dump Follows:
:
Tasks.Terminate PC: 48240
[END | EXCEPTION]
And the system simple hangs!!! I lost completellly the controll
of the host system even the communication!
Even using the option: "XCompile.Compile *\Nnf" after I have
selected one of the PC's indicated above I could not find what
causes this crash -> these PC numbers points to nonsense
parts of the module that crashes the system (NeuralTool.Mod).
I have noticed that this problem occours when I tried do access
data from any position of an ARRAY of Object (XO/2 handles
ARRAY object in a special way?), that I have declarated in
another module compiled as indicated above:
--------------------
Robot.Mod:
IMPORT
MathL, Peripherals, Tasks, MathLib, GetPeripherals, JR3, Texts, Neural,
RBF, Sliding, Force;
:
VAR
vers*: ARRAY 60 OF CHAR;
net*: ARRAY 3 OF Neural.NeuralNet;
rbf*: ARRAY 3 OF RBF.rbfNet;
:
---------
where "net" was declarated in Neural.Mod:
---------
MODULE Neural;
IMPORT Texts,MathL, MathLib, RandomNumbers;
CONST
MAXPEs* = 20;
TYPE
:
NeuralNet*= POINTER TO NeuralNetDesc;
NeuralNetDesc = RECORD;
L*: LONGINT;
FaixaIniW*, FaixaIniBias*, Bias*: LONGREAL;
m*: ARRAY 4 OF LONGINT;
x*: ARRAY MAXPEs OF LONGREAL;
:
END;
----------
and "rbf" was declarated in RBF.Mod:
----------
MODULE RBF;
IMPORT Texts, MathL, MathLib, RandomNumbers;
TYPE
classeDesc* = RECORD;
junta*: ARRAY 4 OF juntaDesc;
END;
PhiDesc* = ARRAY 180 OF LONGREAL;
pesosDesc*= ARRAY 180 OF ARRAY 4 OF LONGREAL;
rbfNet* = POINTER TO rbfDesc;
rbfDesc* = RECORD;
classes*, funcoes*: LONGINT;
classe*: ARRAY 5 OF classeDesc;
Phi*: PhiDesc;
:
END
----------
These array of objects was initialized using "InitObject" method:
----------
MODULE Robot;
IMPORT
MathL, Peripherals, Tasks, MathLib, GetPeripherals, JR3, Texts, Neural,
RBF, Sliding, Force;
:
VAR
vers*: ARRAY 60 OF CHAR;
net*: ARRAY 3 OF Neural.NeuralNet;
rbf*: ARRAY 3 OF RBF.rbfNet;
:
PROCEDURE (robot: Robot) InitObject*(): LONGINT;
VAR ok: BOOLEAN; i: LONGINT; w: Texts.Writer;
CONST k= 0.025/2.0/MathL.pi;
BEGIN
Texts.OpenWriter(w);
:
FOR i:= 0 TO 2 DO
IF net[i] = NIL THEN NEW(net[i]); END;
IF net[i] # NIL THEN
Texts.WriteString(w,'Instanciado MLP['); Texts.WriteInt(w, i, 1);
Texts.WriteString(w,'].. Ok'); Texts.WriteLn(w);
END;
IF rbf[i] = NIL THEN NEW(rbf[i]); END;
IF rbf[i] # NIL THEN
Texts.WriteString(w,'Instanciado RBF['); Texts.WriteInt(w, i, 1);
Texts.WriteString(w,'].. Ok'); Texts.WriteLn(w);
END;
END;
:
END InitObject;
-----------------
When it is ran "robot.InitObject" follows these messagens in the
screen (Log window):
-----------------
:
Instanciado MLP[0].. Ok
Instanciado RBF[0].. Ok
Instanciado MLP[1].. Ok
Instanciado RBF[1].. Ok
Instanciado MLP[2].. Ok
Instanciado RBF[2].. Ok
:O) Robot object succesfully created
:
-----------------
And the initial part of "NeuralTool.InitRedeJointPosControl" is:
-----------------
PROCEDURE InitRedeJointPosControl*;
VAR w: Texts.Writer; PEs: ARRAY 4 OF LONGINT;
BEGIN
Texts.OpenWriter(w);
Texts.WriteString(w,'Initializing a neural network for joint position
controll...');
IF Robot.net[0] = NIL THEN
NEW(Robot.net[0]);
Texts.WriteString(w, ' Brad New Network object');
END;
Texts.WriteLn(w);
PEs[0]:=12; PEs[1]:=8; PEs[2]:=5; PEs[3]:=4;
Robot.net[0].CriaRede (4, PEs, 0.05, 0.005, -1.0);
Robot.net[0].Lr:=0.02;
Robot.net[0].TaxaLr:=0;
Robot.net[0].Mom:=0.5;
Robot.net[0].TaxaMom:=0;
Robot.net[0].CodigoPacoteEntrada:= 1;
END InitRedeJointPosControl;
-----------
Could anyone give me a suggestion about what causes this problem!?
I really want to use an array of object related to neural netwrosk
because I need to run until 2 net at the same time in XO/2.
thanks in advance,
Fernando Passold
PhD Student in E.Eng.
Lab. of Industrial Automation
Dept. of Automation Systems
Federal University of Santa Catarina
BRAZIL
ICQ: 171216144
^^
^^ .. ..
[] []
.:[]:_ ^^ ,:[]:.
.: :[]: :-. ,-: :[]: :.
.: : :[]: : :`._ ,.': : :[]: : :.
.: : : :[]: : : : :-._ _,-: : : : :[]: : : :.
_..: : : : :[]: : : : : : :-._________.-: : : : : : :[]: : : : :-._
_:_:_:_:_:_:[]:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:[]:_:_:_:_:_:_
!!!!!!!!!!!![]!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!![]!!!!!!!!!!!!!
^^^^^^^^^^^^[]^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^[]^^^^^^^^^^^^^
[] []
[] []
[] []
~~^-~^_~^~/ \~^-~^~_~^-~_^~-^~_^~~-^~_~^~-~_~-^~_^/ \~^-~_~^-~~-
~ _~~- ~^-^~-^~~- ^~_^-^~~_ -~^_ -~_-~~^- _~~_~-^_ ~^-^~~-_^-~ ~^
~ ^- _~~_- ~~ _ ~ ^~ - ~~^ _ - ^~- ~ _ ~~^ - ~_ - ~^_~
~- ^_ ~^ - ^~ _ - ~^~ _ _~^~- _ ~~^ - _ ~ - _ ~~^ -
~^ -_ ~^^ -_ ~ _ - _ ~^~- _~ -_ ~- _ ~^ _ - ~ ^-
~^~ - _ ^ - ~~~ _ - _ ~-^ ~ __- ~_ - ~ ~^_-
~ ~- ^~ - ~^ - ~ ^~ - ~~ ^~ - ~
More information about the Oberon
mailing list