RSView32 system\DateAndTimeInteger

tvey

Lifetime Supporting Member
Join Date
Mar 2005
Location
Halifax, NS
Posts
98
Hi folks,

I am using a vba sub in RSView32 to perform some statistical calculations on some tag data contained in a data log.

I would like the operator to be able to specify the interval at which these calculations are performed.

I configured an Event that compares the current value of the "system\DateAndTimeInteger" tag to the value of a tag called "dtLastStatCalcTime" and to the operator's desired interval.

After the calculations are complete, I want to set "dtLastStatCalcTime" to the current value of the "system\DateAndTimeInteger".

I've tried a couple of different methods to set "dtLastStatCalcTime": 1) inside the VBA sub and 2) inside a macro that calls the vba sub.

Both methods exhibit similar behaviour - sometimes the value of "dtLastStatCalcTime" ends up GREATER than the current value of "system\DateAndTimeInteger", and sometimes it doesn't seem to get updated at all! However, regardless of the actual outcome the activity log shows that the tag WAS in fact set.

The simplest test case I can think of seems to have the same problem:

1. Create an analog tag called "nTest". (give it a max value of 2147395600)

2. Add a button to a screen and set the action of the button to "Set nTest system\DateAndTimeInteger"

3. Display, on the same screen, the current value of "nTest" next to the current value of "system\DateAndTimeInteger".

4. Click the button a few times. Sometimes "nTest" will get updated, sometimes it will end up GREATER than "system\DateAndTimeInteger", and sometimes it won't be updated at all.

What am I missing?

-Trevor
 
Trevor,

You might get a better result by creating a Derived Tag called "NTest", instead of a button.

The problem with the button is that it is only updated according to the "Display Settings" of the graphic screen that the button is on. (Click "Edit, Display Settings") Check to see that "Cache After Displaying" is "Yes" and "Always Updating" is checked. Even then a button may not always agree with the last updated value of the System Date and Time value. The screen view of the Date and Time is also only updated periodically.
 
That's essentially what I ended up doing: Instead of trying to snag the current value of the System\DateAndTimeInteger, I created a derived tag that simply increments itself once per second.

After the calculations are complete, I grab the current value of the derived tag for later comparison. RSView doesn't seem to have any difficulty grabbing the current value of the derived tag.
 

Similar Topics

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,885
Hi guys, As above topic, I use RSview32 version 6.4 connect to ten PLC-5/40 on the networks (There are ten direct drivers in RSView32). Scan class...
Replies
6
Views
4,607
There is another problem facing me, i have to develop a project in RSVIEW32 but when i open RSview32 runtime, its open in small window if i run...
Replies
10
Views
7,699
Hi I would like to use a graphics object with color animation to indicate whether the communication line between the plc and the system running...
Replies
2
Views
7,280
Can the RSView32 Active Display System be used only over an ethernet network or is it possible to use it over other AB networks like DH+, DH485...
Replies
1
Views
5,106
Back
Top Bottom