RSview32 Animation

xian555

Member
Join Date
Sep 2012
Location
Montreal,Qc
Posts
7
Hi,

Trying to animate a tank level, for training purposes, based on fill and empty pumps being active or not. In Wonderware writing scripting is simple, such as :

If ( Filling_Pump_ON) Tank_level = Tank_level + 1;

In this case Tank_level is a local integer, not connected to a PLC register and is used to animate a tank level, only in the RSview screen.

But such a simple script is a real grief for an RSview beginner like myself. How to do this ? Macros don't seem to have such functions ? VBA is a little overwhelming and how to setup up such a simple procedure (subroutine?) . . . .?

Thanks,

xian :confused:
 
RSView32 comes with a separate "animation utility" which is very nice for this type of animation/testing. It runs as a separate program and supplies tags to the RSView32 application. It also has a GUI so you can modify the signals.

One of them I used a lot during development is called sawtooth. The animate utility was much more accurate for timing animations than what you could with the VBA.

Look for the Animate Utility in the Tools area of your program files on the Works PC.
 
maybe this will get you going ...

I don't think a "macro" is going to do what you want ...

look at the "Derived Tags" folder near the bottom of the project organizer ... if you loaded the factory provided SAMPLES (which you should have done) take a look at how the Automotive Motion tag works ...

TIP: don't forget to check in the "Setup" part of the menu at the very top of the screen for how the timing is configured ...
 
Last edited:
But such a simple script is a real grief for an RSview beginner like myself. How to do this ? Macros don't seem to have such functions ? VBA is a little overwhelming and how to setup up such a simple procedure (subroutine?) . . . .?
No, RSView has built-in animation functions for objects. If you already have a variable for "Tank Level" that is correct, then it would be easy to animate a Tank Level display. Here is one way. The level in this tank (burrette tube) is measured based on the weight input from a load cell on the tanks. As the burrette weight input varies from some low number to some high number of kilograms, the RSView tank level display varies from 0 to 100 percent.

EDIT: I think that an expression such as this:
If ( Filling_Pump_ON) Tank_level = Tank_level + 1;

in RSView32 would cause the "Tank_level" integer to rapidly move from 0 to the max vaule allowed in a very short time. It increments on every scan of the program. If you add a time factor so that you only add 1 every 1 second, then it should work fine. RSView32 has some built in timer bits that you could use for that. For example, the system tag "system\Second" counts from 0 to 59 every 1 seconds. For training purposes, you could create a Derived Tag that sets Tank_Level equal to System\Second.

TANK_LEVEL = = system\Second && Filling_Pump_ON

You can AND (&&) other variables to system\Second to turn the tank level count on or off depending on status of another tag for a ON/OFF switch.

RSView32 Tank Animation.jpg
 
Last edited:
here are a few more ideas if you're still having trouble ...

basically set up a new Derived Tag – for example "Tank" ...

use the ideas below to define the script (the one you asked for) and to tell the script how often to execute ...

.

tank_level.PNG
 
you'll also need some way (a macro works best) to tell the Defined Tag when to start running ...

I can't stress strongly enough the importance of working through the factory supplied SAMPLES ... basically just play with them until you find something interesting that you want to learn – then dissect the sample to see how it works "under the hood" ...

I wish you the greatest success with your project ... and welcome to the forum ...

.


startup_macro.PNG
 
Hi Guys,

OkiePC : thanks for the tip on the animation tools, I'll be able to use this for sure on related items.

Ron Beaufort : agree about the Macros not being the way to go. Had tried derived tags but could not get them to work, but thanks to your clip showing an example of how to activate the derived tags (thanks for that tip too), I saw the strange syntax, and it works like a charm

THANK YOU ALL FOR YOUR HELP much appreciate.

Will post another challenging one, also for training purposes, about making sounds.
 
Hmmm . . . spoke a bit too fast.

The tank needs to fill when the Fill_pmp is on, which works, but it also needs to empty when the Feed_pmp, supplied by the tank, empties the tank.

In the Derived Tags file I created a tag Tank_Level and the following expression works fine, at a reasonable pace (0.1 secs):
If (Fill_Pump) then (Tank_Level + 1) else Tank_Level

But when I try to incorporate the other pump can't find a syntax it will accept. Tried these two :

1) a nested if statement :
If (Fill_Pump) then (Tank_Level + 1) else if (Feed_Pump) then (Tank_Level - 1) else Tank_Level

The problem with the above is that if both pumps are active, in place of a steady level that does not change, the level increases, ignoring the Feed_pmp being on. By looking at the structure of the nested if, one can see that this is not the way to go.

2)Two if statements in the expression box of the derived tag Tank_Level:
If (Fill_Pump) then (Tank_Level + 1) else Tank_Level
if (Feed_Pump) then (Tank_Level - 1) else Tank_Level

. . . and the compiler balked at this.


3) Two if statements in a row by repeating in the derived tags file the tag Tank_Level:
If (Fill_Pump) then (Tank_Level + 1) else Tank_Level
if (Feed_Pump) then (Tank_Level - 1) else Tank_Level

. . . which the compiler accepted, but works fine when the pumps are operated seperately; however when the pumps are operated in tandem, the Fill_Pump overrules, and the tank level in place of staying fixed, increases to maximum.

Almost there !!!

Any ideas ??
 
How about something like:
Tank_Level = Tank_Level + (Fill_Pump * 1.0) - (Feed_Pump * 1.0)

If Fill_Pump and Fill_Feed are treated as boolean true = 1, false = 0 in the above expression, this should work. I used a constant 1.0 as the multiplier, but you could adjust that to better match your needs.
 
see if this helps ... it works on my system – and I think it's what you're asking for ...

IF ((Filling_Pump == 1) && (Draining_Pump == 0)) Then (Tank_Level + 1)
Else IF ((Filling_Pump == 0) && (Draining_Pump == 1)) Then (Tank_Level - 1)
Else Tank_Level

and just a word of friendly advice, if you aren't looking through the SAMPLES that came with your software, then you're making this harder on yourself than it needs to be ...

the screen shot below is just taken at random to show some of the stuff that you should be able to plunder around in ...

even without the samples you'll eventually figure out everything that you'll want to do – but the examples that are already available will greatly reduce the time it takes for you to get proficient ...

good luck with your project ...

.

batch_derived_tags.PNG
 
Last edited:
Hi,

Thx for the help all is now working.

Unfortunately, on the other thread (Sound in RSview32, thread#502474) where I inquired about making use of other features for working the audio chanels, no one seemed to have any ideas.

Can any one here help on that thread?

Thx

xian
 
Unfortunately, on the other thread (Sound in RSview32, thread#502474) where I inquired about making use of other features for working the audio chanels, no one seemed to have any ideas.
My idea is "don't do it", but you probably don't want to hear that. I cannot think of a single plant operator that would want to have extra noises in the control room. Process sounds will add nothing to the operator controls, but may be a severe distraction. I suggest that you get some opinions from live hands-on operators before you spend a lot of time on adding sounds to your controls.
 

Similar Topics

Hi I have used a fan object in my RSView32 program. When the input tag to the object is set to 1, the fan is supposed to keep rotating. I tried...
Replies
3
Views
5,253
I'm very new to RSView32 and Im trying to animate a part of a machine that moves left and right (horizontally) on the screen. It's tag is an...
Replies
5
Views
3,965
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
Back
Top Bottom