Running And Debugging

Glossary Item Box

Microsoft Robotics Developer Studio Send feedback on this topic

Running And Debugging

To run an open VPL project, click Start from the Run menu. This will display the Run dialog and start the DSS runtime and run your project as well as any other services you have defined as partners.

Run Dialog

The Run dialog box appears with a hyperlink to a Debug web page as well as a list displaying the sequence of messages that provide information about the status of the startup of your project. A Filter menu at the top of the list allows you to define what messages are displayed. Notice that there is a small plus sign (+) to the left of each message. Clicking on this will expand the message.

Errors that occur during the running of you program should cause messages to be displayed in the Run dialog. You might have to scroll the list of messages to see if there were any errors. The Filter is useful because you can set it to show just the errors.

To stop your program, click the Stop button in the Run dialog or click the Close button (the 'X' in the top-right corner) on the Run dialog window.

Debugging your VPL Application

VPL includes several features designed to help you debug your project. The first is a set of small icons that may appear when you are designing your dataflow. These typically appear when you have missing or incompatible values for connections or other settings. Some debug icons are just advisory while others identify errors at design time that may cause your program not to execute correctly.

When your run your project, there are additional debugging options through using the Debug View. One way to access the Debug View is by clicking on the hyperlink displayed in the Run dialog. Clicking this link launches a Web browser and loads the Debug View Web page displaying information about your project’s execution. However, because your project may complete before the Debug View page is displayed, using this information may be of limited value. A better alternative is to use the Debug Start command from the Run menu to start your project. This command also displays the Debug View page, but pauses execution at your diagram’s first activity block, providing buttons that enable you to step through your program.

Debug View

The Debug View page displays the following sections which provide information about the current state of your diagram. Each section can be hidden or redisplayed by using the buttons on the right end of the section’s header. If the page does not display any information, try using the browser's Refresh command to reload the page.

At the top of the page are links to other pages that provide access to the output of DSS System Services.

Control Panel - Displays the output of the DSS Control Panel service which enables you to manually start and stop DSS services and can also be used for inspecting the contracts of available services.

Service Directory - Displays the output of the Service Directory service which maintains a directory of running DSS services.

Debug and Trace Messages - Displays the Console Output Services’ debug and log messages that are generated for a running DSS node.

Diagram State

The Diagram State section of the page displays information about your diagram including current state values of your diagrams and any custom activities. Typically this will be the collection of the variables you define, their current values, and their types. It also displays your diagram’s subscriptions, those services that provide notification connections in your diagram(s) or custom activities. You can click on the hyperlinks here to see a view of the service’s current state.

Current Activity

The Current Activity section displays a view of your diagram and three buttons for Run, Run Slowly, and Step To The Next Activity (which toggles with Pause) buttons that you can use to control your program’s execution.

Debug Current Activity

Pressing the Step To The Next Activity button moves execution to the next activity block and highlights it. At each step, the current value and type of the messages being sent between the activities are displayed at the bottom of the Current Activity section (not visible in the figure above). Note that each step is not necessarily sequential since you may have parts of your dataflow that execute in parallel.

When a program is executing, the current activity block is highlighted as you can see for the TexttoSpeechTTS block in the figure. Normally the program will run very quickly and you might not see the highlighting as it moves from one block to another. This is why there is a Run Slowly button.

Breakpoints

The Breakpoints section displays any breakpointsyou set (which may be created in the following section). A breakpoint is a way of pausing execution at a specific activity, enabling you to view its state at that point. Once you set a breakpoint, you can then use the Run or Run Slowly buttons in the Current Activity section to advance to this breakpoint (or first breakpoint if you have set multiple breakpoints).

Each breakpoint includes a Clear button to remove the breakpoint (when you no longer need it) as well as a Disable button that allows you to temporarily ignore the breakpoint while debugging. The button toggles to an Enable button that enables you to restore the breakpoint.

Using these buttons will redisplay the Debug View page automatically. If the page does not redisplay properly, try using the browser’s Refresh button to redisplay it.

Pending Activities

This section indicates the next activity blocks that will be executed while you are debugging. (There might be more than one pending activity if you have parallel dataflows). It also displays state information about those activities and includes a SetBP (Set Breakpoint) button that enables you to pause execution at that activity.

If you use the SetBP button to set a breakpoint, the Debug View page automatically refreshes to show your new breakpoint in the Breakpoints section. If the page does not redisplay properly, try using the browser’s Refresh button to redisplay it.

Using Port Settings

Since your project is itself a DSS (Decentralized Software Services) service, when VPL runs the project it launches the DSS runtime and loads the service. To do this, an HTTP and a TCP port are needed. VPL automatically sets the default values for your project. However, if you are running multiple instances of VPL at the same time (or other applications that might be using these ports) you can change the port settings by clicking the Port Settings command on the Run menu and entering new values in the resulting dialog.

You can also use the port setting to access the debug information on your application using a Web browser and setting its address to location of your port and /console/output; for example using the default port setting, the URL https://localhost:50000/console/output, will display a Web page showing the Console Output Service and links to related information.

Port Settings Dialog

Alternatively, if you click on "Diagrams" in the Project toolbox the port settings are listed in the Properties toolbox and you can change them there.

 

 

© 2012 Microsoft Corporation. All Rights Reserved.