Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problems downloading user written phase
#1
I'm trying to start writing my own user-written phase code. However, for some reason I can't download the default (blank) 'usrcode.c' and 'usrcode.h' files.

How to reproduce the issue:

1) Create a new PPmac solution
2) Right click on the project header in the solution explorer and click 'build and download all programs' (for some reason, this must be done before downloading Realtime routines, otherwise error occurs).
3) Wait until build/download process has completed successfully
4) Right click on 'Realtime Routines' folder and select 'Build and Download Realtime Routines'
5) Here is the error message I get:

Code:
Please wait while uploading Libraries from Power Pmac.
Libraries Uploaded successfully
Please wait while mapping Power PMAC variables.
End of syncing the database.
PMAC variables are mapped successfully.
        Build Process For capp1.out has started.
Downloading pp_proj.ini to Power Pmac.
Could not download pp_proj.ini to Power Pmac.

Another interesting note, if I right click on the 'usrcode.c' and 'usrcode.h' files in the solution explorer and select 'Properties', both have the build action set to 'Content'. If I change these from 'Content' to 'Compile', I get a different error message:

Code:
Please wait while uploading Libraries from Power Pmac.
Libraries Uploaded successfully
Please wait while mapping Power PMAC variables.
End of syncing the database.
PMAC variables are mapped successfully.
        Build Process For usralgo.ko has ended.

        Build Process For capp1.out has started.
        Build Process For usralgo.so has started.
C:\Users\Steven\Documents\PowerPmacSuite\PowerPmac1\PowerPmac1\C Language\Realtime Routines\usrcode.c(20,0): Error :  usrcode.h
Done building project "PowerPmac1.ppproj" -- FAILED.

Build FAILED.
Build process failed during the Realtime Routines build and download.

I am using the latest IDE (1.3.0.20) on Windows 7 x64 and firmware (1.3.0.0). Any thoughts?
Reply
#2
Leave usrcode.h as "Content" but you can change usrcode.c to "Compile." Does that fix it?
Reply
#3
(07-15-2011, 12:18 PM)CharlesP Wrote: Leave usrcode.h as "Content" but you can change usrcode.c to "Compile." Does that fix it?

I tried usrcode.h set to "Content" and usrcode.c set to "Compile" and I'm still getting the "Could not download pp_proj.ini to Power Pmac" error.
Reply
#4
I tried the steps you listed, but I cannot reproduce the problem. I recommend you issue a $$$*** command, right click on the solution and "Clean" the build, and then click on "Build and Download All Programs" again.
Reply
#5
(07-15-2011, 12:44 PM)CharlesP Wrote: I tried the steps you listed, but I cannot reproduce the problem. I recommend you issue a $$$*** command, right click on the solution and "Clean" the build, and then click on "Build and Download All Programs" again.

I did a "$$$***", cleaned the solution, and then built and downloaded all programs. When I build and download the entire solution, it succeeds every time, no problem.

However, when I right click on the 'Realtime Routines' folder and select 'Build and Download Realtime Routines', it gives me the error about downloading pp_proj.ini.
Reply
#6
Let me add a little more context to this problem:

I thought the above error message was the reason my user_phase wasn't running. However, it appears that if I download and build the entire solution, the user_phase gets downloaded with it. So the problem above is something else entirely.

Here is what I am trying to run in my user_phase code:

Code:
void user_phase(struct MotorData *Mptr)
{
    pshm->P[0] = 10;
}

When I right click on 'Realtime Routines' and assign user_phase to User Phase 1, P0 doesn't change to 10 (even after I have built and downloaded the project).

I have also tried setting Motor[1].PhaseCtrl = 1.

When I go into the 'Phase' tab of the task manager, it says 'User written code library NOT ACTIVE' at the top.

Does that give any insight into this problem?
Reply
#7
OK, I have narrowed down the problem.

For whatever reason, Motor[1].UserPhase is set to 0, and I think that is the reason that the phase code is not running.

I have looked over the documentation but I can't find any reference to this parameter at all. I have tried setting it to 1,2,etc. but I get a 'Struct Write Data Error'.

Any thoughts?
Reply
#8
It may be that the compiler performs some special exporting of the user phase symbols only when you build and download all programs, and not when you just click Build and Download Realtime Routines. I'll have one of our Software Engineers take a look at the post and see what he thinks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)