Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Run simulation server as (windows) service
July 21, 2015
11:39, EEST
Avatar
Thomas W.
Member
Members
Forum Posts: 7
Member Since:
April 17, 2015
sp_UserOfflineSmall Offline

Hi,

I use the the simulation server to test my client implementations. To execute those test automatically, e.g. during the build process, I need an instance of the Demo Server that is “always” available. Therefor it would be great if I could run the demo server in background as a Windows service. So far I was not able to do this. A “sc create” will create the service but it will not start properly.

Any idea?

Regards,
Thomas

July 21, 2015
11:51, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 382
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Interesting idea. You could also just keep the server window open. But anyway, for running any program as a service on windows, http://www.nssm.cc/ seems to just work. Not tested with simulation server, but might be something you want to try.

– Bjarne

July 21, 2015
11:59, EEST
Avatar
Thomas W.
Member
Members
Forum Posts: 7
Member Since:
April 17, 2015
sp_UserOfflineSmall Offline

Hi Bjarne,

Thank you for the nssm tip. With nssm I was able to install it as a windows service and run it.

Regards,
Thomas

March 28, 2019
15:31, EEST
Avatar
Dave62
Member
Members
Forum Posts: 4
Member Since:
March 15, 2019
sp_UserOfflineSmall Offline

Thomas, Bjarne,

I know this topic has not been updated since more than 5 years now but still giving it a shot :). I also configured the simulation server as a Windows Service so to keep it up and running all the time and automatically restart upon VM reboot, however when doing so the server loads the default simulators which is not what we want as we always fine tune the existing values to fit project purposes. Behavior is also the same even after configuring the local “simulation.xml” file accordingly…
Is there a way to start the server as Windows service while loading custom simulators configuration?

Thanks.

David

March 28, 2019
16:58, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 382
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

The application does store that simulation.xml file in user’s “home directory”/.prosys/SimulationServer. Do you start the service as the correct user? Additionally note that the application does write the configuration file to the disk when it shuts down, therefore if you edit it manually you must first shut down it.

April 15, 2019
13:35, EEST
Avatar
Dave62
Member
Members
Forum Posts: 4
Member Since:
March 15, 2019
sp_UserOfflineSmall Offline

Hi Bjarne/all,

I already verified that the configuration file is the latest up-to-date one containing the custom simulations, but for some reason it does not get loaded @Server startup. Worse, I discovered that the server was not properly started on a new machine where we recently installed it, even though the associated NT service (setup with nssm and LOCAL SYSTEM login user) shows as RUNNING. Now we are stuck with keeping the server running in a manual way and per-user basis.

Any idea how to resolve this issue moving forward? Seems Thomas has not been connected for a while so any experience from anyone else on this?

Thanks in advance,

David

April 16, 2019
11:43, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 382
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

The application is not exactly designed to be run as a service in the first place. It will show as (service) “Running” if it does not fail as in exiting the process. The UI would display the problem, but the application itself does not exit (because it needs to show the error in the UI). Techically the UI still “starts”, it is just not visible. This application does not have anything special support for services (e.g. compared to our ModbusServer).

Therefore could you please try first running the application as normal (without service), check that it works (and close it to save settings) and then configure the service to use the exact user that you used to run it non-service. The user must have enough permissions to make directory “.prosys” in their own home directory and read/write files and folders to that folder (if it starts normally “non-service” this should not be a problem). I’m not exactly sure how that would work with LOCAL SYSTEM account. I recommend testing e.g. with your normal user first.

Additionally there can be only one instance of the application running and the ports needed (by default 53530 and 53443) must not be used by other applications (the UI would report these problems in the status tab).

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 78

Currently Online:
15 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 89

pramanj: 86

ibrahim: 68

kapsl: 57

gjevremovic: 49

TimK: 41

Fransua33: 39

fred: 36

Rainer Versteeg: 32

peterrob45: 25

Member Stats:

Guest Posters: 0

Members: 857

Moderators: 12

Admins: 1

Forum Stats:

Groups: 3

Forums: 14

Topics: 872

Posts: 3676

Newest Members:

virgie88y3407, bennetcole, timbo, malissa6674, Markus Johansson, jonathancamp, michell9665, bqpkelvin990391, Christopher, HuMa

Moderators: Jouni Aro: 827, Otso Palonen: 32, Tuomas Hiltunen: 5, janimakela: 0, Pyry: 1, Terho: 0, Petri: 0, Bjarne Boström: 382, Heikki Tahvanainen: 402, Jukka Asikainen: 1, Teppo Uimonen: 15, Markus Johansson: 1

Administrators: admin: 0