Skip to main content

Example for a user defined action - Knowledgebase / Products / Industrial HiVision - Belden Support Center

Example for a user defined action

User defined actions gives you the opportunity to run external applications from the context menu of a device.
This example shows how to define a user defined action to enable/disable a specific switch port.

Batch FilesCopy link to Batch Files to clipboard

Create a batch file (port-state.bat) with the following content:
snmpset -c private %1 1.3.6.1.2.1.2.2.1.7.8 integer %2
(1

Note: snmpset.exe located in C:\Program Files\Hirschmann\Industrial HiVision 04.4.00\bin offers SNMPv1 only.
For SNMPv3 you need to use another SNMP tool like Net-SNMP (http://www.net-snmp.org/)

 Copy link to   to clipboard

Open the preferences dialog Copy link to Open the preferences dialog  to clipboard

1. Click on Preferences in Industrial HiVision toolbar
2. Navigate to User defined Actions
3. Click on New to create a new entry.
4. New Entry dialog is shown

 Copy link to   to clipboard

Define ActionCopy link to Define Action to clipboard

 

Create a new entry to set the Port State based on the user input.

1. Specify a Name for the User defined action
2. Enter the path to the previous created batch file port-state.bat.
3. Use the drop-down box to the right to add the Parameters $IP_ADDR and $USER
4. Add a meaningful text for the user input prompt like Port Admin State (1=on, 2=off)
5. Check the Advanced tick box and enable Event and Message Box

Finalize the user defined action by clicking OK
Click OK to close the preferences window

 Copy link to   to clipboard

Run User Defined ActionCopy link to Run User Defined Action to clipboard

Right click on a device to open the context menu.
Select Actions - Set Port State

 Copy link to   to clipboard

User InputCopy link to User Input to clipboard

Enter 1 or 2 followed by OK to set the port admin state accordingly.

 Copy link to   to clipboard

Message BoxCopy link to Message Box to clipboard

A message box with the action result is shown.