# Running nmsv5tool in standalone mode

Before running nmsv5tool, make sure you have configured and booted a CG board, connected its E1 trunks, and compiled the nmsv5tool executable.

To run the nmsv5tool in standalone mode:

Step | Action
1 | Start nmsv5tool by entering the following command at the prompt: nmsv5tool nmsv5tool displays a main menu of available options that directly correspond to functions in the NMS V5 library.
2 | Enter options to execute functions from the NMS V5 library. See nmsv5tool options. When necessary, nmsv5tool prompts you to enter associated arguments or parameters for the specified board family.
3 | To validate that the HDLC channels can send and receive HDLC frames, use option 13 (NMS_V5PhSendData).
4 | Before exiting nmsv5tool, stop (option 8) and destroy (option 5) the interface.
5 | To exit nmsv5tool, enter q.

### nmsv4tool options

Index | Option | Description
1 | Call NMS_V5Initialize | Initializes NMS V5 library.
2 | Call NMS_V5SetTrace | Sets trace level for NMS V5 library.
3 | Call NMS_V5Exit | Exits NMS V5 library.
4 | Call NMS_V5ProvisionInterface | Provisions a V5.2 physical layer interface.
5 | Call NMS_V5ProvisionStandbyVariant | Provisions a V5.2 physical layer interface standby variant.
6 | Call NMS_V5DestroyInterface | Destroys an existing V5.2 physical layer interface.
7 | Call NMS_V5DestroyStandbyVariant | Destroys a V5.2 physical layer interface standby variant.
8 | Call NMS_V5AddE1 | Adds an HDLC channel to a provisioned active variant on a specified interface.
9 | Call NMS_V5DeleteE1 | Removes an HDLC channel from a provisioned active variant on a specified interface.
10 | Call NMS_V5AddE1 | Adds an E1 link associated with voice channels to a provisioned active variant on a specified interface.
11 | Call NMS_V5DeleteE1 | Deletes an E1 link from a provisioned active variant on a specified interface.
12 | Call NMS_V5SwitchOverVariantData | Switches interface to the standby variant.
13 | Call NMS_V5StartInterface | Starts a V5.2 physical layer interface.
14 | Call NMS_V5StopInterface | Stops a V5.2 physical layer interface.
15 | Call NMS_V5GetChannelStatistics | Retrieves channel statistics for an HDLC channel associated with a V5.2 physical layer interface.
16 | Call NMS_V5ResetChannelStatistics | Resets channel statistics for an HDLC channel associated with a V5.2 physical layer interface.
17 | Call NMS_V5GetE1Status | Retrieves status information for an E1 link associated with a V5.2 physical layer interface.
18 | Call NMS_V5ResetE1Status | Resets status information for an E1 link associated with a V5.2 physical layer interface.
19 | Call NMS_V5PhSendData | Sends test frames to the NMS V5 library.
20 | Call NMS_V5SendSA7Bit | Sets the value of the SA7 E1 framing bit to 0 or 1.
g |  | Sets application global trace mask. Enter one of the following options: 0x0: No trace mask. 0x1: Trace HDLC buffers. 0x2: Trace HDLC errors. 0x4: Trace E1 status reports.
l |  | Starts a load test for a provisioned interface.
p |  | Prints the current provisioned configuration.
h |  | Displays a Help menu.
q |  | Exits the program.

Note: Options 19 and 20 (calling NMS_V5PhSendData and NMS_V5SendSA7Bit) are only available in standalone mode. When the NMS V5 library is integrated with the AV5 library, nmsv5tool calls NMS_V5PhSendData and NMS_V5SendSA7Bit internally as requested by the AV5 library V5PhDataRequest, V5SetSA7ToOne, and V5SetSA7ToZero functions.

## Example: nmsv5tool in standalone mode

This example shows the nmsv5tool options used to perform the following tasks:

- Initialize the NMS V5 library.

- Provision an interface (interface 0) consisting of four HDLC channels on a CG board. Trunks 0 and 1 must be connected with a crossover cable.

- Start the provisioned interface.

To perform these tasks:

1. Start nmsv5tool by entering the following command at the prompt:

nmsv5tool

2. Enter option 1 to initialize the library.

nmsv5tool displays the following:

NMS_V5Initialize: Result=NMSV5_SUCCESS

3. Enter option 4 to provision the interface.

4. nmsv5tool requests the following additional information:

   Prompt | Response
   Enter interfaceId: | 0
   Enter ChannelRxBufferSize (Min=260): | 260
   Add a new E1? (y/n): | y
   NMS boardNb: | 0
   NMS trunkNb: | 0
   Add a new E1? (y/n): | y
   NMS boardNb: | 0
   NMS trunkNb: | 1
   Add a new E1? (y/n): | n
   Add a new channel? (y/n): | y
   NMS boardNb: | 0
   NMS trunkNb: | 0
   NMS timeslotNb | 16
   Add a new channel? (y/n): | y
   NMS boardNb: | 0
   NMS trunkNb: | 0
   NMS timeslotNb | 15
   Add a new channel? (y/n): | y
   NMS boardNb: | 0
   NMS trunkNb: | 1
   NMS timeslotNb | 16
   Add a new channel? (y/n): | y
   NMS boardNb: | 0
   NMS trunkNb: | 1
   NMS timeslotNb | 15
   Add a new channel? (y/n): | n

The following message displays when the interface is provisioned:

Result=NMSV5_SUCCESS

5. Enter option 11 to start the interface.

nmsv5tool prompts you to enter the interface ID of the interface to start.

6. Enter the interface ID of the provisioned interface (0).

7. After the interface is started, nmsv5tool prints the E1 link status for each provisioned E1 link to the screen and displays an NMSV5_SUCCESS event:

17:30:43E1Status Function InterfaceId=0 Status: LOS=0 LOF=0 AIS=0
RAI=0 CRCErr=0 FEBE=0 N_SA7_0=0 N_SA7_1=1
NMS: boardNb=0 trunkNb=0
17:30:43E1Status Function InterfaceId=0 Status: LOS=0 LOF=0 AIS=0
RAI=0 CRCErr=0 FEBE=0 N_SA7_0=0 N_SA7_1=1
NMS: boardNb=0 trunkNb=1
NMS_V5StartInterface: Result=NMSV5_SUCCESS

8. To validate that HDLC connections can send and receive HDLC frames over HDLC links, enter option 17.

9. Enter other command line options to test NMS V5 library functions.

10. To exit nmsv5tool, enter q.