RSView VBA time delay on form

TConnolly

Lifetime Supporting Member
Join Date
Apr 2005
Location
Salt Lake City
Posts
6,152
In RSView we have the operators read in several pieces of information from a barcode reader. None of the bar codes have any tab, CR, LF, or any other terminating character on it. Right now we rely on the operator to read a bar code, press tab or mouse click to move to the next field, read the next bar code, repeat.

This is apparently too hard.

I've been asked to find a way so that focus will shift to the next field after a barcode is entered.

The same bar codes are used elsewhere in the process so adding a terminating character is probably not going to be an option.

To compound the issue, the barcode strings are variable length and can be from six to nine characters long.

The barcode reader attaches to the PC, it does not interface through the PLC so I'm limited to RSView and RSViewVBA commands.

I'm thinking about using a VBA form instead of RSView native text entry fields and once the input text box .text length is greater than five then if if doesn't change for say 1.5 seconds then set focus to the next text box.

I've never done any time delay events in VBA however and wonder if anyone has ever done this or if they have a better idea of how to handle the problem.
 
Last edited:
Doing the way you mentioned, my only concern would be that the operators get ahead of your "stall" timer.

Rather than a time delay in VBA (which all by itself sounds like a headache), can you perform a lookup on the tag as soon as it reaches the minimum number of characters and then move focus to the next one as soon as a match is found?

This might be faster than 1.5 seconds and keep them from trying to read in the next value during the delay.
 
A look up probably won't work because there is a basic reference name which may or may not be followed by a revision.

A typical string would be ABCDEF or ABCDEF-R1 or ABCDEF-R2, meaning that the firs six characters aren't unique and if I find a match there isn't a guarantee that there isn't another match.

On top of that I'd have to maintain more than 30 look up tables every time there was a revision.


I've got an idea to use the textbox change event and store a time and string length. Next time the change event happens I look at the time. If its more than one second later then I keep only the number of left$ characters recorded in the textbox text, shift focus, and then copy any excess characters into the next box. I hope that mufti-threading doesn't jumble things up but I'm afraid it is going to.
 
Last edited:
Never mind. I got it. I shoulda tried making and testing a VBA form first. o_O

I guess VBA forms are smarter than RSView forms. šŸ™ƒ

When using a native RSView display with text entry fields then it is necessary to tab or mouse click between the fields. However once I built a VBA form and put the four text boxes on it and tested it it each bar code entry automatically changed focus to the next text box. No code was needed to change focus.

The day is good when things unexpectedly work out like that.
 
Last edited:
Alaric; said:
Never mind. I got it. I shoulda tried making and testing a VBA form first. o_O

I guess VBA forms are smarter than RSView forms. šŸ™ƒ

When using a native RSView display with text entry fields then it is necessary to tab or mouse click between the fields. However once I built a VBA form and put the four text boxes on it and tested it it each bar code entry automatically changed focus to the next text box. No code was needed to change focus.

Sounds like there is an invisible termination character handled differently in VBA (or does it work off the buffer length maybe?)

Alaric; said:
The day is good when things unexpectedly work out like that.

Those days are rare...buy a lottery ticket on the way home ;)
 

Similar Topics

Hello there, I'm new at the forums and with HMI programming and would like to ask for some help. I'm having trouble migrating a VBA code from...
Replies
1
Views
3,087
Need a bit of help. I have a older rsview app running on Windows nt that runs fine. My clients wanted to update and now the same project will...
Replies
12
Views
3,012
I have a global object that is a group of a series of objects one of which is a button. The push of the button needs to execute a VB script based...
Replies
0
Views
4,693
Hallo, I got a Cognex Scanner for dormatrix code. I want to read it in a RSView 32 Application. Therefore I need a VBA Code. Did anybody from...
Replies
0
Views
1,948
I'm using RSView VBA to record the last parameter adjustments made for a given product in an MS Access data base. The Access table contains...
Replies
4
Views
2,331
Back
Top Bottom