Dear support
I have written an console program for drive servo motors but it doesn"t work, I don't know why it doesn't work.
This is my application code:
=====================
This is the Error report :
==================
PowerBASIC Console Compiler
PB/CC Version 5.00
Copyright (c) 1998-2008 PowerBasic Inc.
Venice, Florida USA
All Rights Reserved
Primary source: E:\PROGRA~1\PBCC50\Samples\Graphic\SpinDisk\SPINDISK.BAS {91 total lines}
Target compilation: SPINDISK.exe
Compile time: 0.1 seconds, at 109200 lines/minute
1820 bytes compiled code, 15317 bytes RTLibrary,
100 bytes string literals, and 2124 bytes dgroup.
Executable stack size: 1048576 bytes.
Disk image: 23552 bytes Memory image: 17541 bytes.
Component Files:
----------------
E:\PROGRA~1\PBCC50\Samples\Graphic\SpinDisk\SPINDISK.BAS
==============================
Compile succeeded at 15:13:53 on 23/09/2008
PowerBASIC Console Compiler
PB/CC Version 5.00
Copyright (c) 1998-2008 PowerBasic Inc.
Venice, Florida USA
All Rights Reserved
Primary source: E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\FrmPrint.bas {106 total lines}
Target compilation: FrmPrint.exe
Compile time: 0.1 seconds, at 127200 lines/minute
1596 bytes compiled code, 23449 bytes RTLibrary,
208 bytes string literals, and 2124 bytes dgroup.
Executable stack size: 1048576 bytes.
Disk image: 31232 bytes Memory image: 25781 bytes.
Component Files:
----------------
E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\FrmPrint.bas
==============================
Compile succeeded at 15:14:05 on 23/09/2008
PowerBASIC Console Compiler
PB/CC Version 5.00
Copyright (c) 1998-2008 PowerBasic Inc.
Venice, Florida USA
All Rights Reserved
Primary source: E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_1.bas {16 total lines}
Target compilation: WaitKey_InStat_Ex_1.exe
Compile time: 0.1 seconds, at 19200 lines/minute
540 bytes compiled code, 4798 bytes RTLibrary,
16 bytes string literals, and 1892 bytes dgroup.
Executable stack size: 1048576 bytes.
Disk image: 9216 bytes Memory image: 6706 bytes.
Component Files:
----------------
E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_1.bas
==============================
Compile succeeded at 15:33:38 on 23/09/2008
PowerBASIC Console Compiler
PB/CC Version 5.00
Copyright (c) 1998-2008 PowerBasic Inc.
Venice, Florida USA
All Rights Reserved
Primary source: E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_1.bas {16 total lines}
Target compilation: WaitKey_InStat_Ex_1.exe
Compile time: 0.1 seconds, at 19200 lines/minute
540 bytes compiled code, 4798 bytes RTLibrary,
16 bytes string literals, and 1892 bytes dgroup.
Executable stack size: 1048576 bytes.
Disk image: 9216 bytes Memory image: 6706 bytes.
Component Files:
----------------
E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_1.bas
==============================
Compile succeeded at 15:33:40 on 23/09/2008
PowerBASIC Console Compiler
PB/CC Version 5.00
Copyright (c) 1998-2008 PowerBasic Inc.
Venice, Florida USA
All Rights Reserved
Primary source: E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_1.bas {16 total lines}
Target compilation: WaitKey_InStat_Ex_1.exe
Compile time: 0.1 seconds, at 19200 lines/minute
540 bytes compiled code, 4798 bytes RTLibrary,
16 bytes string literals, and 1892 bytes dgroup.
Executable stack size: 1048576 bytes.
Disk image: 9216 bytes Memory image: 6706 bytes.
Component Files:
----------------
E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_1.bas
==============================
Compile succeeded at 15:34:03 on 23/09/2008
PowerBASIC Console Compiler
PB/CC Version 5.00
Copyright (c) 1998-2008 PowerBasic Inc.
Venice, Florida USA
All Rights Reserved
Primary source: E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_2.bas {24 total lines}
Target compilation: WaitKey_InStat_Ex_2.exe
Compile time: 0.1 seconds, at 28800 lines/minute
572 bytes compiled code, 5150 bytes RTLibrary,
8 bytes string literals, and 1884 bytes dgroup.
Executable stack size: 1048576 bytes.
Disk image: 9728 bytes Memory image: 7042 bytes.
Component Files:
----------------
E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_2.bas
==============================
Compile succeeded at 15:35:18 on 23/09/2008
PowerBASIC Console Compiler
PB/CC Version 5.00
Copyright (c) 1998-2008 PowerBasic Inc.
Venice, Florida USA
All Rights Reserved
Primary source: E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_2.bas {26 total lines}
Target compilation: WaitKey_InStat_Ex_2.exe
Compile time: 0.1 seconds, at 31200 lines/minute
524 bytes compiled code, 5005 bytes RTLibrary,
8 bytes string literals, and 1884 bytes dgroup.
Executable stack size: 1048576 bytes.
Disk image: 9216 bytes Memory image: 6897 bytes.
Component Files:
----------------
E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_2.bas
==============================
Compile succeeded at 15:36:19 on 23/09/2008
PowerBASIC Console Compiler
PB/CC Version 5.00
Copyright (c) 1998-2008 PowerBasic Inc.
Venice, Florida USA
All Rights Reserved
Primary source: E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_2.bas {26 total lines}
Target compilation: WaitKey_InStat_Ex_2.exe
Compile time: 0.1 seconds, at 31200 lines/minute
524 bytes compiled code, 5005 bytes RTLibrary,
8 bytes string literals, and 1884 bytes dgroup.
Executable stack size: 1048576 bytes.
Disk image: 9216 bytes Memory image: 6897 bytes.
Component Files:
----------------
E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_2.bas
==============================
Compile succeeded at 15:36:44 on 23/09/2008
PowerBASIC Console Compiler
PB/CC Version 5.00
Copyright (c) 1998-2008 PowerBasic Inc.
Venice, Florida USA
All Rights Reserved
Primary source: E:\PROGRA~1\PBCC50\Samples\COM\Say\Say.bas {52768 total lines}
Target compilation: Say.exe
Compile time: 0.7 seconds, at 4522971 lines/minute
8769 bytes compiled code, 16888 bytes RTLibrary,
104 bytes string literals, and 4384 bytes dgroup.
Executable stack size: 1048576 bytes.
Disk image: 33280 bytes Memory image: 21376 bytes.
Component Files:
----------------
E:\PROGRA~1\PBCC50\Samples\COM\Say\Say.bas
E:\PROGRA~1\PBCC50\WINAPI\WIN32API.INC
E:\PROGRAM FILES\PBCC50\SAMPLES\COM\SAY\SAY.INC
==============================
Compile succeeded at 15:37:48 on 23/09/2008
PowerBASIC Console Compiler
PB/CC Version 5.00
Copyright (c) 1998-2008 PowerBasic Inc.
Venice, Florida USA
All Rights Reserved
Primary source: E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_1.bas {16 total lines}
Target compilation: WaitKey_InStat_Ex_1.exe
Compile time: 0.1 seconds, at 19200 lines/minute
540 bytes compiled code, 4798 bytes RTLibrary,
16 bytes string literals, and 1892 bytes dgroup.
Executable stack size: 1048576 bytes.
Disk image: 9216 bytes Memory image: 6706 bytes.
Component Files:
----------------
E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_1.bas
==============================
Compile succeeded at 15:41:27 on 23/09/2008
PowerBASIC Console Compiler
PB/CC Version 5.00
Copyright (c) 1998-2008 PowerBasic Inc.
Venice, Florida USA
All Rights Reserved
Primary source: E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_1.bas {16 total lines}
Target compilation: WaitKey_InStat_Ex_1.exe
Compile time: 0.1 seconds, at 19200 lines/minute
540 bytes compiled code, 4798 bytes RTLibrary,
16 bytes string literals, and 1892 bytes dgroup.
Executable stack size: 1048576 bytes.
Disk image: 9216 bytes Memory image: 6706 bytes.
Component Files:
----------------
E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_1.bas
==============================
Compile succeeded at 15:41:39 on 23/09/2008
File(s) not saved. Compile canceled.
PowerBASIC Console Compiler
PB/CC Version 5.00
Copyright (c) 1998-2008 PowerBasic Inc.
Venice, Florida USA
All Rights Reserved
Error 426 in E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\Auto_Servo_Drive.bas(3:018): Variable expected
Line 3: DECLARE SUB STDCALL Out32 LIB "inpout32.dll" ALIAS "OUT32" (BYVAL portID AS INTEGER, BYVAL nByte AS INTEGER)
==============================
Compile failed at 19:42:04 on 23/09/2008
Can someone help me what wrong here
Kind regards
Stephane
I have written an console program for drive servo motors but it doesn"t work, I don't know why it doesn't work.
This is my application code:
=====================
Code:
#COMPILE EXE #DIM ALL DECLARE SUB STDCALL Out32 LIB "inpout32.dll" ALIAS "OUT32" (BYVAL portID AS INTEGER, BYVAL nByte AS INTEGER) DECLARE FUNCTION STDCALL Inp32 LIB "inpout32.dll" ALIAS "INP32" (BYVAL portID AS INTEGER) AS INTEGER DECLARE FUNCTION sscanf(STRING buf, STRING format,...),INT DECLARE FUNCTION sprintf(POINTER p, POINTER p, ...), INT MACRO BA = &h2F8 '==========================================================================================================' ' Rechstreekse digitale output ' ' ' '- De RTS en CTS lijnen kunnen rechtstreeks worden aangestuurd omdat we slechts 1 commando nodig is ' '- Deze uitgangen kunnen zeer snel en nauwkeurig getimed worden als we deze koppelen aan de interne klok ' ' van de computer ' '- De klok van de PC bestaat uit een 16-bit teller die met een frequentie van 1.193182 MHz aftelt ' '- Na elke 65536 klokpulsen, dus na : fclock / 2^16 = 18.206 Hz loopt de teller over (overflow) waardoor ' ' een interrupt wordt opgewekt ' ' Deze interrupt routine wordt gebruikt voor de software teller voor het instellen van de datum en de tijd' ' Toepassing : processen op de seconde nauwkeurig ' '- De interrupts beïnvloeden de verwerkingssnelheid van de CPU ' ' ' ' Schakelklok ' ' ' '- Gebruik : OUT32 ((BA + 0x04), data_byte)) ' ' databyte = 0 ==> DTR = 0 ' ' databyte = 1 ==> DTR = 1 ' ' databyte = 2 ==> RTS = 1 ' ' IF TIME$ >= "17:00:00" THEN OUT32 ((BA + 0x04), data_byte)) ' ' Programma maken die op de achtergrond draait en de verbruikers schakelt terwijl de PC voor andere doel ' ' einden kunnen gebruiken ' ' '==========================================================================================================' FUNCTION PBMAIN () AS LONG 'Servosturing 'Hoofdprogramma DIM setup_tijd AS DOUBLE DIM ch AS STRING CALL Test() DO Sturing() LOOP UNTIL INSTAT END FUNCTION SUB Test() LOCAL high, low AS BYTE LOCAL m AS WORD ! cli OUT32 (&h43, &h34) ' TIMER 0, Mode 2 OUT32 (&h40, &h00) ' TIMER 0, low RESET OUT32 (&h40, &h00) ' TIMER 0, high RESET FOR m = 1 TO 1000 : NEXT m ' tijdsmeting OUT32 (&h43, &h04) ' TIMER 0, bevriezen low = INP32(&h40) ' TIMER 0, uitlezen high = INP32(&h40) ! sti setup_tijd = -(low + 256 * high) / 1000 PRINT USING("Cyclusduur: #####.###", setup_tijd) PRINT END SUB SUB Impulsgenerator(BYVAL impuls_width AS LONG) LOCAL on_time AS WORD LOCAL off_time AS WORD LOCAL getal AS WORD LOCAL teller AS WORD on_time = ROUND(impuls_width / setup_tijd) off_time = ROUND(10000 / setup_tijd) ! cli FOR getal = 1 TO 50 OUT32 ((BA + &h04), &h01 'DTR = 1 FOR m = 1 TO on_time : NEXT m 'impulstijd OUT32 ((BA + &h04), &h00 'DTR = 0 FOR m = 1 TO off_time : NEXT m 'pausetijd NEXT getal ! sti END SUB SUB Sturing() LOCAL n AS INTEGER FOR n = 1 TO 10 CALL ImpulsGenerator(1000 + n * 100) NEXT n END SUB
==================
PowerBASIC Console Compiler
PB/CC Version 5.00
Copyright (c) 1998-2008 PowerBasic Inc.
Venice, Florida USA
All Rights Reserved
Primary source: E:\PROGRA~1\PBCC50\Samples\Graphic\SpinDisk\SPINDISK.BAS {91 total lines}
Target compilation: SPINDISK.exe
Compile time: 0.1 seconds, at 109200 lines/minute
1820 bytes compiled code, 15317 bytes RTLibrary,
100 bytes string literals, and 2124 bytes dgroup.
Executable stack size: 1048576 bytes.
Disk image: 23552 bytes Memory image: 17541 bytes.
Component Files:
----------------
E:\PROGRA~1\PBCC50\Samples\Graphic\SpinDisk\SPINDISK.BAS
==============================
Compile succeeded at 15:13:53 on 23/09/2008
PowerBASIC Console Compiler
PB/CC Version 5.00
Copyright (c) 1998-2008 PowerBasic Inc.
Venice, Florida USA
All Rights Reserved
Primary source: E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\FrmPrint.bas {106 total lines}
Target compilation: FrmPrint.exe
Compile time: 0.1 seconds, at 127200 lines/minute
1596 bytes compiled code, 23449 bytes RTLibrary,
208 bytes string literals, and 2124 bytes dgroup.
Executable stack size: 1048576 bytes.
Disk image: 31232 bytes Memory image: 25781 bytes.
Component Files:
----------------
E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\FrmPrint.bas
==============================
Compile succeeded at 15:14:05 on 23/09/2008
PowerBASIC Console Compiler
PB/CC Version 5.00
Copyright (c) 1998-2008 PowerBasic Inc.
Venice, Florida USA
All Rights Reserved
Primary source: E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_1.bas {16 total lines}
Target compilation: WaitKey_InStat_Ex_1.exe
Compile time: 0.1 seconds, at 19200 lines/minute
540 bytes compiled code, 4798 bytes RTLibrary,
16 bytes string literals, and 1892 bytes dgroup.
Executable stack size: 1048576 bytes.
Disk image: 9216 bytes Memory image: 6706 bytes.
Component Files:
----------------
E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_1.bas
==============================
Compile succeeded at 15:33:38 on 23/09/2008
PowerBASIC Console Compiler
PB/CC Version 5.00
Copyright (c) 1998-2008 PowerBasic Inc.
Venice, Florida USA
All Rights Reserved
Primary source: E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_1.bas {16 total lines}
Target compilation: WaitKey_InStat_Ex_1.exe
Compile time: 0.1 seconds, at 19200 lines/minute
540 bytes compiled code, 4798 bytes RTLibrary,
16 bytes string literals, and 1892 bytes dgroup.
Executable stack size: 1048576 bytes.
Disk image: 9216 bytes Memory image: 6706 bytes.
Component Files:
----------------
E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_1.bas
==============================
Compile succeeded at 15:33:40 on 23/09/2008
PowerBASIC Console Compiler
PB/CC Version 5.00
Copyright (c) 1998-2008 PowerBasic Inc.
Venice, Florida USA
All Rights Reserved
Primary source: E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_1.bas {16 total lines}
Target compilation: WaitKey_InStat_Ex_1.exe
Compile time: 0.1 seconds, at 19200 lines/minute
540 bytes compiled code, 4798 bytes RTLibrary,
16 bytes string literals, and 1892 bytes dgroup.
Executable stack size: 1048576 bytes.
Disk image: 9216 bytes Memory image: 6706 bytes.
Component Files:
----------------
E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_1.bas
==============================
Compile succeeded at 15:34:03 on 23/09/2008
PowerBASIC Console Compiler
PB/CC Version 5.00
Copyright (c) 1998-2008 PowerBasic Inc.
Venice, Florida USA
All Rights Reserved
Primary source: E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_2.bas {24 total lines}
Target compilation: WaitKey_InStat_Ex_2.exe
Compile time: 0.1 seconds, at 28800 lines/minute
572 bytes compiled code, 5150 bytes RTLibrary,
8 bytes string literals, and 1884 bytes dgroup.
Executable stack size: 1048576 bytes.
Disk image: 9728 bytes Memory image: 7042 bytes.
Component Files:
----------------
E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_2.bas
==============================
Compile succeeded at 15:35:18 on 23/09/2008
PowerBASIC Console Compiler
PB/CC Version 5.00
Copyright (c) 1998-2008 PowerBasic Inc.
Venice, Florida USA
All Rights Reserved
Primary source: E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_2.bas {26 total lines}
Target compilation: WaitKey_InStat_Ex_2.exe
Compile time: 0.1 seconds, at 31200 lines/minute
524 bytes compiled code, 5005 bytes RTLibrary,
8 bytes string literals, and 1884 bytes dgroup.
Executable stack size: 1048576 bytes.
Disk image: 9216 bytes Memory image: 6897 bytes.
Component Files:
----------------
E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_2.bas
==============================
Compile succeeded at 15:36:19 on 23/09/2008
PowerBASIC Console Compiler
PB/CC Version 5.00
Copyright (c) 1998-2008 PowerBasic Inc.
Venice, Florida USA
All Rights Reserved
Primary source: E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_2.bas {26 total lines}
Target compilation: WaitKey_InStat_Ex_2.exe
Compile time: 0.1 seconds, at 31200 lines/minute
524 bytes compiled code, 5005 bytes RTLibrary,
8 bytes string literals, and 1884 bytes dgroup.
Executable stack size: 1048576 bytes.
Disk image: 9216 bytes Memory image: 6897 bytes.
Component Files:
----------------
E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_2.bas
==============================
Compile succeeded at 15:36:44 on 23/09/2008
PowerBASIC Console Compiler
PB/CC Version 5.00
Copyright (c) 1998-2008 PowerBasic Inc.
Venice, Florida USA
All Rights Reserved
Primary source: E:\PROGRA~1\PBCC50\Samples\COM\Say\Say.bas {52768 total lines}
Target compilation: Say.exe
Compile time: 0.7 seconds, at 4522971 lines/minute
8769 bytes compiled code, 16888 bytes RTLibrary,
104 bytes string literals, and 4384 bytes dgroup.
Executable stack size: 1048576 bytes.
Disk image: 33280 bytes Memory image: 21376 bytes.
Component Files:
----------------
E:\PROGRA~1\PBCC50\Samples\COM\Say\Say.bas
E:\PROGRA~1\PBCC50\WINAPI\WIN32API.INC
E:\PROGRAM FILES\PBCC50\SAMPLES\COM\SAY\SAY.INC
==============================
Compile succeeded at 15:37:48 on 23/09/2008
PowerBASIC Console Compiler
PB/CC Version 5.00
Copyright (c) 1998-2008 PowerBasic Inc.
Venice, Florida USA
All Rights Reserved
Primary source: E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_1.bas {16 total lines}
Target compilation: WaitKey_InStat_Ex_1.exe
Compile time: 0.1 seconds, at 19200 lines/minute
540 bytes compiled code, 4798 bytes RTLibrary,
16 bytes string literals, and 1892 bytes dgroup.
Executable stack size: 1048576 bytes.
Disk image: 9216 bytes Memory image: 6706 bytes.
Component Files:
----------------
E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_1.bas
==============================
Compile succeeded at 15:41:27 on 23/09/2008
PowerBASIC Console Compiler
PB/CC Version 5.00
Copyright (c) 1998-2008 PowerBasic Inc.
Venice, Florida USA
All Rights Reserved
Primary source: E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_1.bas {16 total lines}
Target compilation: WaitKey_InStat_Ex_1.exe
Compile time: 0.1 seconds, at 19200 lines/minute
540 bytes compiled code, 4798 bytes RTLibrary,
16 bytes string literals, and 1892 bytes dgroup.
Executable stack size: 1048576 bytes.
Disk image: 9216 bytes Memory image: 6706 bytes.
Component Files:
----------------
E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\WaitKey_InStat_Ex_1.bas
==============================
Compile succeeded at 15:41:39 on 23/09/2008
File(s) not saved. Compile canceled.
PowerBASIC Console Compiler
PB/CC Version 5.00
Copyright (c) 1998-2008 PowerBasic Inc.
Venice, Florida USA
All Rights Reserved
Error 426 in E:\PROGRA~1\PBCC50\Samples\Graphic\FrmPrint\Auto_Servo_Drive.bas(3:018): Variable expected
Line 3: DECLARE SUB STDCALL Out32 LIB "inpout32.dll" ALIAS "OUT32" (BYVAL portID AS INTEGER, BYVAL nByte AS INTEGER)
==============================
Compile failed at 19:42:04 on 23/09/2008
Can someone help me what wrong here
Kind regards
Stephane
Comment