Showing results 1 to 10 of 10

Thread: Start Program Transfer Parameter

  1. #1
    whitetaru Gast

    Default Start Program Transfer Parameter

    Hi,

    How do i grab the name OR properties of the object that my mouse is pointing to and transfer the name or properties as parameters to "Start Program" dialog box?

    eg, I created a button, right-clicked it to pop out a context menu and select a menu item.

    This menu item is actually a function that "start program" and pass the parameter to the program.

    Warmest Regards
    Whitetaru

  2. #2

    Default Re: Start Program Transfer Parameter

    there are a few actions in the zenon kontextmenu that can be context specific.

    For example opening the help (.chm file with chapter.htm) can be context specific. The button has a property for the help file and help chapter. When you open the help via the context menu, the help file and chapter from the button can be used. Alternatively you can also explicitely link a help chapter and help file at the context menu entry.

    Also set value in the context menu can optionally set a value variable linked to the element on which the context menu was called. However the context menu also allows to explicitely select a variable for an entry, which has then no relevance to the context anymore, and is identical everywhere where this context menu is used.

    Further context specific actions are "command processing" in the zenon energy edition, acknowledge alarms, and flash acknowledge.

    You can call a function in the context menu, or execute a VBA macro, but neither are not context specific, and you don't have a parameter at the function or in the VBA macro of the object you clicked on.

    But perhaps you can explain a bit more in detail, what exactly you want to achieve. For example what external program you want to start, and why this needs a parameter of the object itself. There may be other ways of doing what you want.

  3. #3
    whitetaru Gast

    Default Re: Start Program Transfer Parameter

    Quote Originally Posted by markclemens View Post
    there are a few actions in the zenon kontextmenu that can be context specific.

    For example opening the help (.chm file with chapter.htm) can be context specific. The button has a property for the help file and help chapter. When you open the help via the context menu, the help file and chapter from the button can be used. Alternatively you can also explicitely link a help chapter and help file at the context menu entry.

    Also set value in the context menu can optionally set a value variable linked to the element on which the context menu was called. However the context menu also allows to explicitely select a variable for an entry, which has then no relevance to the context anymore, and is identical everywhere where this context menu is used.

    Further context specific actions are "command processing" in the zenon energy edition, acknowledge alarms, and flash acknowledge.

    You can call a function in the context menu, or execute a VBA macro, but neither are not context specific, and you don't have a parameter at the function or in the VBA macro of the object you clicked on.

    But perhaps you can explain a bit more in detail, what exactly you want to achieve. For example what external program you want to start, and why this needs a parameter of the object itself. There may be other ways of doing what you want.
    Oh hi, thanks for the great information. Well, what i intend to do it to right-click an icon button and select the "ping" command from the context menu and the name of the icon as parameter. So once the dos command is started, it will immediately open the a dos command and ping the name of the icon.

    Alernatively, i can create a dos batch file instead, in the batch file, i will put:

    eg
    C:\windows\system32\cmd.exe /C "192.168.1.36"

    so that

    C:\windows\system32\cmd.exe /C --------------is the "start program"
    "192.168.1.36" ----------------- parameter OR name of the icon.

  4. #4

    Default Re: Start Program Transfer Parameter

    how many ping buttons do you have?

    If there are only a few, I would just create a start program function with the correct parameter for each ping button, then a context menu for each ping button, and link the correct function at the context menu and the correct context menu at the button.

    Please note, that the SNMP driver is able to monitor your network, and can autmatically check the ping status of devices.

  5. #5
    whitetaru Gast

    Default Re: Start Program Transfer Parameter

    Quote Originally Posted by markclemens View Post
    how many ping buttons do you have?

    If there are only a few, I would just create a start program function with the correct parameter for each ping button, then a context menu for each ping button, and link the correct function at the context menu and the correct context menu at the button.

    Please note, that the SNMP driver is able to monitor your network, and can autmatically check the ping status of devices.
    Hi markclemens,

    Thanks for the reply. Well, ping is just an example, "telnet" command is another function too.
    I would have to create around slightly over 500 nodes in the end.

  6. #6
    whitetaru Gast

    Default Re: Start Program Transfer Parameter

    Quote Originally Posted by whitetaru View Post
    Hi markclemens,

    Thanks for the reply. Well, ping is just an example, "telnet" command is another function too.
    I would have to create around slightly over 500 nodes in the end.
    Is there a need to program through VBA ?

  7. #7

    Default Re: Start Program Transfer Parameter

    well. you can possibly make it easier, by using VBA and MouseEvents for the element.

    With the mouse event the object for the element is available, and you can access some of the element's properties, e.g. the element name, in which you can define the parameters for your command.

    In the VBA mouse event you can then evaluate the name of the element, and execute the appropriate command.

    Please note however, that you should not execute any blocking commands in the events as this may also block the runtime.

  8. #8
    whitetaru Gast

    Default Re: Start Program Transfer Parameter

    Quote Originally Posted by markclemens View Post
    well. you can possibly make it easier, by using VBA and MouseEvents for the element.

    With the mouse event the object for the element is available, and you can access some of the element's properties, e.g. the element name, in which you can define the parameters for your command.

    In the VBA mouse event you can then evaluate the name of the element, and execute the appropriate command.

    Please note however, that you should not execute any blocking commands in the events as this may also block the runtime.
    I see. Thanks for the reply

    Cheers.

  9. #9

    Default Re: Start Program Transfer Parameter

    Quote Originally Posted by markclemens View Post
    You can call a function in the context menu, or execute a VBA macro, but neither are not context specific, and you don't have a parameter at the function or in the VBA macro of the object you clicked on.
    I must correct myself here. The VBA macro at the context menu is indeed context specific.

    You can only link a VBA macro of the init event type here. The object (element) for which the context menu is called in the runtime, is passed as a parameter to the init VBA macro called in the context menu.

  10. #10
    whitetaru Gast

    Default Re: Start Program Transfer Parameter

    Quote Originally Posted by markclemens View Post
    I must correct myself here. The VBA macro at the context menu is indeed context specific.

    You can only link a VBA macro of the init event type here. The object (element) for which the context menu is called in the runtime, is passed as a parameter to the init VBA macro called in the context menu.
    Oh I see. Thanks

Similar Threads

  1. File transfer
    By roberto1978 in forum zenon Energy Edition
    Replies: 9
    Last Post: 9th August 2018, 11:01
  2. How to transfer a Zenon license?
    By willetin in forum zenon Supervisor
    Replies: 3
    Last Post: 19th January 2011, 11:08
  3. Start Program error with parameters
    By maurodx in forum zenon Supervisor
    Replies: 2
    Last Post: 16th November 2009, 06:51
  4. InitInstance(): The parameter is incorrect.
    By wolfgangm in forum zenon Supervisor
    Replies: 0
    Last Post: 19th August 2009, 07:32
  5. ext. program start in CE5.0 system
    By rgnos in forum zenon Operator
    Replies: 2
    Last Post: 2nd August 2009, 22:28

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •