RSVIEW? Changing the X scale on TrendX- HOW??

AndrewB

Member
Join Date
Aug 2003
Posts
165
Hi all.

What i am trying to do is set the x scale (hours) of a TrendX object to match a production run time which is stored in a Tag.


If anyone has a better idea of how to do this i would appreciate it






We have this little vba script from the help files which we cannot get to work...........

Private Sub ViewOneMinute()
Dim x As XAxis
Dim s As String

Set x = RStrendX1.XAxis
s = "Time Span was " & x.Timespan & " seconds"
MsgBox s, vbOKonly

x = TimeSpan = 60
End Sub

What we have done is the following


Public Sub K22_Chart() 'rsview wouldnt see the the vba script to run it when it was private

Dim x As Xaxis <---- says user defined type not defined.

We cant get past this... Is there any other way?
 
Is RSTrendX included in the VBA Project?

The code you posted only works with the trendx component.

Private works fine, no need to make the function public.

This line is definately wrong:
x = TimeSpan = 60

You probably meant
x.TimeSpan = 60
to set the x axis to be 60 seconds.

I've even typed in your code to test it, and it works on a trendx display for View SE; sorry I can't test it in View32, but I'm too lazy to load it right now :)
 
You could also try downloading the TrendX wrapper from RA; that gives you a huge number of new methods for TrendX and one of them can be used to set the timespan via the invoke command (xaxis_timespan I think but I can't check right now).
 
your right rdrast, that was a typo :)

yes it is a trendx object, i think my problem seems to the the trendx object is not being associated with the vba script.

Using the rockwell example on trendx and looking in there vba, xaxis appears as a date type you can dim as, where in my project it is not.

I would rather steer clear of vba at all costs as its certainly not one of my strong points.

I am going looking for Trendx wrapper now:)

thanks guys!!!
your lots of help!!
 
its all good!


Thanks for the help finding the hidden menus :)


i wonder how people managed to do this stuff before the internet was around....
 
Andrew, Are you running View32? or SE?

You might not have the actual trend object included in your list of VBA Objects for the form, that would prevent VBA from understanding the XAxis type.
 
im running RSVIEW 32 but ive only done training on RSVIEW SE
its just enough different to run into minor issues

i had some issues finding the trenx wrapper object, but eventually worked out you right click the active x box and add a new one and pick it from the list.

this might have been why the vba wasnt seeing the xaxis data with out the wrapper activex

its all working great now..
V happy.

this has been the only hang up with this project.
 

Similar Topics

Hi you all PLC masters...:site: Yesterday I wanted to change the time of my project to 4 minuts behind from the current time. I saw the tag as...
Replies
4
Views
3,580
Hi you all PLC masters...:site: Yesterday I wanted to change the time of my project to 4 minuts behind from the current time. I saw the tag as...
Replies
0
Views
2,896
Hello fellow wirenuts, I am looking to find the P.B. touch indicator option on version 13.00 and failing. It has been a year or so since I last...
Replies
9
Views
327
Hello, I have converted RSView 32 to FTView SE 14 (I have tested FTView 12 before as well and there were some difficulties so I moved on to...
Replies
4
Views
270
Okay, something I have not seen before.. RSView SE. I am working on an existing project. There is a value the customer wants trended and it is...
Replies
4
Views
820
Back
Top Bottom