EL code to shutdown Multicharts

Questions about MultiCharts and user contributed studies.
Erik Pepping
Posts: 67
Joined: 25 Aug 2007
Been thanked: 4 times

EL code to shutdown Multicharts

Postby Erik Pepping » 05 May 2009

I have mutlicharts running until my computer shuts down at 2215 every day.
The shutdown is done with a windows task. However every time i start up multicharts after says the database has a problem and needs to recover.

Is there a possibility to shutdown Multicharts from EL code ?
Why does multicharts not listen to a windows shutdown event and shuts down gracefully by itself?

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Re: EL code to shutdown Multicharts

Postby Marina Pashkova » 08 May 2009

I have mutlicharts running until my computer shuts down at 2215 every day.
The shutdown is done with a windows task. However every time i start up multicharts after says the database has a problem and needs to recover.

Is there a possibility to shutdown Multicharts from EL code ?
Why does multicharts not listen to a windows shutdown event and shuts down gracefully by itself?


Hi Erik,

Data collected during an MC session is flushed into the database when the program is closed which takes time; the tsServer.exe process remains active until all the data is saved and compressed in the database.

When Windows is preparing to shut down, each process is allocated a limited amount of time to terminate. If the process is not terminated within the allocated period of time, Windows forces it to shut down. This is what happens to tsServer.exe; as a result the data is not saved and you are asked if you want to save this data when you re-start the program next time. Unfortunately, there is nothing we can do here.

drwar
Posts: 218
Joined: 31 Jul 2005

Re: EL code to shutdown Multicharts

Postby drwar » 08 May 2009

[quote]I have mutlicharts running until my computer shuts down at 2215 every day.
The shutdown is done with a windows task. However every time i start up multicharts after says the database has a problem and needs to recover.

Is there a possibility to shutdown Multicharts from EL code ?
Why does multicharts not listen to a windows shutdown event and shuts down gracefully by itself?[/quote]

Write a macro, and set it to run by the task schedular to Shutdown multicharts and then have it wait for tsserver to close. After it closes the macro can shut down windows.

J~


Return to “MultiCharts”