Delta Tau Forums
startup not working - Printable Version

+- Delta Tau Forums (http://forums.deltatau.com)
+-- Forum: Delta Tau Data Systems (http://forums.deltatau.com/forumdisplay.php?fid=1)
+--- Forum: Power PMAC (http://forums.deltatau.com/forumdisplay.php?fid=2)
+--- Thread: startup not working (/showthread.php?tid=2960)



startup not working - uno - 09-05-2019

Hello,

I have a strange problem regarding the pp_startup.txt

Since today I can not put PLC in there, which starts after powerup or $$$.
When I update the PMAC it works with the automatic launch, even if I start the PLC in question by hand.

But the autostart does not work at initial powerup or after a reset with $$$.

To be exact, it works...but gets somehow killed.
regardles of what is in the PLC (large PLCs, short one liners, commands, loops, system "....bla.out".)
Everything gets started for a brief moment and then gets killed.

I checked with counting up values. It counts up until some value and then the PLC gets killed.

Initially there were some Sys.CdTimers in it. I recognized that they did also get killed somehow (set to a large value -> still 0. But counts down from the large value when started a bit later)

Now this is a bit annoying since it did work until yesterday.

Did someone else have such a problem and has a solution/cause ?

Right now I'm thinking of making a init script in the linux part for startup as last resort. But other things short of that did not work.

Greetings,
Georg


RE: startup not working - Eric Hotchkiss - 09-09-2019

Georg, is anything true in your global status? I'm thinking maybe the save and $$$ caused an error.


RE: startup not working - uno - 09-23-2019

(09-09-2019, 02:11 PM)Eric Hotchkiss Wrote: Georg, is anything true in your global status? I'm thinking maybe the save and $$$ caused an error.

Good Morning Eric,

I've figured the problem out just before my vacation.

It was most of the part my problem, but the backgrounds are interesting perhaps for some people:

The problem was a "shutdown script" which I used, or better tried to use for uploading new versions of the project.

Since we have a problem with the PMAC getting unresponsible a lot of times during upload, I had a script in pp_disable.txt which should disable some things which I thought are responsible for this. (ISR routine, some C Programs and such).

No comes the interesting part:
This script had a timer in it to shutdown in a specific order and wait between those steps.

My idea was: pp_disable does what it does when I start the "build and download". Until everything is compiled (or at least until the new project is uploaded and started), my shutdown script will be finished and the PMAC is ready.

But the actual reaction was:
pp_disable gets called (somewhere after the files are already transfered to the pmac and some seconds before pp_startup gets called), does some stuff, and my timers are not finished yet.
In the meantime the project starts with pp_startup.

Now I think my shutdown PLC finishes or gets killed, everything gets stopped, including the startup PLC while it is in the middle of starting everything.

This does not explain the reset of Sys.CdTimers or other stuff.
But since I've removed the shutdown script and call it manually before upload, this strange behaviour is gone.

So I do not fully understand the reset at startup, but it is connected to a plc called in pp_disable, when this script does some more complex things.

Perhaps some procedure kills everything when some "old" plc is running. And I have experienced some race condition in this case where a running pp_disable part leads to a shutdown of the fresh started pp_startup stuff.

something like:
1. start of pmac
2. make project ready
3. pp_disable -> wait a moment
4. kill everything old still running and stop everything
5. pp_startup

And something leads to "5 starts before 4 finished" happens.

Sounds weird, but I can not explain it better right now, since the analysis of this problem is some weeks ago.

So anyway,
I've fixed it, and it was for the main part a "self made problem".

Greetings,
Georg


RE: startup not working - Eric Hotchkiss - 09-25-2019

Can you tell me anything about how you forced a timer into pp_disable.txt? I keep getting errors like this while attempting to recreate this situation.
Code:
Error : ( Preprocessing Error)  Prog Not Open :  on string ("while (Sys.CdTimer[3] > 0) {}")



RE: startup not working - uno - 10-01-2019

(09-25-2019, 09:32 AM)Eric Hotchkiss Wrote: Can you tell me anything about how you forced a timer into pp_disable.txt? I keep getting errors like this while attempting to recreate this situation.
Code:
Error : ( Preprocessing Error)  Prog Not Open :  on string ("while (Sys.CdTimer[3] > 0) {}")

Hello Eric,

Since we sometimes need some specific procedure in shutting down everything I've started some time ago the following procedure, since as you noticed a "timed shutdown of several steps" is not possible with pp_disable.txt alone.

I use a startup and a shutdown PLC. in pp_startup.txt I call the startup PLC with e.g. "enable plc 31"
and in pp_disable.txt I call the shutdown PLC with "enable plc 30"

Inside the shutdown PLC I disable step by step CPLCs, certain PLCs, after some time some other PLCs or UserAlgo.RtiCPLC = 0 and such stuff.

Since it is recommended to use a startup PLC in pp_startup I expected that it would also be a good procedure to use a shutdown PLC in pp_disable, too :)

Maybe this is not as intended?

Greetings,
Georg


RE: startup not working - Eric Hotchkiss - 10-04-2019

Due to the unpredictable nature of running a PLC from pp_disable, I would suggest not doing that.

Is there a reason the processes in that PLC actually need to run before the new code is downloaded and not when we startup with the new code?


RE: startup not working - uno - 10-07-2019

(10-04-2019, 01:34 PM)Eric Hotchkiss Wrote: Due to the unpredictable nature of running a PLC from pp_disable, I would suggest not doing that.

Is there a reason the processes in that PLC actually need to run before the new code is downloaded and not when we startup with the new code?

Well, this depends on the specific project.
Sometimes I need some steps to shutdown a telescope. So I got used to make a shutdown PLC. In normal operation this gets called when the user sends some shutdown signal.
While developing I call it myself, or, for convenience I thought "why not let it run automatically by pp_disable" .

But if this is a problem I can work around it, now that I know.

Thanks for this clarification :)
Georg