Jump to content
OMRON Forums

Problems downloading user written phase


shansen

Recommended Posts

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:

 

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:

 

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?

Link to comment
Share on other sites

  • Replies 7
  • Created
  • Last Reply

Top Posters In This Topic

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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:

 

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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

×
×
  • Create New...