Using VBA to run a macro on RSView32

Duganpete

Member
Join Date
Mar 2011
Location
Philadelphia, Pa
Posts
2
I'm trying to write VBA to run a macro in RSView32
The macro sets security tags to 0 and logs the user out of the HMI
I have a trigger bit in a PLC5 processor that is set with time and a few other conditions. but I'm not sure of how to run the macro from the vba code.
Any examples? starting from scratch here. Thanks for reading
Pete
 
Pete,

For the PLC to trigger the code you need to set up an event.

In the attached picture there are several events shown but only 1 is enabled.

The event is triggered on the rising edge of the tag only. This presents a problem if an event is triggered while RSview is responing to another event then the new event will be ignored. That is why the first 4 events in the picture were replaced by a single event with the VBA code determining what actions needed to be taken.

Nick

Capture.jpg
 
Thanks Nick,
yes I have the event. forgot to mention that part, sorry.
So in the event, on the rise of the expression tag, the event runs an action.
The action is (VbaExec (Sub procedure)), this runs the VBA code.
So Within the VBA code I need to run a macro called sec0 on the running RSView32 project (SameHMI) The VBA code example is what I was looking for.
Any Ideas?
Thanks
Pete

PDF link
https://drive.google.com/file/d/0Byszqlog1B1KU2ZQOXo0U2hEMFk/edit?usp=sharing
 
I don't think I've ever run a macro from VBA. Is there some reason why you don't want to call the macro directly from the event? Another alternative might be to code the actions of the macro in the VBA code.

Nick
 

Similar Topics

Hi, Can someone guide me through how to use FactoryTalk SE VB script to open communication with SQL Server? which command I can use? Are there...
Replies
2
Views
2,293
Hello Every one, I need a help on vba code for getting data from MSSQL server 2014 to display in FTview SE client version 12 . Thanks. Please...
Replies
4
Views
1,814
Hi, how can i use a defined Tag in HMI Tags (for exampele dintTag ) in VBA code by a display. i am using FactoryTalk SE thanx
Replies
1
Views
2,226
I am trying to open a single display for multiple messages. I understand that I can use parameters to load different messages etc but would like...
Replies
0
Views
1,227
Hello, I am looking for help writing to PLC tags from Excel. I am using Factory Talk Gateway as an OPC server and Excel VBA to write out to an...
Replies
5
Views
3,102
Back
Top Bottom