Rsview 32 language problem

harrisoncw

Member
Join Date
Jul 2006
Location
Cape Town
Posts
20
Good day all.



I am having a problem with the language when writing a macro. I am trying to set a string value to a word value. I have tried many combinations without any success. This is how I have been writing it. “ If ( Tag1=130) then (Set Tag2 = "Guard open") Else If ( Tag1=131) then (Set Tag2= "Belt off") Else Tag1 ”.

Is it possible to write it this way or is there a better way

Thanks
Craig
 
A single = sign is an assigment operator. Use a double, ==, for comparrisons. You are also misuing the set command and the assignemnt operator together.


If ( Tag1==130) then (Tag2 = "Guard open")
Else If ( Tag1==131) then (Tag2= "Belt off") Else Tag2 = ""


OR


If ( Tag1==130) then Set Tag2 "Guard open"
Else If ( Tag1==131) then Set Tag2 "Belt off"
Else Set Tag2 ""

If Tag2 is displayed only on a single screen, then I would not make this a macro. I would configure a text object to display the desired text based on the value of Tag1.

In the text object expression field enter:
If ( Tag1==130) then "Guard open"
Else If ( Tag1==131) "Belt off"
Else ""

If it is for display on multiple screens, then I would probably use a derived tag instead of a macro. You will have to specifically call a macro, while a text object and/or a derived tag will automatically update continuously.
 
From memory you can force a tag to a value using either "Set" or "=" but using both is incorrect syntax. Set Tag2 "Guard Open"

Tag2 = "Guard Open"

The "=" command is quicker to execute but I'm not sure that you can use it on String tags. I don't have RSView on any of my PC's any more so I can't verify this. Anyone else........?

Dammit Alaric, don't you ever sleep!!!!!
 
Last edited:

Similar Topics

Does anyone out there have an example of a VBA toggle pushbutton to switch between two langauges??? Any help???
Replies
1
Views
11,046
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
288
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
248
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
807
I have a request to integrate a pause button in RSlogix to be able to start/stop a video. Video format is not defined at the moment, so it could...
Replies
2
Views
794
Back
Top Bottom