FTVSE Screen-is-live communication form HMI to PLC

coryjs

Member
Join Date
Jun 2022
Location
UT
Posts
3
Story time:
We have two similar machines on a Factorytalk View Distributed Network. This SE server has several different machines on it as well.
For two years this place has had some simple VBA code to constantly flip a bit, functionally this is the HMI telling the PLC when a certain screen is being viewed. If the screen is not being viewed we have the relative PLC’s logic go into a soft fault state to stop motion.

The goal:
I need the two PLCs to know when its specific HMI screen is either not being viewed, or if the HMI PC shuts off due to the PC dying. We need motion to stop if operations loses control. I am hoping to fix my VBA problem or find an alternate solution.

The Problem:
Recently on both machines VBA just kind of stops working. This of course throws the soft fault. I'm not sure how to tell why the VBA doesn't work anymore. Sometimes it runs fine. A minute or a day later it will just stop. We haven't done anything recently to the PLCS. But I do know the SE Server does get security updates occasionally. Could this be DCOM related? If I copy everything over to a test environment on a different HMI and PLC it works fine as it did before.

The Code:
Private Sub NumericDisplay3_Change()

If NumericDisplay3.Value = 1 Then
ExecuteCommand ("Set ::[Mix1]HMI_Heartbeat 1")
Else
ExecuteCommand ("Set ::[Mix1]HMI_Heartbeat 0")

End If

End Sub

-----------------------
If I have tried adding a DoEvents/DoWhile kind of timer to the code to see if that would help. The timer worked on the test environment but was not a solution to the actual machines.

TechConnect Solutions:
I have been reaching out to TechConnect, most of the time they do not understand what I am asking and give some unrelated solution. They suggested using @ispresent but that solution works backwards from what I need. Am I difficult to understand?

The closest solution I got from them was using Derived Tags with an expression to do pretty much the same as the VBA code. "If Heartbeat > 0 Then 0 Else 1". However, I encountered two issues with this:

1. I'm not quite sure how to run this Derived Tags Component only when that specific screen is being viewed. I did see in the screens "Display Settings > Behavior > Commands" that I can startup and shutdown with DerivedOn/Off. Will this command work if the HMI just loses power or does it need a proper shut down?

2. When I went to run the Derived Tags Component I right clicked the component and clicked Start just to test it. Viola! The expression did what I wanted PLC side. I right clicked the Stop on the Components expression... and nothing. It just kept running. I refreshed the screen. I tried stopping it with the screen property derivedoff command. I deleted the component. I restarted the whole distributed server; which worked until the server was back online. Does anyone know what’s going on here? The bit on the PLC just keeps turning off and on, I don't know how to stop the expression.

Conclusion:
So if anyone knows what I should or can do please let me know. I'm not sure how to troubleshoot VBA code. I'm not sure how to stop the derived tag expression. I'm not sure if the derived tag expression solution will work just the way I need it. I'm not aware of better alternatives.

Thanks so much for reading. It's been frustrating getting something so simple to run just right again. Let me know if you need more info. I know FTV 13 has client side tags that may work, but updating to 13 is not yet a possibility.


FTV SE: Version 11, CPR 9 SR 11

PLC: 1756_L72
 

Similar Topics

Hello everyone, Other than the "Find" binoculars, and typing each Display name out one at a time, is there an easier way to see which of the...
Replies
2
Views
402
I am wondering if anyone has created an alarm within a global object via VBA? Yes, I will explain. I have a global object. It references an...
Replies
1
Views
266
I have converted RSV32 to FTVSE Distributed. pretty straightforward... I cant seem to figure out how or find any documentation to migrate RSV32...
Replies
4
Views
2,307
I need your help as I have a factory talk 7 installed on server and 3 clients connected to this server two clients I can read live tags but the...
Replies
0
Views
1,168
Hi I have ALMD within a RS Logic 5000 program, and I have used FTAE to get the alarms displayed onto the alarm banner and is all OK except the...
Replies
1
Views
1,578
Back
Top Bottom