vsTASKER 7 User Manual
×
Menu
Index

Text Field

 
A Text Field is either a display field, an entry field or both.
It contains an embed caption and a display area.
 
 
 
 
 
On the HMI grid, add a Text Field:
or
 
Give it a name, then open the property window.
 
 
Entry Field
 
Check Editable and Display Frame.
 
Click on Caption and write Speed on the text field for Caption. Check Stroked. Close.
Click on Field Settings and write 120 on the text field for Caption. Check Stroked. Select a Red color. Close.
 
In the Runtime panel, put the following code:
 
 // ... user code
 printf("%f\n", atof(val));
 
Compile and Run:
 
Click on the text field, close to 120, to change the value. A little cursor appears.
Use backspace key to erase and write 130.
Then press Enter.
The new value is printed on the console.
 
 
Display Field
 
Uncheck Editable.
Check Cycle at and select 1 hz
 
On the Definition panel, put the following code:
 
private:
   int speed;
 
On the Initialization panel, put this code:
 
  case RESET: {
     speed = 0;
 
On the Runtime panel, put that:
 
  set(speed++, 0);
 
 
Compile and run: