Sign in to follow this  
Followers 0
Jake104

FTview 7.0 - general VBA module for the project

4 posts in this topic

I would like to have a general VBA module with general routines that I share between displays.

When I e.g. create a button on a display and open the VBA for this button, then I can insert a module and write functions and procedures that I call from this button.

But this module is nested below the particular Display - and not accessible to other Displays.

Is there a way to access this module across all displays?

Share this post


Link to post
Share on other sites

You can share any HMI tag with the PLC, so you can easily share HMI tag status with the PLC.

Attached is an old (Micrologix/FTView 6 or 7) work instruction to add a HMI-PLC heartbeat.  If you can code in a macro the information needed, this information can easily be shared with (and controlled by) the PLC.

Note that for this example, the HMI-PLC heartbeat macro runs on HMI startup.

Work Instruction - Allen-Bradley HMI-PLC Heartbeat.doc

Share this post


Link to post
Share on other sites

I think we are not talking about the same thing.

I want to have a VBA module (MyRoutines) with my own standard functions.

These functions must be available to VBA modules in all my displays - therefore MyRoutines must be generally available and if I use one of the functions then it should jump to MyRoutines if I press Alt-F2 when the cursor is on the procedure name.

It has nothing to do with the PLC - it's purely a HMI-VBA issue.

Share this post


Link to post
Share on other sites

If you have a display that is always present (such as a menu button display), the code can reside there.

Be sure to open the display with the /ZA switch so the code is continuously available and objects capable of changes.

That it will make it available for VBA calls based on an event (such as a tag change).

As in my answer to your other VBA-related question, you can use one or more numeric inputs that have been exposed to VBA to fire the VBA Event code.

If you want to tie it to key combinations, use those key combinations to change the values for the

tags used to raise the events. So you will need to create a 'Client Keys' file for configurating your keyboard combinations.

 

1 person likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0