WinCC Flex. Set focus on IO field?

smcmanus

Member
Join Date
Jan 2006
Location
Vancouver
Posts
109
I have an application where I have several IO Fields that will be populated with data from a hand scanner. Basically when you have focus on the IO Field Box you click the scanner and it populates the information in the IO Field. Well the issue is I have 3 different IO Field boxes. So I have to set focus on the 1st, and then scan it, then set focus on the 2nd IO Field Box and scan it then set focus on the 3rd IO Field Box and scan it. I am thinking of creating a button for each IO field to set focus but haven’t found an easy way to do this.
 
That is a good question, man you are doing some cool stuff.

I have never tried setting focus in Flexible. My guess would be you would have to do it in a script if you can do it at all. Maybe select the first field to get the focus then on change of that tag index a variable and set focus to the second using the index variable to determine which box to put focus to then next , next, etc.

If you can't do focus you may be able to read all the data into a string and break it out in a script. You would have to come up with a way to delimit the different strings unless they were all the same length.
 
I dont think that what you describe is the same as "setting focus" in the windows environment. "Setting focus" means that you select one user operable screen object for manipulation. You know which obeject has the focus by the dotted box (for lack of better term) that surrounds the object.

It sounds more like you want to select a data object in the PLC (which could be displayed on the HMI as an input-output field, but if it cannot be set by the user it would just be an output field), and the data is input by the scanner - via the PLC presumably (not by the operator).
It is done in the PLC, not the HMI. You can use buttons or a selector to set a dataobject that has to be written to by the scanner. You can use some kind of animation to show the operator which data object is the active one - background color for example.

If you want the operator to be able to edit the selected data and to have the i/o field selected automatically, then you CAN set the focus to the selected field. Add a second function to the button or selector "ActivateScreen". Set the same screen as the "go to screen" parameter, and set the "Object Number" to the number of the i/o field. You can find the object number of the i/o field in the Properties of the i/o field. Because the screen is restarted there can be a flicker.
It is not neat but it ought to work.
 
Aha. This possibility never crossed my mind.
Which "HMI" is it then. A PC RT or a Win CE Panel ?
How do you get the data from the scanner into the WinCC Flexible application ?
 
How do you get the data from the scanner into the WinCC Flexible application ?

The Wasp scanners that I use emulate a keyboard. So no real setup to do. I would guess they would work for the CE panels as well. I think this is the way to go if you only want to scan part numbers of data into the HMI. If you wanted to read boxes going down a conveyor then it should go into the PLC.

http://www.waspbarcode.com/
 
SetFocus is not supported in the VBS of Flexible, but I have a workaround for your application if you are interested.

Example, Create (3) screens (Screen_1, Screen_2, Screen_3). Create (3) String tags (Barcode_ID, Barcode_Workorder, Barcode_ProductID). Set start up screen to Screen_1. On Screen_1 place one IO Field on the screen and tie it to Barcode_ID. On Screen_2 place one IO Field on the screen and tie it to Barcode_Wordorder. On Screen_3 place one IO Field on the screen and tie it to Barcode_ProductID.
Now open your tags and locate Barcode_ID, in the properties click on Events, under Change Value set a function ActivateScreen = Screen_2. Do the same steps for Barcode_Workorder (ActivateScreen = Screen_3), and Barcode_ProductID (ActivateScreen = what ever screen you want)

When placed into runtime or downloaded to a panel you will have screen_1 displayed with the focus already on the IO Field for Barcode_ID string. When you scan it will place your string into Barcode_ID and the enter will activate the change value event of the tag which will change the screen to screen_2. Now the focus will be on the IO Field for Barcode_Wordorder and the same will occur again when you scan the next barcode.

This work around will give you the ability to scan (3) barcodes back to back and store them in 3 string tags. I don't like using 3 screens but this does work.
 
Set focus to objects in WinCC flexible

You can set focus to objects by tab order number.

To display tab numbers, select from menu View\Tab Order. Tab order will be displayed by small black boxes in upper left corner of the I/O objects. You can change the order by clicking on the objects in the desired order.

Set focus with function ActivateScreen and Object number. When using a scanner, I use this function on event OnFinishedInput, to jump from one input field to the next.
 
Last edited:
today i have the sames problem, i wish this help someone...


Dim o
Set o = HmiRuntime.Screens("Pagename").ScreenItems("fieldName")
o.Activate
 

Similar Topics

Hi Just a simple one How do you reset a latched switch on screen From another button press on Hmi (wincc flex 2008) Thanks
Replies
6
Views
2,290
Hello I usually represent all my time delay in 0.001sec inside the hmi but know i need to enter values ranging to 2o minutes meaning 1200...
Replies
4
Views
3,594
I'm continuing my Siemens education. I need some help with compatibility details. My customer has a machine that was made by a company no longer...
Replies
6
Views
4,027
Hello all. I mainly work with Siemens PLC's and panels for our machines. But now I am faced with a pilot project that has to be as price friendly...
Replies
15
Views
8,041
Hi Folks. I have an older application that weighs pallets and prints labels for them. We used to capture the time/date of weighing, but we...
Replies
2
Views
1,613
Back
Top Bottom