5.2.1. Using the project template in Visual Studio
OverviewIt is very simple to set up a new FlexPendant project using the integrated project template that comes with the installation of Robot Application Builder. It will automatically add the most common SDK references to the project and auto-generate some source code for the main application window, in the selected programming language, either C# or Visual Basic. NOTE!
To add another view to the FlexPendant project, you do not need to start a new project. See
Adding a view to a custom application on page 99 for information about how to do it.
Setup procedure
Follow these steps to create a FlexPendant project:
Step Action
1. On the File menu in Visual Studio, point to New and then click Project. 2. In VS 2005, in the New Project dialog select Visual C# / Smart Device /
FlexPendant or Other Languages/Visual Basic/Smart Device/FlexPendant. In VS 2008, select Visual C# / FlexPendant or Other Languages/Visual Basic/FlexPen- dant).
6.1.1_1
NOTE!
If you have several RAB installations on your PC, there will be several templates to choose from. Make sure you select the template that match the RobotWare version that your application should target.
5.2.1. Using the project template in Visual Studio © Copyri ght 200 7 - 2009 ABB . All ri ghts res erved.
Add any missing references
The SDK references needed by the FlexPendant project are added automatically when the Project wizard is completed. However, there is a possibility that Visual Studio cannot provide the path to these dlls. If this is the case you should add the references path manually. Follow these steps:
3. Enter the name of the application in the Name field and where you want it to be stored in the Location field. Click OK.
NOTE!
The name has to start by “TpsView” . If you forget it an error will be generated by the ABB verification tool when the project is built.
4. The FlexPendant SDK Project Wizard is now launched. For information about how to configure the application using this wizard see FlexPendant TpsView attribute on page 54 and Container style on page 97. When you are ready click OK.
5. You need to set up the design support for the FlexPendant GUI controls before starting programming. How this is done is detailed in Setting up design support for FlexPendant controls on page 83.
NOTE!
If the SDK references seem to be missing in your FlexPendant project, see the following section for instructions about how to solve the problem.
Step Action
Step Action
1. Look at the Solution Explorer of Visual Studio. If you have a C# project expand the References node. Warning triangles mean that the path to the referenced dlls is missing.
6.1.1_2
For a VB project the Solution Explorer looks the same, except that there is no References node.
Continued
5.2.1. Using the project template in Visual Studio © Copyri ght 200 7 - 2009 ABB . All ri ghts res erved.
2. C#: Select the project icon, right-click and select Properties. Click the Reference Paths tab and add the path to the SDK assemblies.
VB: Select the project icon, right-click and select Properties. Click the References tab. If the path to the SDK references is missing add it by browsing to the directory where they are located.
NOTE!
The default path is C:\Program Files\ABB Industrial IT\Robotics IT\Robot Application Builder 5.xx\FlexPendant SDK \bin.
3. Save the project. You will notice that any warning triangles in the Solution Explorer References node will disappear.
Step Action
5.2.2. Setting up design support for FlexPendant controls © Copyri ght 200 7 - 2009 ABB . All ri ghts res erved.
5.2.2. Setting up design support for FlexPendant controls
OverviewThis section describes how to make the FlexPendant GUI controls accessible in Visual Studio.
Procedure
Follow these steps to add the FlexPendant controls to the Visual Studio Toolbox:
NOTE!
The way you use the Visual Studio Designer to implement FlexPendant controls is very similar to implementing ordinary .NET controls. In this manual useful information which may not be obvious for all users is provided. But oftentimes, it is the general Visual Studio Help that will answer any questions you may have about control properties and the like.
Step Action
1. On the View menu, select Toolbox.
2. Right click in the Toolbox area and select Add Tab. 3. Name the new toolbox tab, e.g. FlexPendant Controls.
4. Right click in the area of the new tab and select Choose Items.
5. In the Choose Toolbox Items dialog, browse to the directory where the FlexPendant SDK assemblies are located and import the following assemblies:
• ABB.Robotics.Tps.Windows.Forms.dll • ABB.Robotics.GTPU.Windows.Forms.dll • ABB.Robotics.DataBinding.dll
The default location is C:\Program Files\ABB Industrial IT\Robotics IT\Robot Application Builder\FlexPendant SDK 5.xx\bin.
6. In the Solution Explorer right-click view.cs (view.vb if you have a VB project) and select View Designer if you are not already in design mode.
As you see, the FlexPendant specific controls are now accessible in the Toolbox. See Introduction to visual design support on page 84 for information about how to use them.
5.3.1. Introduction to visual design support © Copyri ght 200 7 - 2009 ABB . All ri ghts res erved.