Skip to main content

Example for a user defined action - 知识库 / 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 Files

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

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 (


Open the preferences dialog 

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


Define Action


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


Run User Defined Action

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


User Input

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


Message Box

A message box with the action result is shown.