Hallo Rolf,
in dem kleinen Programm
bekomme ich eine Fehlermeldung. Wenn ich die Abfrage des LANrxStatReg entferne ist die Meldung nicht mehr vorhanden.
Ich kann keinen Fehler erkennen. In einer ähnlichen Programmrahmen habe ich keine Probleme .
gruß
WOM
in dem kleinen Programm
Code
program HS2010_A;
{$NOSHADOW}
{ $WG} {global Warnings off}
Device = mega32, VCC=5;
Define_Fuses
Override_Fuses;
COMport = USB;
LockBits0 = [];
FuseBits0 = [BODEN, BODLEVEL];
FuseBits1 = [CKOPT];
FuseBits2 = [];
ProgMode = SPI;
Import SysTick, WatchDog, LANport,TickTimer;
From System Import LongWord, LongInt, Float;
Define
ProcClock = 16000000; {Hertz}
SysTick = 10; {msec}
WatchDog = msec2000; {presc = 7}
StackSize = $0064, iData;
FrameSize = $0064, iData;
TickTimer = Timer1;
LANport = SerPort; // SerPort, SerPort2
LANctrl = PortD,5; // RS485 driver direction
LANbaud = 38400;
LANmode = Slave; // Master, Slave
LANadr = 8; // 8, 16
LANframe = 16, iData; // 1..1024
LANcheck = ChkSum8; // ChkSum8, ChkSum16, CRC16
Implementation
{$IDATA}
{--------------------------------------------------------------}
{ Type Declarations }
type
tLANRec = record
LANstate : byte; // LAN state size and loc fixed
LANnode : byte; // rx/tx address size and loc fixed
LANlen : byte; // rx/tx frame len size and loc fixed
LANusr1 : byte; // user defined
LANusr2 : word; // user defined
LANdata : array[0..LANframe-4] of char; // user defined
end;
{--------------------------------------------------------------}
{ Var Declarations }
Var
{$NOOVRCHECK}
LANRxRec[@LANrxStatReg] : tLANRec;
{$NOOVRCHECK}
LANTxRec[@LANtxStatReg] : tLANRec;
{$IDATA}
{--------------------------------------------------------------}
{ functions }
{--------------------------------------------------------------}
{ Main Program }
begin
WatchDogStart;
LANnodeAdr:=$32; // Adresse des Moduls
EnableInts;
loop
WatchDogTrig;
if (LANrxStat)then
if LANrxStatReg = $FF then
LANrxClear;
endif:
endIf;
endloop;
end.
{$NOSHADOW}
{ $WG} {global Warnings off}
Device = mega32, VCC=5;
Define_Fuses
Override_Fuses;
COMport = USB;
LockBits0 = [];
FuseBits0 = [BODEN, BODLEVEL];
FuseBits1 = [CKOPT];
FuseBits2 = [];
ProgMode = SPI;
Import SysTick, WatchDog, LANport,TickTimer;
From System Import LongWord, LongInt, Float;
Define
ProcClock = 16000000; {Hertz}
SysTick = 10; {msec}
WatchDog = msec2000; {presc = 7}
StackSize = $0064, iData;
FrameSize = $0064, iData;
TickTimer = Timer1;
LANport = SerPort; // SerPort, SerPort2
LANctrl = PortD,5; // RS485 driver direction
LANbaud = 38400;
LANmode = Slave; // Master, Slave
LANadr = 8; // 8, 16
LANframe = 16, iData; // 1..1024
LANcheck = ChkSum8; // ChkSum8, ChkSum16, CRC16
Implementation
{$IDATA}
{--------------------------------------------------------------}
{ Type Declarations }
type
tLANRec = record
LANstate : byte; // LAN state size and loc fixed
LANnode : byte; // rx/tx address size and loc fixed
LANlen : byte; // rx/tx frame len size and loc fixed
LANusr1 : byte; // user defined
LANusr2 : word; // user defined
LANdata : array[0..LANframe-4] of char; // user defined
end;
{--------------------------------------------------------------}
{ Var Declarations }
Var
{$NOOVRCHECK}
LANRxRec[@LANrxStatReg] : tLANRec;
{$NOOVRCHECK}
LANTxRec[@LANtxStatReg] : tLANRec;
{$IDATA}
{--------------------------------------------------------------}
{ functions }
{--------------------------------------------------------------}
{ Main Program }
begin
WatchDogStart;
LANnodeAdr:=$32; // Adresse des Moduls
EnableInts;
loop
WatchDogTrig;
if (LANrxStat)then
if LANrxStatReg = $FF then
LANrxClear;
endif:
endIf;
endloop;
end.
bekomme ich eine Fehlermeldung. Wenn ich die Abfrage des LANrxStatReg entferne ist die Meldung nicht mehr vorhanden.
Code
{ Main Program }
begin
WatchDogStart;
LANnodeAdr:=$32; // Adresse des Moduls
EnableInts;
loop
WatchDogTrig;
if (LANrxStat)then
// if LANrxStatReg = $FF then
LANrxClear;
// endif:
endIf;
endloop;
end.
begin
WatchDogStart;
LANnodeAdr:=$32; // Adresse des Moduls
EnableInts;
loop
WatchDogTrig;
if (LANrxStat)then
// if LANrxStatReg = $FF then
LANrxClear;
// endif:
endIf;
endloop;
end.
Ich kann keinen Fehler erkennen. In einer ähnlichen Programmrahmen habe ich keine Probleme .
gruß
WOM