Siemens Industry Online Support
Siemens AG
Entry type: FAQ Entry ID: 26150018, Entry date: 09/08/2014

Which VBS information and programming aids are there in WinCC flexible?

  • Entry
  • Associated product(s)

WinCC flexible contains a wide range of information about programming Visual Basic scripts. In principle, scripts can be compiled in WinCC flexible for operator panels from the 270 series onwards.

1. Information and documentation in the WinCC flexible help system
The essential Visual Basic commands can be used both in WinCC flexible PC runtime and on an operator panel with Windows CE. There are exceptions when accessing the file system, for example, because the procedure for this is different in Windows CE and Windows XP.

There is information available about the VB script commands in the WinCC flexible help system in the "Contents" tab under "WinCC flexible Information System > Working with WinCC flexible > Reference".

Fig. 01
  • 1.1 Information about Visual Basic commands
    If either of the editions of WinCC flexible, i.e. Standard or Advanced, are installed, the user can access further sources of information about VB commands in Windows under "Start > Programs > VBScript Documentation".

    Fig. 01

    Alternatively, you can also open the "VBScript Language Reference" in the WinCC flexible help.
    Use "VBScript Language Reference" as your keyword.
  • 1.2 PDF documentation in WinCC flexible
    A PDF file can be opened in WinCC flexible containing all the information about this topic in manual format.

    Fig. 03

2. Programming support in WinCC flexible
WinCC flexible offers a range of different programming support. These programming aids are implemented in the Script Editor in WinCC flexible.

  • 2.1 Hotkey support
    When you press the key combination <Crtl + Space> in the Script Editor, a pop-up menu appears containing a predefined system function for this operator panel.

    Fig. 04

    Using the key combination <Alt + Right Arrow> you can quickly create more global variables and insert them in the script.

    If there are already instructions (e.g. "Dim") contained in the Script Editor, you can call up the help for this command by placing the cursor on this keyword and pressing <F1>.

    Fig. 05

  • 2.2 Script wizard - Function list
    All the system functions, including the scripts, can be implemented in the open script by means of the script wizard. This simply involves selecting the function from the function list and adding it by clicking "Apply".

    Fig. 06

    By pressing "Apply", all the system functions which are contained in the function list are transferred to the current cursor position.
  • 2.3 Script wizard - Code template wizard
    Standardized code sequences can be added quickly using the code template wizard. This involves selecting the required code sequence and clicking "Apply".

    Fig. 07

  • 2.4 Information toolbar
    If the Script Editor is opened, there are additional functions available in the toolbar.
    No. Icon Meaning
    1 Display the properties and methods of the object
    2 Display information about the parameter
    3 Display QuickInfo
    4 List all the system functions
    5 List all the scripts
    6 List all the VBScript functions
    7 List all the VBScript constants
    8 List objects
    9 Check scripts for errors
    Table 01 The most important script toolbar functions in WinCC flexible

    In order to access information about the parameters of a function or method, for instance, all the parameters can be displayed in connection with the current cursor position and by clicking the "Display information about the parameter" function on the toolbar.

    Fig. 08

    Provided the cursor is positioned appropriately, the "QuickInfo" toolbar supplies a brief description of the function or method in the form of a tool tip.

    The opened script can be checked for syntax errors using the "Check scripts for errors" function on the toolbar. Runtime errors can only be identified in runtime. A script debugger is required in order to analyze runtime errors.

3. Using script debuggers in WinCC flexible
Use a script debugger when executing the script in order to check runtime errors or that the script is working properly. A script debugger must be installed in WinCC flexible for this.
Use different debuggers depending on the Microsoft operating system:
In Microsoft Windows 7 SP1 onwards you use the "Microsoft Visual Studio Express". Two other script debuggers are tested and released for WinCC flexible in older versions of Microsoft Windows:

"Microsoft Visual Studio Express"

Microsoft Visual Studio Express is a free development environment which makes it easy to debug WinCC flexible scripts:

  1. Start the WinCC RT Advanced.
  2. Start Visual Studio Express.
  3. From the "Debug" menu you select the command "Attach to Process..."

    Fig. 09
  4. In the dialog that opens you select the process "HmiRTm.exe".

    Fig. 10
  5. In the "Solution Explorer" the WinCC flexible project is displayed with the configured scripts.

    Fig. 11

Microsoft Visual Studio Express is ready for downloading on the Microsoft web pages.

"Microsoft Script Editor in Office XP" and "Microsoft Script Debugger"

Details about integrating the Microsoft Script Editor or Microsoft Script Debugger is available in the WinCC Comfort/Advanced system manual, under "Integrating the Debugger" in Entry ID 18796010.
The debugger is started in WinCC flexible via the toolbar command "Runtime with Script Debugger".

Toolbar icon in WinCC flexible for "Runtime with Script Debugger"

Additional Keywords
VB, VBScript, VBS

Rate entry
no rating
Requests and feedback
What do you want to do?
Note: The feedback always relates to the current entry / product. Your message will be forwarded to our technical editors working in the Online Support. In a few days, you will receive a response if your feedback requires one. If we have no further questions, you will not hear from us.