RSView32 SendKeys Command

aiki202

Member
Join Date
Aug 2007
Location
Pennsylvania
Posts
178
I am trying to send the 'ENTER' key press as a command behind a button in RSView32. Existing code: SendKeys "{ENTER}"
I have a string input object that I enter data into. When I press the OK button (button with the sendkeys command) I want it to enter the data I just typed into the assigned tag, then call a VBA subroutine to check the data. The sub is being called, but the enter key is never being simulated, thus the data I type is not being sent to the subroutine. I can press the enter key physically and all of the logic works properly. Any ideas?

Thanks!
 
I have tried the following commands behind the button without success:

SetFocus Admin_login.StringInput1;
SendKeys "{ENTER}";

The problem is the string input object loses focus when I press the button. I do not think the SetFocus parameter (.StringInput1) is allowed, but I need to have the string input have focus before the enter key is pressed so that its tag is populated with the new data before the VBA sub is called. Perhaps I can do this all in VBA...
 
Another method you could try would be:

Use a button to trigger a VBA routine.
In your VBA code use an "InputBox" to collect the string then write that value to your tag location using "gCommand.Execute". This way you don't need to SENDKEY and validate the tag. You could also use the VBA code to make sure it is a valid string or lenght etc.

This is one way I do it, but there is more that one way to do most things.
 
Oakley said:
What OS and version of RSView are you using?
Windows XP Pro SP2, and RSView32 version 7.4.

Keystone said:
Another method you could try would be:

Use a button to trigger a VBA routine.
In your VBA code use an "InputBox" to collect the string then write that value to your tag location using "gCommand.Execute". This way you don't need to SENDKEY and validate the tag. You could also use the VBA code to make sure it is a valid string or lenght etc.

This is one way I do it, but there is more that one way to do most things.

Certainly an excellent option if I cannot get my initial way to work.

Is there any documentation I can read (other than the RSView32 user guide) that will give me a better understanding of interacting with an RSView32 application with VBA?
 
There are some VBA samples in some of the sample apps on the disks. I have been told there are some examples on the Rockwell site (never found them). Also if you Google VBA with what you are trying to do there are some forums out there.
 
Keystone said:
There are some VBA samples in some of the sample apps on the disks. I have been told there are some examples on the Rockwell site (never found them). Also if you Google VBA with what you are trying to do there are some forums out there.
I forgot about the samples on the disk. I just checked and there is a ton of code in the samples. Thanks! (y)
 

Similar Topics

I'm importing an RSView32 project into FTView SE. I'm using Legacy Tag Database Conversion on a virtual machine with Windows XP, I did the first...
Replies
0
Views
373
Hi everybody, I have a rsview32 application, when I try to run it it loads upto 80% system settings and the crashes saying Rsview32 Project...
Replies
3
Views
1,911
Hi Guys I'm having trouble assigning a tag to an activex label on a Multipage Tab. I can assign the tag to an active x label on a normal display...
Replies
0
Views
596
I have followed the procedure below to convert RSView32 project to FactoryTalk View...
Replies
5
Views
1,431
I have converted RSV32 to FTVSE Distributed. pretty straightforward... I cant seem to figure out how or find any documentation to migrate RSV32...
Replies
4
Views
2,305
Back
Top Bottom