The console output window is shown in Figure 10-5.Ģ. After a few seconds, you should hear your computer speak the words in the Data activity box.
A dialog box appears that shows the console output as the program is executed. Click Run Start and press F5, or press the green forward arrow in the toolbar to run your program. To run a diagram, first click File Open to load a previously saved diagram. If you have any trouble creating this diagram, you can find it in the Chapter10 directory in the 1-Hello folder. Save it by clicking File Save As and select an appropriate directory and project name.
A connection should appear between the two activities in the diagram as shown in Figure 10-4.Ĭongratulations! You have just written your first VPL diagram. Select value in the Value box and SpeechText in the Target box. Because the data value being passed is a string, it has a value and a length. This enables you to map a particular data value in the message output from the source to a target value in the message input to the destination. Now the Data Connections dialog box opens. In this case, select DataValue in the From: box and SayText in the To: box and press OK.ĥ. This dialog enables you to select which message is being output from the source activity and which message accepts the input in the destination activity. When you release the mouse button, the Connection dialog appears. Notice that the corners of the TexttoSpeechTTS activity turn green, indicating that this connection is allowed. Place the mouse on the right output pin of the Data activity and drag the mouse to the TexttoSpeechTTS activity. When you no longer want to keep the dialog search results, you can click the X symbol to the right of this heading and it is deleted.Ĥ. All the other services are found under the All Found heading. You can expand or contract the list using the icon to the left of the dialog heading. This creates another heading in the services list that contains all the services that this search finds.
Now click the plus ( ) symbol next to All Found. Type dialog into the Search box and a few services are displayed. The Services toolbox provides a way for you to save common searches. You will probably find that you do some of the same searches repeatedly. The Services toolbox contains many services, so the Search box at the top is very helpful. This list includes all of the services that are present in the MRDS bin directory. The Service toolbox shows all of the services available to VPL. The Basic Activities toolbox contains blocks that control data flow and create data and variables. You drag activity boxes from the various toolboxes to the central area. A diagram consists of one or more activity boxes that are connected together. The work area consists of a central diagram area surrounded by four toolboxes. The main commands are accessible from the main menu bar and the most common commands are on the toolbar. Note the following about the environment: A window similar to the one shown in Figure 10-2 is displayed. Start the VPL development environment by clicking Start Visual Programming Language.
In the rest of this chapter, you will learn how to implement algorithms using VPL. In a robotics context, it is useful for writing high-level orchestration services that control robot behavior. VPL is a data flow language that enables you to specify one or more MRDS services to process data in parallel and to define the data connections between those services. Chapter 10: Microsoft Visual Programming Language Basics