|
|
View previous topic :: View next topic |
Author |
Message |
123bally
Joined: 20 Jan 2013 Posts: 21
|
QEI Compile issue - Undefined identifier |
Posted: Mon Nov 17, 2014 7:41 am |
|
|
I have a new PC and since trying to compile existing projects I get output errors with undefined identifiers in ref only to QEI Functions. For example:
Executing: "C:\Program Files (x86)\PICC\Ccsc.exe" +FH "TestRig2K VBComm 19.2MHz 0.015.c" +DF +LN +T +A +M +Z +Y=9 +EA #__18F4431=TRUE
*** Error 12 "TestRig2K VBComm 19.2MHz 0.015.c" Line 449(11,12): Undefined identifier -- setup_QEI
*** Error 12 "TestRig2K VBComm 19.2MHz 0.015.c" Line 490(14,15): Undefined identifier -- qei_set_count
*** Error 12 "TestRig2K VBComm 19.2MHz 0.015.c" Line 492(24,25): Undefined identifier -- qei_get_count
*** Error 12 "TestRig2K VBComm 19.2MHz 0.015.c" Line 513(11,12): Undefined identifier -- setup_QEI
*** Error 12 "TestRig2K VBComm 19.2MHz 0.015.c" Line 686(14,15): Undefined identifier -- qei_set_count
*** Error 12 "TestRig2K VBComm 19.2MHz 0.015.c" Line 694(24,25): Undefined identifier -- qei_get_count
*** Error 12 "TestRig2K VBComm 19.2MHz 0.015.c" Line 838(11,12): Undefined identifier -- setup_QEI
*** Error 12 "TestRig2K VBComm 19.2MHz 0.015.c" Line 1355(14,15): Undefined identifier -- qei_set_count
8 Errors, 0 Warnings.
If I compile the same project on other PC's, with the same IDE and compiler versions it works fine. I thought at first it might be due to a lack of administrator privileges on the new PC but if I run as an administrator the issue remains.
MPLAB V8.90
compiler version 4.132
Windows 7
Any ideas?
Cheers Andy |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Nov 17, 2014 11:32 am |
|
|
It seems unlikely that only one function would generate an error simply
by switching to a different O/S or PC. Post a very short test program
and I'll try it on an XP and a Win7 machine. A test program with the
#include, #fuses, #use delay(), main(), and only a setup_qei() statement.
Prove that it fails, then post it. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19499
|
|
Posted: Mon Nov 17, 2014 2:15 pm |
|
|
Though it should not give the problem listed, I do worry about the file name. There was a thread a while ago, where it turned out that some internal parts of the compiler used code that was limited in handling some characters. Having three full stops and multiple spaces in the file name might be breaking this. Try with a nice simple dos compatible file name and see if the problem changes. |
|
|
123bally
Joined: 20 Jan 2013 Posts: 21
|
|
Posted: Tue Nov 18, 2014 7:46 am |
|
|
Thanks for replies,
Have changed the filename and simplified code as requested:
Output:
Executing: "C:\Program Files (x86)\PICC\Ccsc.exe" +FH "ETVelocityMode.c" #__DEBUG=1 +ICD +DF +LN +T +A +M +Z +Y=9 +EA #__18F4431=TRUE
*** Error 12 "ETVelocityMode.c" Line 32(11,12): Undefined identifier -- setup_QEI
*** Error 12 "ETVelocityMode.c" Line 39(24,25): Undefined identifier -- qei_get_count
*** Error 12 "ETVelocityMode.c" Line 40(21,22): Undefined identifier -- qei_get_count
Code:
Code: | #include <18F4431.H>
#fuses hs, NOWDT, NOBROWNOUT, PUT, NOLVP,NOMCLR
#use delay(clock = 4000000)
#USE rs232(bAUD=9600,XMIT=PIN_C6, RCV=pin_c7, BITS=8,errors)
#include "flex_lcd.c"
//*********************DEFINITIONS**************
#define Tare PIN_b0
#define Print PIN_B1
#define Alive PIN_B7
// note do note use PINS D0-D3 and Pins B4-B6 as they are reserved for ETAngleMeter-LCD driver
//*********************Variables************************************
unsigned long count,timer;
signed long position;
float angle;
INT DIRF,ext,test;
//=========================
void main()
{
setup_QEI(QEI_MODE_X4_RESET_WITH_INDX|QEI_VELOCITY_MODE_ENABLED|QEI_VELOCITY_PULSE_DIV_64);
while(true)
{
Position=qei_get_count(QEI_GET_POSITION_COUNT); //get position
COUNT=qei_get_count(QEI_GET_VELOCITY_COUNT); //get time between velocity events
Angle=Position/(float)4; // convert x4 to degrees
//count=2666666/count; //convert count to speed in rpm
printf(lcd_putc,"\f Angle: %5.2f\n",angle); // print angle position
printf(lcd_putc,"count: %lu",count); // print value from get_velocity_count
delay_ms(100); //allow LCD some responce time
}//while loop
} // end main |
Thanks for your help...
Andy |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Nov 18, 2014 11:37 pm |
|
|
I copied your posted code from above into a file and named it PCH_Test.c.
I installed vs. 4.132 on my Windows 7 (64-bit) PC. I didn't install MPLAB.
Then I clicked on the CCS compiler icon on the desktop. It opened a box
and I typed in: g:\PCH_Test.c (because the file was on a thumb drive).
It gave an error for flex_lcd.c and the lcd_putc lines, because I didn't put
that file on the thumb drive. I commented out those lines and then it
compiled OK. There was no problem with setup_qei().
Try compiling your file as I did, without using MPLAB. If it still fails, then
re-install the compiler. |
|
|
123bally
Joined: 20 Jan 2013 Posts: 21
|
QEI Compile issue- SOLVED |
Posted: Wed Nov 19, 2014 5:02 am |
|
|
Hi PCM
I followed your instructions and the compiler complained about the device not being recognised, so I reinstalled the compiler as you suggested. It then compiled fine.
I also needed to run the mplab plugin utlility again and reset the language tool suite.
So its all sorted - thanks for your help...
Andy |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|