B&B Electronics ATXWDT, ATRWDT manual Appendix B QuickBASIC Example, Do While INKEY$ =

Page 22

Appendix B: QuickBASIC Example

Note: An additional test program for the WDT is available on B&B’s ftp site at ftp.bb-elec.com/bb-elec/software.

B&B Electronics Mfg. Co.

Watchdog Timer QuickBASIC Example Program

This code is an example of how the WDT is addressed from within a program. This code would be used when the TIMER RESET INPUT jumper is in the "CODE" position.

PCWDTaddress = &H300

'hex address chosen for the PCWDT

LatchValue = &H7

'hex latch value chosen, in this

 

'case about a 16 second timeout

'Main loop of your program

 

 

DO WHILE INKEY$ = ""

'repeat loop until keypressed

 

OUT PCWDTaddress, LatchValue

'This statement must be executed

 

'within the timeout period (17

 

 

'seconds for this example) or the

 

'PCWDT will reboot the computer.

X = inp(PCWDTaddress)

‘this statement reads the WDT

 

 

‘registers

 

X = X AND 31

‘This Statement masks out the 5

 

‘Least Significant bits

 

Print HEX$(X)

‘convert to hex

 

LOOP

 

 

Start = TIMER

‘start the timer

 

DO WHILE INKEY$ = ""

‘loop to print time for timeout

Print using “###.#”; (TIMER – Start):Print “ Seconds”

 

LOOP

 

 

X = inp(PCWDTaddress)

 

 

X = X AND 31

 

 

Print HEX$(X)

 

 

OUT PCWDTaddress, 0

'disable PCWDT before ending

 

END

 

 

 

 

 

Documentation Number ATxWDT-1303

Appendix B

B-1

B&B Electronics Mfg Co – 707 Dayton Rd - PO Box 1040 - Ottawa IL 61350 - Ph 815-433-5100 - Fax 815-433-5104 B&B Electronics Ltd – Westlink Comm. Pk – Oranmore, Galway, Ireland – Ph +353 91-792444 – Fax +353 91-792445

Image 22
Contents PC Watchdog Timer Card CE Table of Contents Specifications FeaturesGeneral Information Introduction Setup and Installation Inspection Address Switch SetupATRWDT/ATXWDT PCB Silk Screen Connection Decimal Address Switches S1 Position BusWeight Hex Weight 200Relay Setup InstallationConnecting the Atrwdt Motherboard Reset Option Connecting the ATX Reset Option for the Atxwdt Installing the SoftwareDocumentation Number ATxWDT-1303 Operation Communicating with the WDT Pinouts RegistersOutput Schematic Software Windows NT and WindowsDisk Caching WindowsChanging the I/O Port Address Existing DOS ProgramsParameters IoPortAddress=0x0200 IoPortCount=0x0001 BBPCWDTStartup Command ReferenceBBPCWDTShutdown BBPCWDTReset Value hex TimeoutBYTE* value BBPCWDTReadRegisterBool BBPCWDTReadRegisterHANDLE hDev As Long, value As Byte As ByteAppendix a Hardware I/O Maps SdlcMap of AT Class Machines Parallel printer on monochrome adapterAppendix B QuickBASIC Example Do While INKEY$ =Appendix C Declaration of Conformity Statement Declaration of Conformity