View unanswered posts | View active topics It is currently Tue Sep 02, 2014 1:18 pm






Reply to topic  [ 4 posts ] 
Error Message-Code generation not performed... 
Author Message
Rookie

Joined: Thu Aug 08, 2013 8:03 am
Posts: 2
Post Error Message-Code generation not performed...
Hello, I am getting the following error message.

"Code generation not performed. Errors during compilation."

These are the basic steps I am going through that gives me this error message.

1.Start ROBOTC.
2.Click on file.
3.Select my program named "Drive Teleop.c" (It is listed under my file menu because it is the most recent program.)
4.The program loads but immediately I get the error message above.

What I understand about this error message is that when I get it, it should also be identifying lines where RobotC has identified an error by displaying Xs at the beginning a line of code. Currently, this error is not doing that so I can't figure out what is wrong.

I re-wrote my script and titled it Drive Teleop - troubleshoot.c because I believe the program previously worked. Attached is the .c file I am currently using.

Any help to resolve this error would be greatly appreciated.
Thanks


Attachments:
Drive Teleop - troubleshoot.c [1.78 KiB]
Downloaded 211 times
Thu Aug 08, 2013 8:13 am
Profile
Professor
User avatar

Joined: Sat May 18, 2013 1:24 pm
Posts: 272
Location: Olympia, WA
Post Re: Error Message-Code generation not performed...
Ok. The error messages are there, but they are in a different file :) Try double-clicking on them. Of course, this won't help you...

When you `#include` a file, it literally gets copied and pasted into your code, in place of where your `#include` line is located. "JoystickDriver.c" has a bunch of function definitions in it, and when you smack them right in the middle of `task main()`, RobotC freaks out. So usually files/headers are `#include`d at the very beginning of a file. This won't work in RobotC, because the `#pragma config(...)` statements need to be at the top of the file; but placing the `#include`s right after that will work too. Try this:


Attachments:
Drive Teleop - troubleshoot.c [1.79 KiB]
Downloaded 207 times

_________________
FTC Team 6424, the 'Oly Cow - Chief programmer.
FRC Team 4450, Olympia Robotics Federation (ORF).

and also quadrotors. Quadrotors!
Thu Aug 08, 2013 9:45 am
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: Error Message-Code generation not performed...
This won't work either. If I understand the intention of your code correctly. Try this:
Code:
#pragma config(Hubs,  S4, HTMotor,  HTMotor,  HTServo,  none)
#pragma config(Sensor, S4,     ,               sensorI2CMuxController)
#pragma config(Motor,  mtr_S4_C1_1,     motorD,        tmotorTetrix, openLoop, reversed)
#pragma config(Motor,  mtr_S4_C1_2,     motorE,        tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_S4_C2_1,     motorF,        tmotorTetrix, openLoop, reversed)
#pragma config(Motor,  mtr_S4_C2_2,     motorG,        tmotorTetrix, openLoop)
#pragma config(Servo,  srvo_S4_C3_1,    servo1,               tServoContinuousRotation)
#pragma config(Servo,  srvo_S4_C3_2,    servo2,               tServoStandard)
#pragma config(Servo,  srvo_S4_C3_3,    servo3,               tServoNone)
#pragma config(Servo,  srvo_S4_C3_4,    servo4,               tServoNone)
#pragma config(Servo,  srvo_S4_C3_5,    servo5,               tServoNone)
#pragma config(Servo,  srvo_S4_C3_6,    servo6,               tServoNone)

#include "JoystickDriver.c"

task main ()
{
    int threshold = 15;

    while (true)
    {
        getJoystickSettings(joystick);

        if(abs(joystick.joy1_y1) > threshold)
        {
            motor[motorE] = joystick.joy1_y1;
        }
        else
        {
            motor[motorE] = 0;
        }

        if(abs(joystick.joy1_y2) > threshold)
        {
            motor[motorD] = joystick.joy1_y2;
        }
        else
        {
            motor[motorD] = 0;
        }

        if(abs(joystick.joy2_y1) > threshold)
        {
            motor[motorG] = joystick.joy2_y1/1.5;
        }
        else
        {
            motor[motorG] = 0;
        }

        if(abs(joystick.joy2_y2) > threshold)
        {
            motor[motorF] = joystick.joy2_y2/1.5;
        }
        else
        {
            motor[motorF] = 0;
        }

        if(joy2Btn(3)==1)
        {
            servo[servo2]=255;
        }
        else
        {
            servo[servo2]=221;
        }

        if(joy2Btn(5)==1)
        {
            servo[servo1]=200;
        }
        else
        {
            servo[servo1]=128;
        }

        if(joy2Btn(7)==1)
        {
            servo[servo1]=0;
        }
    }
}

Now, there is still a potential problem with your servo code assuming your servos are 180-degree servos. The code as is will set servo2 to approx. 180 degrees when button 3 is pressed. When button 3 is released it will return to approx. 156 degrees. Is the behavior your real intention? Servo1 is a little more troubling. When button 5 is pressed, servo1 will be set to approx. 141 degrees and to approx. 90 degrees when released. But when button 7 is pressed, servo1 will go to approx. 0 degree and will go back to approx. 90 degrees when released. What if you are pressing both buttons 5 and 7 together?


Thu Aug 08, 2013 4:44 pm
Profile
Rookie

Joined: Thu Aug 08, 2013 8:03 am
Posts: 2
Post Re: Error Message-Code generation not performed...
Ernest3.14

Thank you for your input. I uploaded the code you sent and it worked. Your explanation also allowed me to correct the original Drive Teleop program. I really appreciate your quick response.

MHTS

Thank you also for your suggestion. I am not the team programer. I am the coach. And the team programmer was away on a boy scout camping trip. He will be back tomorrow and I can ask him to review your post. It is entirely possible I was using the wrong program to begin with. But I learned a lot by troubleshooting this piece of code.

Again, than you both.


Thu Aug 08, 2013 10:32 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


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 post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.