Rsview32, VBA, uploading tag variables...

Paullys50

Lifetime Supporting Member
Join Date
Jan 2006
Location
WI
Posts
2,188
I'm working on a recipe page which is my first real attempt at VBA, this is our only system that uses RSView32 and it's pretty much brand new so in-house experience is nill. I'm takin' baby steps here;)

Currently I've created a screen that I want to display all 30 recipe parameters. Overall I have everything sorted out, but I have extremely slow upload speeds. I have an "upload" button that when pressed will upload the current recipe values in the system for display on the HMI. This will put those values into textboxes for editing purposes (I can also save my recipes from this screen)

Here is a slice of my code:
Dim Zn1Temp As Tag 'Tag variables
Dim Zn2Temp As Tag
Dim Zn3Temp As Tag
Dim Zn4Temp As Tag

MsgBox("Variable decs made") 'debug

Set Zn1Temp = gTagDb.GetTag("ANALOG\Skid1_temp_stpt") 'Set tagnames to variables
Set Zn2Temp = gTagDb.GetTag("ANALOG\Skid2_temp_stpt")
Set Zn3Temp = gTagDb.GetTag("ANALOG\Skid3_temp_stpt")
Set Zn4Temp = gTagDb.GetTag("ANALOG\Skid4_temp_stpt")

MsgBox("Tags set") 'debug

UserForm1.Zn1Temp = Zn1Temp 'The problem lies in this area
UserForm1.Zn2Temp = Zn2Temp
UserForm1.Zn3Temp = Zn3Temp
UserForm1.Zn4Temp = Zn4Temp

MsgBox("Load Complete") 'debug

I'm attempting to write directly to the textboxes on my form for display, but this is what is very slow. Is this the right way to do this? Am I missing some textbox setting I need to be aware of? Could this be related to the data type of the tags VS the textboxes?

I've been looking through my VB reference book, but since it's for VB not VBA I'm guessing I'm overlooking something. Google and PLCS search haven't come up with much. Can anyone point me in the right direction?
 
Define 'Slow'.
I use a similar method to query a remote SQL server for recipe values, and populate text fields on a display. The recipies contain about 40 columns from SQL, and the total time to read from the database and populate the text fields is about 1 to 2 seconds.
 
I put a msgbox command just above the line of code:
UserForm1.Zn1Temp = Zn1Temp
In that msgbox I display the 1st, 15th, and 30th tag(recipe) values that were acquired by the SET....lines of code, that message box takes 1 - 2 seconds to open up and display the values. So data from the tags has been gathered fairly quickly, the transfer of that data to a textbox for display slows it down.

I'll just try to use a label instead for display, and use the textbox for editing purposes only.

Thanks for the help!
 

Similar Topics

Good friends, I'm new to the forum, I'm working with RSview32, someone can help me how to make a macro in VBA, to save some data in Excel. to...
Replies
6
Views
1,948
We were given RSView32 project files, for quoting, that will be converted to FTView SE. Unfortunately the project has VBA references that were...
Replies
9
Views
4,312
Hi, I got a RSview32 project from site with VBA scripts and trying to run on my local machine to make some graphical changes. VB scripts are used...
Replies
6
Views
3,488
Please somebody upload this manual on another site or forward me 51770 - Sample VBA: Exercise in migrating an RSView32 application with VBA to...
Replies
8
Views
4,906
Hello all, New to the forums here and glad to find this oasis of RSView/FactoryTalk info! I have a basic VB question I hope can be answered...
Replies
4
Views
2,306
Back
Top Bottom