ScriptName "FE EN_Universal für Port 2000" ScriptAuthor "dA/GS" ScriptVersion "V1.0" SetErrorHandler ( :Address ) ; SetSystemErrorHandler ( :Address2 ) ; var bDestination:byte; // Deklaration der Variablen // ------------------------- var Body: Buffer[100]; var channel: Byte; var from: Buffer[50]; var to: Buffer[50]; var subject: Buffer[50]; var server: Buffer[50]; var bcc: Buffer[50]; var cc: Buffer[50]; var pk1: Word; var ipa: Long; MoveConst (ipa, 0x00000000); var Buf: buffer[1024]; var Time: Word; MoveConst(Time, 10); var Const0: Word; MoveConst(Const0, 0); var Const3: Byte; MoveConst(Const3, 52); var Size: Word; var Errcode: Byte; var FBTXTO: Byte; MoveConst(FBTXTO, 36 ); // FbTx_Overrun var SizeNew: Word; var Nr: Byte; MoveConst(Nr, 0); var Const1: Byte; MoveConst(Const1, 1); var Mask_0F: Byte; MoveConst(Mask_0F, 15); var lDestination:long; var l0:long; moveconst (l0, 0); var btemp:byte; var wtemp:word; var wSize:word; var wSizeNew:word; var w0:word; moveconst(w0, 0); var w1:word; moveconst(w1, 1); var w2:word; moveconst(w2, 2); var w3:word; moveconst(w3, 3); var w4:word; moveconst(w4, 4); var w5:word; moveconst(w5, 5); var w6:word; moveconst(w6, 6); var w7:word; moveconst(w7, 7); var cbxE3:byte; moveconst(cbxE3, 0xE3); var wChannelCount:word; var wChannelIndex:word; MoveConst(pk1,2000); // Port 2000 MoveConst (channel, 0 ); InitFastEthernet ( channel,TCPIP_Server ,pk1,pk1,ipa) ; MoveConst (channel, 1 ); InitFastEthernet ( channel,WebServer ,pk1,pk1,ipa) ; // Not used code *************************************************************** jump :next; MoveConst (channel, 2 ); InitFastEthernet ( channel,WebServer ,pk1,pk1,ipa) ; MoveConst (channel, 3 ); InitFastEthernet ( channel,WebServer ,pk1,pk1,ipa) ; :next; // ende not used code // Einrichtung des FTP-Server // used to download html files into the flash of the UNIGATE hardware MoveConst (channel, 2 ); InitFastEthernet (channel,FTPControl) ; MoveConst (channel, 3 ); InitFastEthernet (channel,FTPData) ; // Ende Einrichtung FTP-Server // gelbe LED´s auf Basisboard ausschalten Set ( ShiftRegisterOutputType , RiseClock_RiseLoad ) ; Set ( ShiftRegisterOutputBitLength , 4 ) ; var wLED_BusState:word; moveconst (wLED_BusState, 0xFF); var bLED_BusState:byte; Convert ( wLED_BusState , Word , bLED_BusState , Byte ) ; WriteShiftRegister ( bLED_BusState ) ; // Start des Systems mit den oben eingestellten Parametern // ------------------------------------------------------- BusStart; Wait ( Bus_Active ) ; // Zyklische Hauptschleife // ======================= :CheckBus0; Get ( ReadBusState , lDestination ) ; if lDestination equal l0 then :CheckBus0; moveconst (wChannelIndex, 0); moveconst (wChannelCount, 0); moveconst (bLED_BusState, 0xFF); // erstmal wieder alle 0 setzen WriteShiftRegister ( bLED_BusState ) ; :CheckNextChannal; CopyIndexed ( w1 , lDestination , wChannelIndex , btemp , w0 ) ; if btemp equal cbxE3 then :setCh_Established; :CheckNextChannel; CalculateByte ( wChannelIndex , w1 , add , wChannelIndex ) ; if wChannelIndex less w4 then :CheckNextChannal; if wChannelCount less w4 then :CheckChannal_Ende; MoveConst (channel, 0 ); //InitFastEthernet ( channel,closed) ; :CheckChannal_Ende; jump :CheckBus0 ; :setCh_Established; CalculateByte ( wChannelCount , w1 , add , wChannelCount ) ; CalculateByte ( wChannelCount , w3 , add , wtemp ) ; // Offset für LED´s Convert ( bLED_BusState , Byte, wLED_BusState , Word ) ; CalculateByte ( wLED_BusState , wtemp , ClearBit , wLED_BusState ) ; Convert ( wLED_BusState , Word , bLED_BusState , Byte ) ; WriteShiftRegister ( bLED_BusState ) ; // show connected channels onto the LED´s jump :CheckNextChannel; jump :CheckBus0 ; :Address; Get ( errorCode , bDestination ) ; //stop; return; :Address2; Get ( systemError , bDestination ) ; //stop; return;