9 posts in this topic

Hey guys,

 

I am looking to query a database through FactoryTalk SE.  I will be scanning packages, and using that bar code to find a lane assignment from the database.  

 

My question has to do with where the VB script will reside in the FactoryTalke SE program.  I want this script to run at all times.  I see that each screen has a "VBA Code" but I am assuming that these will only run when the screen is visible.

 

Where does this have to be stored in order to run all the time?

 

Thanks In Advance!

Share this post


Link to post
Share on other sites
On ‎11‎/‎27‎/‎2017 at 10:45 AM, JBird1229 said:

Where does this have to be stored in order to run all the time?

I don't think you can do this. I think in RSView32, the VBA resides separately from any specific screen. But in FTView SE, I think VBA code can only reside in a specific screen or button.

Share this post


Link to post
Share on other sites

AndrewG, thanks for the insight! 

 

I'm guessing I would need write a separate VB application to run behind the scenes while FTViewSE is running and doing its thing.  What do you think?

Share this post


Link to post
Share on other sites
4 hours ago, JBird1229 said:

 

I'm guessing I would need write a separate VB application to run behind the scenes while FTViewSE is running and doing its thing.  What do you think?

Yes it could work. You would need to write a standalone VB application. At one of my old jobs, this was how we did it: CompactLogix PLC, FTView SE HMI, VB .exe application. The PLC communicated with the HMI, and the HMI communicated with the VB application. There was some "heartbeat" logic to make sure that communication was not lost. Not sure of the details because I never worked on the VB application personally.

Share this post


Link to post
Share on other sites

In SE VBA can only run on a client and not on a server and is attached to a specific display object. We handle this by running a "hidden" display behind the main background on one of our clients. Each VBA sub is triggered by an object on this display. For instance the object could be a numerical display with the VBA triggered on any change or an expression can be entered causing the VBA to be triggered at a specific time interval. It is clunky but it works OK and is reliable. We did this to accommodate quite a lot of old VBA code when we migrated from RSView32 to Factory Talk View SE.

1 person likes this

Share this post


Link to post
Share on other sites

Thanks!  I think that both ideas are good.

 

We are planning to write a standalone VB application for our instance.

 

 

Share this post


Link to post
Share on other sites

Hello guys,

Currently, I am trying to do the same thing by running specific VB code to communicate with SQL database continuously in FTSE.

I dont have a lot of experience with VB codeing and wondering if you can guide me through.?

Thank you

Edited by noorloai

Share this post


Link to post
Share on other sites

hmmm... i do not know if that is possible. 

sure one can create object and run some code when that object is interacted with ... but ... that is different from running something continuously.

pretty sure that would require creating stand alone application.

Share this post


Link to post
Share on other sites

I'm not familiar with the VBA Scripting that FTViewSE utilizes, but in straight VB you have a timer object which can be configured "free-wheeling" so that the SQL Interaction triggers ever 1/2 second or so.  Would appear continuous to all but the most observant.

Less elegant but also a solution, you might run a free-wheeling timer in the PLC and let the done bit trigger the SQL Interaction.

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