C-Gate as a service ?

Discussion in 'C-Bus Toolkit and C-Gate Software' started by Phil.H, May 21, 2007.

  1. Phil.H

    Phil.H

    Joined:
    Jul 29, 2004
    Messages:
    466
    Likes Received:
    0
    Location:
    Sydney
    Hi Guys,

    What is the latest on works allowing C-Gate to be run as a windows service. Last I heard this was tied in with the OPC server efforts. Do you have an update here.

    In the meantime is there a decent workaround to get C-Gate to start auto on boot up ??? (Windows XP professional)

    Whilst on the subject (may as well use up all my 20cents worth) is there any update on the C-Gate licencing issue (parralell dongle) ??? :confused: :) ;)
     
    Phil.H, May 21, 2007
    #1
  2. Phil.H

    Richo

    Joined:
    Jul 26, 2004
    Messages:
    1,257
    Likes Received:
    0
    Location:
    Adelaide
    I'm not aware of any publically announced OPC products from CIS. I do know that the C-Gate as a service is taking a slight back seat to other current initiative and the exact timing of C-Gate being available as a service is up in the air. Don't make and specific plans for it.

    I do believe there are some applications avaliable that people on the forum have successfully used to make C-Gate run as a service. Search the forum history. I recall looking at examples awhile ago an it wasn't hard to find solutions via Google, although I never did test any of them. Try searching for "running java application as NT service" or similar combination of key words.

    Without somone logging in? Only the above meantioned solutions to running java apps as a service.

    Nothing publised yet. We are actively implementing a solution to this problem. I can't give you any time line however.
     
    Richo, May 21, 2007
    #2
  3. Phil.H

    Phil.H

    Joined:
    Jul 29, 2004
    Messages:
    466
    Likes Received:
    0
    Location:
    Sydney
    Thanks Richo, will poke around and see what I can find ;)
     
    Phil.H, May 21, 2007
    #3
  4. Phil.H

    Age

    Joined:
    Aug 3, 2004
    Messages:
    96
    Likes Received:
    0
    Location:
    Springfield
    Hi Phil,
    see this thread, for the work around (note this is for C-Gate as a server not a service) http://www.cbusforums.com/forums/showthread.php?t=1968.

    I know its for Schedule Plus but, if you create a shortcut of the cgate.jar file and place it in the same place as you would put the Schedule Plus shortcut, you will get the same effect. However C-Gate will run the server version, not the console version.

    Obviously you need to log in first for it to fire up, so a PC without a login / password set up would be ideal.


    Age
     
    Age, May 21, 2007
    #4
  5. Phil.H

    Phil.H

    Joined:
    Jul 29, 2004
    Messages:
    466
    Likes Received:
    0
    Location:
    Sydney
    Thanks Age, will add that to the options list. :)
     
    Phil.H, May 21, 2007
    #5
  6. Phil.H

    Darpa

    Joined:
    Apr 30, 2006
    Messages:
    426
    Likes Received:
    0
    Location:
    Australia
    If you are familiar with editing the windows registry, you can add any file that you want to load on startup in the following way.

    Before I go any further though... WARNING!!! If you do not know what you are doing when it comes to the Windows Registry, or have never modified it before, I would STRONGLY recommend staying well away from it. You can VERY easily cause irrepairable damage to your Operating System.

    Open Registry Editor (Go to the "RUN" option on your Start Menu, and type in "regedit" (without the quotation marks) and hit Enter or click OK)

    Browse to the following place in your registry:

    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run

    Once there, right-click on the "Run" folder you have browsed to, and then choose "New" and then "String Value"

    You will see a new Value appear in the list below all the other programs that auto-start on your computer in the window on the right. Give it an appropriate name for the program you want to start at windows startup, and then right click on this value and select "MODIFY". In the empty "Value Data" section, enter the path and filename of the program you want to start automatically, eg:
    C:\Program Files\MyProgram\Program_subdirectory\My Program.exe

    This will then cause this program to load every time the computer is booted, except when you boot in Safe Mode.

    Hope this helps,
    Darpa
     
    Darpa, May 24, 2007
    #6
  7. Phil.H

    Phil.H

    Joined:
    Jul 29, 2004
    Messages:
    466
    Likes Received:
    0
    Location:
    Sydney
    Thanks Darpa,

    I have had to poke around in the Windows Registry to fix a problem in the very buggy ACT - CRM software. I will give this a go.

    Thanks again.
     
    Phil.H, May 24, 2007
    #7
  8. Phil.H

    Richo

    Joined:
    Jul 26, 2004
    Messages:
    1,257
    Likes Received:
    0
    Location:
    Adelaide
    Richo, May 25, 2007
    #8
  9. Phil.H

    sergeroz

    Joined:
    Jun 14, 2007
    Messages:
    7
    Likes Received:
    0
    Running any application as Service!

    There's a free application, called XYNTService, that will start any process during computer boot-up, and can even re-spawn it if it the process dies (or exits).

    http://www.codeproject.com/system/xyntservice.asp

    I've used this application before; it is quite easy to configure by updating the default configuration file with required settings:
    Code:
    [Settings] 
    ServiceName = XYNTService 
    CheckProcessSeconds = 30 
    [Process0] 
    CommandLine = c:\winnt\system32\notepad.exe 
    WorkingDir= c:\ 
    PauseStart= 1000 
    PauseEnd= 1000 
    UserInterface = Yes 
    Restart = Yes 
    [Process1] 
    CommandLine = java.exe MyPackage.MyClass
    Restart = No
    UserName = 
    Domain =
    Password =
    Installation is done with 1 line: xyntservice.exe -i (to install the service).

    This method is obviously preferred to Registry \Run\ entries, which only get executed when a user is logged on. In addition, such entries run with same credentials (rights) as the logged on user, who in case of a "Touch Screen" should be as under-priviledged as possible.

    Oh, and as an added bonus, one may specify up to 127 processes to start!

    Looking forward to getting some other users' feedback on this.
     
    sergeroz, Jun 20, 2007
    #9
  10. Phil.H

    Phil.H

    Joined:
    Jul 29, 2004
    Messages:
    466
    Likes Received:
    0
    Location:
    Sydney
    Thanks Sergeroz,

    We are in the middle of engineering an "option" of high level interface to BMS based on C-Gate. We will give this a go and get back to you with our thoughts.

    Thanks again for the info :) :) :)
     
    Phil.H, Jun 21, 2007
    #10
  11. Phil.H

    Richo

    Joined:
    Jul 26, 2004
    Messages:
    1,257
    Likes Received:
    0
    Location:
    Adelaide
    You know that theoretical OPC server you mentioned in your first post would most likely run as a service and manage the c-gate instance as well as letting it run without anyone logged on ... in theory. :D
     
    Richo, Jun 21, 2007
    #11
  12. Phil.H

    Phil.H

    Joined:
    Jul 29, 2004
    Messages:
    466
    Likes Received:
    0
    Location:
    Sydney
    Hi Richo,

    I know how hard things are to do especially when they are "theoretical". In theory our guys would be happy to help test a theoritical OPC server. I have just spent two days doing up a brief for one of our engineers so he can tie some of his BMS world code to C-Gate. In theory he would be much happier tieing into OPC. Is it possible we are wasting our time trying to build something from the ground up on C-Gate alone ???

    Just to prove I am not making this up I have a question.
    For C-Gate v2.6.0 (Build 2213) Config, it appears you can't have;
    event.display-oids=yes
    hide-project-names=yes

    These two seem to be linked somehow.

    Hide the project names and you loose the oids :(

    Code:
    # lighting SyncUpdate 253/56/1 level=255 #sourceunit=-1 OID=                                                            
    # lighting SyncUpdate 253/56/3 level=219 #sourceunit=-1 OID=                                                            
    # lighting SyncUpdate 253/56/4 level=231 #sourceunit=-1 OID=                                                            
    # lighting SyncUpdate 253/56/5 level=255 #sourceunit=-1 OID=                                                            
    # lighting SyncUpdate 253/56/6 level=255 #sourceu                                                
    # lighting SyncUpdate 253/56/7 level=219 #sourceunit=-1 OID=                                                            
    # lighting SyncUpdate 253/56/8 level=207 #sourceunit=-1 OID=                                                            
    # lighting SyncUpdate //ICE/253/56/1 level=255 #sourceunit=-1 OID=e8076520-0114-                                                                                
    102a-836d-9c4ae2f3f726                      
    # lighting SyncUpdate //ICE/253/56/3 level=219 #sourceunit=-1 OID=e8409d90-0114-                                                                                
    102a-836f-9c4ae2f3f726                      
    # lighting SyncUpdate //ICE/253/56/4 level=231 #sourceunit=-1 OID=e8586b50-0114-                                                                                
    102a-8370-9c4ae2f3f726                      
    # lighting SyncUpdate //ICE/253/56/5 level=255 #sourceunit=-1 OID=e872aa10-0114-                                                                                
    102a-8371-9c4ae2f3f726                      
    # lighting SyncUpdate //ICE/253/56/6 level=255 #sourceunit=-1 OID=e88a77d0-0114-                                                                                
    102a-8372-9c4ae2f3f726                      
    # lighting SyncUpdate //ICE/253/56/7 level=219 #sourceunit=-1 OID=e89b40b0-0114-                                                                                
    102a-8373-9c4ae2f3f726                      
    # lighting SyncUpdate //ICE/253/56/8 level=207 #sourceunit=-1 OID=e8b30e70-0114-                                                                                
    102a-8374-9c4ae2f3f726                      
    # lighting SyncUpdate 253/56/1 level=255 #sourceunit=-1 OID=                                                            
    # lighting SyncUpdate 253/56/3 level=219 #sourceunit=-1 OID=                                                            
    # lighting SyncUpdate 253/56/4 level=231 #sourceunit=-1 OID=                                                          
    # lighting SyncUpdate 253/56/5 level=255 #sourceunit=-1 OID=                                                            
    # lighting SyncUpdate 253/56/6 level=255 #sourceunit=-1 OID=                                                            
    # lighting SyncUpdate 253/56/7 level=219 #sourceunit=-1 OID=                                                            
    # lighting SyncUpdate 253/56/8 level=207 #sourceunit=-1 OID=                    
    
    Grab of load change port (20025) as C-Gate models an install :)
     
    Last edited by a moderator: Jun 21, 2007
    Phil.H, Jun 21, 2007
    #12
  13. Phil.H

    daniel C-Busser Moderator

    Joined:
    Jul 26, 2004
    Messages:
    770
    Likes Received:
    21
    Location:
    Adelaide
    Hiya Phil H, thanks for that report. I have noted this in our system for investigation (#11564)
     
    daniel, Jun 21, 2007
    #13
  14. Phil.H

    Richo

    Joined:
    Jul 26, 2004
    Messages:
    1,257
    Likes Received:
    0
    Location:
    Adelaide
    Have a chat with Greg. He is the gate keeper for theoretical projects like this:D

    It can be tricky. There a pile of considerations that need to be taken into account and it can be tricky. Although the individual commands are documented and written specification on how best to interact and build clients for C-Gate doesn't really exist. The are plans to write such a document (or update the existing manual to include it).


    Most likely this is because hide-project-names is considered a "backwards" compatibility mode for C-Gate V1 clients. I would not recommend changing any configuration options in the c-gate configuration file as a general rule. Making changes for debugging (e.g. event logging) is OK, but anything else can have unforseen consequences.
     
    Richo, Jun 21, 2007
    #14
  15. Phil.H

    Phil.H

    Joined:
    Jul 29, 2004
    Messages:
    466
    Likes Received:
    0
    Location:
    Sydney
    OK ! Who are you calling backwards ?

    You are soooo right - whilst mucking around some smoke came out - now I have to work out how to get the smoke back in. :p

    I had a chat with one of our software engineers. He is happy a long as I can write a brief/doc re how / what is needed re C-Gate, BTW we are going to stick with project names and OID's so noone calls us "Backward". For commercial project integration, we do have to use the config file to start etc, a default project. We also have to be very careful to set "c-gate-smoke-release" to "no"... ;)
     
    Last edited by a moderator: Jun 21, 2007
    Phil.H, Jun 21, 2007
    #15
  16. Phil.H

    Phil.H

    Joined:
    Jul 29, 2004
    Messages:
    466
    Likes Received:
    0
    Location:
    Sydney
    Uncle Richo,

    Whilst on the subject do you recommend we set up to use full instructions to C-Gate eg
    Code:
    ramp //ICE/253/56/2 170 4
    200 OK: //ICE/253/56/2
    
    or would we be safe to cut the project id off ?
    Code:
    ramp 253/56/2 220 0
    200 OK: //ICE/253/56/2
    
    There are two issues I am thinking of 1. getting caught out with future releases of C-Gate 2. being open to getting called "backwards" ;)
     
    Phil.H, Jun 21, 2007
    #16
  17. Phil.H

    Richo

    Joined:
    Jul 26, 2004
    Messages:
    1,257
    Likes Received:
    0
    Location:
    Adelaide
    Internally we don't use the project name in individual commands, but we always ensure theat we have called PROJECT USE [projectname]
    in that command session.</projectname>
     
    Richo, Jun 22, 2007
    #17
  18. Phil.H

    Richo

    Joined:
    Jul 26, 2004
    Messages:
    1,257
    Likes Received:
    0
    Location:
    Adelaide
    yeah, those type of config options are good to use.
     
    Richo, Jun 22, 2007
    #18
  19. Phil.H

    Phil.H

    Joined:
    Jul 29, 2004
    Messages:
    466
    Likes Received:
    0
    Location:
    Sydney
    Thanks for that tip I will add it to my brief. I have noticed when starting a project manually from the command port, that things don't line up until you call "project use [projectname]"

    Just to clarify - if we set
    Code:
    project.default=[projectname]
    project.start=[projectname]
    in the C-Gate config.txt file are you saying we should also call
    project use [projectname] - in our initialise code ???

    project.default & project.start seems to get things going OK for a specific / known project ???
     
    Last edited by a moderator: Jun 22, 2007
    Phil.H, Jun 22, 2007
    #19
  20. Phil.H

    Richo

    Joined:
    Jul 26, 2004
    Messages:
    1,257
    Likes Received:
    0
    Location:
    Adelaide
    If you set project.default you probably don't need to call PROJECT USE ... but I would anyway otherwise it's too easy to break things down the line and not be sure what happened. I haven't checked if project.default works, but sounds like it should.
     
    Richo, Jun 22, 2007
    #20
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.