Jump to content
OMRON Forums

Recommended Posts

Posted

Even if I delete every statement but the comment header (from the original) I get an error. It complains of an "Illegal Command" and then prints out the first line of the block comment on line 1. Could it be a EOL character thing? There is nothing else in the file!

 

[Edit] If I take every line out of the plc_initialize script, except the open and close calls, it complains of a parameter error in the open call. Something has to be configured incorrectly. It is driving me nuts!

 

[Edit] So the parameter error is the plc name. If I do 'open plc 0' I do not get a parameter error. It seems the translation from string plc names to numbers is not occurring. Is there a special build and/or download sequence to make the translation work? Is there a flag that turns this feature on and off?

  • Replies 14
  • Created
  • Last Reply

Top Posters In This Topic

Posted

Did you see these errors on build and download?

 

If I take every line out of the plc_initialize script, except the open and close calls, it complains of a parameter error in the open call.

Maybe you are using the same name for a variable and this PLC? That can be an issue.

Can you show these open and close lines? This is what I would expect. I like to add PLC to the end of PLC names in case variables or motion programs have similar names.

 

OPEN PLC InitializePLC
CLOSE

Posted

The parameter error is the string in

 

open plc InitializePlc

 

For some reason the automagical translation from plc name to number is not happening. Is there a flag that turns this on and off? Or a special build or download sequence?

 

I get no errors building or downloading, only when I startup NC16 and it tries to pull and run the initialization script. Maybe the startup plc file defined in nc16 has some restrictions with the name substitutes?

 

Also the open and close lines look just like your example.

 

TIA

 

[Edit] Maybe I should be telling NC16 to run the script that is on the PMAC instead of the script in the file system of the computer running the IDE? Not sure how to do that ...

Posted

I believe the main issue was in the other thread that is now deleted. I just answered this one first because I thought it was a build and download issue. For not being able to connect from NC 16...

 

This is a known issue. The FunctionPlc has a timer that is too short. Open the "ppnc_function.plc" within the IDE project. I am attaching a screenshot. Scroll down to the first if statement. It should look like the code box below.

 

// -------------------- Handshake GUI Initialize Bit - Login --------------
if (CommandReg == UI_Initialize)
{
CommandReg = UI_None
// Send Initialized Handshake - Dwell 100 msec for slower PC's
call timer(0.1)
send1 "Initialized"
}

 

Change the timer to 1 to 2 seconds. You will have to $$$***, SAVE, $$$, Build and Download, SAVE, $$$ and reconnect with the NC software after making this change.

ncfile.png.394ae47deba3f1a2792c78a423388fa9.png

Posted

Thanks so much for trying to help us get this thing running. I changed that timer and tried it to no avail. I actually found that suggestion elsewhere and had already tried it and just tried it again. I'm an advanced user of Linux and a C/C++ real-time software developer. I'm pretty sure I got it right.

 

My problem is that the initialize plc script is having trouble being executed. The script names are not being parsed. If I change ...

 

open plc InitializePlc

close

 

to

 

open plc 14

close

 

... we get no errors. For some reason the conversion from script names to script numbers is not happening automatically. I can see the translations in pp_prog.sym in the Database folder but they are not happening automagically.

 

Any ideas?

Posted

It would help to see the errors.

 

It may be that your project has conflicting PLC names and numbers. If a named PLC is downloaded before a numbered PLC, it may take that number and cause an error.

 

All the files in the "PLC Programs" folder are downloaded in the order they are displayed. This used to be alphabetic, but in newer versions of the IDE the user can move files up and down to change the download order. To do so, select the file and right click to see "move up" and "move down" with shortcuts like in the attachment.

 

If the first file download contains "OPEN PLC 1" and the second contains "OPEN PLC InitializePlc", then InitializePlc with be PLC 2.

 

If the first file downloaded contains "OPEN PLC InitializePlc" nd the second contains "OPEN PLC 1", you will get an error because the number is already taken by that point in the dowload.

movefile.png.ce7c125ff7d7df05dd981cb8ef1a7490.png

Posted
Thanks and I'll look into the sequence numbers and post the error. They are in the Database folder, pp_progs.sym sound correct?
  • 3 weeks later...
Posted

My plc scripts were not enumerated correctly. I fixed that. I can run the InitializePlc script from the task manager and things seem to come up normally. But I get an error when that script is loaded automagically when I start NC16. I get no erors when building and downloading. These are my alarms after NC16 starts:

 

-------------------------------------------

Error: CS Status: Not homed.

Error: Power PMAC File Download Error: "C:\Users\DOS\Documents\PowerPMAC IDE\PowerPMAC0828\PowerPMAC0828\PMAC Script Language\PLC Programs\ppnc_initialize.plc" /var/ftp/gather/ppnc_initialize.plc:0:2: error #20: ILLEGAL CMD: /***********************************************************************************/

root@192.168.0.200:/opt/ppmac#

----------------

 

I tried loading from a simpler path with no spaces but no joy.

 

 

Any more ideas?

 

TIA

Posted

TIA, I have encountered similar problems. Obviously there is nothing wrong with the program, but the download is a problem.

I suggest entering "$$$***" in the terminal window and then save. Turn off power pmac, wait a minute and restart.

-------------------------------------------

Error: CS Status: Not homed.

 

Ppnc_csparameters.pmh in the Global includes folder of ppnc.

-------------------------------------------

// All Motors Required to be Home Before Running Program

Coord[1].HomeRequired = 1

-------------------------------------------

Modify it to Coord[1].HomeRequired =0. This error will disappear. The function has changed. When running the program, the motor/axis do not need to return to zero. If your equipment is a machine tool, this setting is not recommended. (I need to confirm that you have added "enable plc InitializePlc;" in the pp_startup.txt file in the Configuration folder. This is very important.)

 

Other mistakes that make you crazy, enter "$$$***", I believe the problem will be solved next time you turn it on (you are lucky enough). Otherwise, just create a new project, and that's how I solved the problem. The Power series is indeed not as stable as the TURBO series, and some errors always make me confused. Need more time to perfect.

Posted

Eric - it is pretty much the default setup. It is kinda simple. It controls a precision lathe, a "diamond turning" machine. We use the PMAC mostly for the resolution from our laser encoders. The only significant change is that motors 1 and 2 run axis X and Z, kinda typical for a lathe.

 

It does download the script just seems to be using a different parser than when running plc scripts from local storage. It does not like /***/ style comment lines ,only // style comments. And it does not like plc script names, only numbers.

Posted

So when I put "enable plc InitializePlc" in pp_startup.txt it runs properly. I removed the option in NC16 to run a script on startup. I think if one loaded a plc script there the parsing capabilities are pretty limited.

 

Setting "Coord[1].HomeRequired =0" did not seem to help. It read "Coord[1].HomeRequired =1" but was commented out anyways.

 

Now I'm working on things in the IDE where X and Z are the only two axis. There are some buttons in NC16 that use Y axis constants no matter the axis labels.

Posted

Thanks Eric! I got in touch with somebody at Delta Tau that said that initialization file option is really only meant for use by folks who are building NC16 from source.

 

I put my initialization file in pp_startup.txt as you suggested and all is well.

 

Either doing 'Home' from the Manual dialog or doing a 'Reset' clears the alarm.

Guest
This topic is now closed to further replies.

×
×
  • Create New...