×

Subscribe to newsletter

subscribe to our weekly newsletter to get notified with latest story and article Subscribe now!




PLC BLOG | Siemens wincc hmi basic object property and programming in vb script

Siemens wincc hmi basic object property and programming in vb script

basic object like line, circle, rectangular etc are available in the wincc tia portal. you can use these object into your hmi screen and configure their property with in property of object or you can also make a script for these basic object. basic object don't have any event. basic object are useful for making a graphical presentation better. in this article only for basic object and property configuration. article have simple vb script for all basic object so you can understand how these basic object are work in your hmi.

siemens wincc basic object

Siemens wincc textfield basic object

A text field is a element that displays string. it is used to describe or identify another element, such as a text field, button, or checkbox. it is also useful to show status result, error result of vbscript. text field help users or operator to understand the purpose of a given input or action on a HMI screen.

Siemens wincc textfield basic object
below is the associated text field property which are useful to make text field more user friendly
  • general property this property use to set text of text field, set style, select fit to size.
  • appearance property in this property you can change background color, pattern, border, text color and border radius
  • layout property in this property use to set position, margin and select fit to size of text field in screen for larger text.
  • text format property in text format property select font size, font style, font type for your text field.
  • flashing property select flashing enable or disable of your text field.
  • style and design property in this property select pr configured style for your text field.
  • miscellaneous property this property is used to change unique name and select layer of your text field. unique name is very important for vbscript. you can change name of text fields in this property. by default already name set.

siemens wincc associated text field property

wincc tia vbscript example for your text field

in this simple example of vbscript all property of text field is changed when button is pressed. add a button and a textfield.as shown in below images

component for vbscript
below is vbscript for text field. this vbscript helps to understand how to change property of text field by using vbscript in wincc tia portal.in this vbscript Increment Text Field with Color Change. following is the vbscript explanation
  • VBFunction_1 is a subroutine named.
  • The Dim keyword declares the text field variable that will reference the input field.
  • set keyword references a text field object within a specific screen (Screen_1) in a Siemens HMI Runtime environment. It locates the field named "Text field_1" on the screen.
  • textfield.Text + 1 increment textfield value by one when button pressed.
  • Change the text color to Red, Green, Blue, Cyan, or Magenta based on the current textfield value.
  • Reset to 0 when the textfield text exceeds 5.

wincc tia vbscript example for your text field

siemens wincc line basic object

a line is one of the fundamental elements used to create shapes, structures, and visual compositions. A straight line has no curves or angles and continues in one direction. Often used to create basic shapes (like rectangles, squares, or triangles) or as boundaries, borders, or dividers in designs.

siemens wincc line basic object
in a property of line you can change line size, line type, line color in appearance property. you can set layout, position, width, height of line. Lines can have varying thicknesses. Thicker lines often stand out more and can be used to highlight or create emphasis, while thinner lines can add subtle details or intricate designs.

siemens wincc line basic object property

siemens wincc rectangle, circle, ellipse basic object

basic shapes like rectangles, circles, and ellipses are foundational elements used in various contexts, from simple designs to complex illustrations. These shapes are widely used for 2d animation and graphics. their property are also change by property editor or by vbscript. in a property you can change background color, border radius and color, set style sheet.

siemens wincc rectangle, circle, ellipse basic object
below is the simple example of vbscript to change background color and width of rectangle, circle, ellipse when button is pressed. after creating vb script add this vbscript in button press events.

vbscript for siemens wincc rectangle, circle, ellipse basic object

Siemens wincc graphics view basic object

A graphics view is a visual representation or interface used to display image. you can also animate these graphics view images by using animation property or vbscript. first insert graphics on the screen and select general property here you can find graphics list select any garphics to show. it is also possible in graphics view to add images from your computer or create graphics from library editor.

Siemens wincc graphics view basic object

siemens wincc poly line and polygon basic object

A PolyLine is a shape made up of a series of connected straight line segments. It does not need to form a closed loop, meaning the last point does not connect back to the first. A Polygon is a closed shape made up of straight line segments. It has at least three sides and the last point connects back to the first to form a closed loop.

siemens wincc poly line and polygon basic object

Simmilar

Siemens Data Blocks (DB)

Jul17, 2021 85

Siemens Math Instructions

Jun25, 2021 12

Siemens Bit Logic

May24, 2021 10


comment