Intouch Format Check Script Nightmare?

Join Date
Jan 2003
Location
Michigan
Posts
490
Hey all. Ive got a screen where an operator is going to scan in with a bar code reader 140 serials. They click the position a serial goes in (it represents a load build) scan it, and it puts a serial in. I then need to check to see if it begins with "RS" and if it does, cut the RS off it, convert to an int and save it to the position. Thats no problem. Problem is I dont want to create 140 data change scripts to do this. But I cannot seem to figure out a way to combine user input with a script or using indirect tags. Ive thought of using indriects, but the only way I can seem to make it work is to put a button next to the field to click after its been scanned or to open a popup with the data entry where the idriects can be set and the script run on close. Both take an unacceptable amount of user interaction (they want to click the field, scan, and be done (the scanner will put a CR after the scan).

Anyone know of an app that is good for editing the .DCH files from ww? Copying and editing them seems to corrupt the DCH file. Even the hex editor I used did, and all I did was change tagnames in it.

Thanks in advance.

Matt
 
This may one of those times that trying to do it fancy takes more time than just doing it. Create the 140 scripts. Heck, you already have to create the 140 tags, then 140 input areas, ... I think you could also code a quick function and pass the tag name to it in the DC script, so you only have to change the tagname once in the DC scripts.



The only way I can think of doing indirect is to put a script on the page that runs every second, do a FOR/Next loop and form the indirect tag .name field with a base tag name and number. ie, every input tag is like: scan_field_1, scan_field_2, scan_field_3, so a script would look like (this is in Basic as WW isn't running and I'm too lazy to open the help files and look for the correct functions):

for i = 1 to 140;

Indirect_tag.name = "scan_field_" + str$(i);

if left$(Indirect_tag,2) = "RS" then
; do something to convert to int and remove 'RS'

exit for; {why waste time scanning the rest}
endif;

next i

HTH,
Dave
 
I've got a possible solution for you.

For each of the positions they have to click to scan the serial, do the following:

1. Create 2 touch pushbutton action scripts:
On Key Down: DialogStringEntry( "messageTag", "Scan the barcode:"); NOTE: Quotes are necessary around the message tag.
On Key Up:
IF StringLeft(messageTag, 2) == "RS" THEN
messageTag = StringRight(messageTag, StringLen(messageTag) - 2);
ENDIF;

2. Check the String for Value Display and input your messageTag.

In step one, the On Key Down instruction should display a popup keyboard different than the one for standard InTouch. When you close it, it will execute the On Key Up script to midify the string appropriately. The only thing is I don't remember if you need to load a "helper" DLL for the keyboard. You might need to do a little research at WW KB for this. By the way, I have programmed and tested this and it works great.

Hope this helps. Good Luck,

Jeff
 
Ah, I never thought of combining 2 objects together and giving them on down and on up events. Not sure about popping the keyboard, as they dont want to have an extra step (clicking close). So ill have to have it close on the CR from the scanner. Ill check this out. Thanks!

matt
 
I didn't do this with 2 objects, just one simple text (#) object. Program the 2 action scripts and the value display for your string tag all on this one object.

Also, the CR from your scanner should automatically close the keyboard with no additional help needed, but I didn't have a correctly programmed scanner on hand to test with.
 
Got it, 2 actions on the 1 object. I am curious to try combining items tho, never had 2 items bound that are both action scripts before.

Thanks again, I really didnt want to go through the bear of making all those scripts. Its so much easier to group and use the tag replace then to rewrite the scripts over and over. Especially when the tags are Row1_Serial1, Row1_Serial2, Row2_Serial1. Makes the very easy to fine replace after the first row of 20 is done. Thanks again.

matt
 
Side note,

Know of any way to edit DCH, etc files without corrupting them? It would be nice to be able to edit them occasionally outside of the wonderware ide (like tag name work in excel).

Thanks again.
 
Works great btw! Just a note I changed some stuff around as i had to do some converting, but I also did this

On Key Down: DialogStringEntry( "messageTag", "Scan the barcode:"); NOTE: Quotes are necessary around the message tag.

Instead of using "" around the message tag, I used the .name dotfield to get it. That way, I could group them and do a batch replace to the next serial. Otherwise it doesnt get changed and id have to edit everyone. Thanks again.

matt
 
No problem Matt. I kind of stumbled on the DialogStringEntry command some time ago for an issue which I can't recall. It's a great alternative to the standard InTouch keyboard input when you need to run additional scripts.

Glad to be of assistance.

Jeff
 
Ive found an interesting bug with this setup. They want the screen to automatically scroll down to the next field on a scan and start again (so they can just scan away without using mouse to pick the field). So I tossed in a SENDKEYS on the successful scan check to down arrow and enter to start it again. Well,if you click off the keyboard or esc out of it, it locks wonderware. :( Its an error with send keys. Also, I tried have a flag set that runs a quick function or a on data change script instead to do the send keys, and it just doesnt send the keys. Strange.

Any idea on how to make it go to the next input field without keyboard or mouse use and NOT using send keys? Write 1 giant script for each colunm of scans and just let it rip?

matt
 
Yea, I had it on the on key up, at the very end of the script. It also only sometimes sends the keys. Sometimes it sends them, some times it doesnt. Wonderware basically told me that sendkeys is legacy, and buggy, and not to use them. :( I even looked at doing the hard way and just using a ton of on change scipts, but they fail to always send the keys too. Ugh. Ive contacted wonderware and asked them to dev the screen for me. Too many wonderware bugs for my taste. No time left for app before customer kills me :(
 

Similar Topics

Hello, I just need some help here... I integrate my PLC and HMI through the KepserverEX (OPC). When I check at the OPC quick client, I see that...
Replies
4
Views
1,677
Hey, I want to get some timer from Siemens S7 SFB 4 (time on delay) information to Wonderware Intouch HMI through my DDE server. Currently I...
Replies
3
Views
6,624
Hi all. Customer wants analog faceplates really bad, even if we explained that it doesn't make much sense in his process. What he wants to see...
Replies
5
Views
129
Trying to export a Modern application for an upgrade to Intouch 2020 but I cannot export the application from the 2014 version because the export...
Replies
2
Views
108
Hi guys, I have experience with PLC to Excel etc...just starting on using intouch scada screens. I have an Excel sheet that uses mainly...
Replies
1
Views
149
Back
Top Bottom