FTView string input VBA Change event

phuz

Member
Join Date
Jun 2008
Location
Mohnton, PA
Posts
1,044
I swear I had this working, but I'm on site deploying this and find it's not working.

I have a string input, exposed to VBA, that has a Change event, but it's not working. I put a temporary MsgBox instruction which won't even execute.
FTView SE 8.2

Code:
Private Sub CanNumber_Change()
Dim FiberType As String
MsgBox ("test")
FiberType = Mid(CanNumber.Value, 6, 1)
Set oTag = MyGroup.Item("ERE_FIBER_TYPE")

If FiberType = "C" Then
oTag.Value = 0
ElseIf FiberType = "G" Then
oTag.Value = 1
ElseIf FiberType = "M" Then
oTag.Value = 2
ElseIf FiberType = "P" Then
oTag.Value = 3
ElseIf FiberType = "T" Then
oTag.Value = 4
ElseIf FiberType = "H" Then
    If Mid(CanNumber.Value, 6, 2) = "HH" Then
    oTag.Value = 6
    Else
    oTag.Value = 5
Else: MsgBox "Invalid Can Number!"
End If
End Sub
 
Last edited:
Error checking. Always include error checking. At least then you can log a diagnostic message to work out why all of your VBA stopped working :ROFLMAO:
 
I have found with FTView that firing off change events on string tags is at best 80% luck. Way back when, while trying to get it to function, I seem to remember that it only fired off of a change in the .LEN field, but I may be mistaken.

My solution has been to just add all the characters in the string to a DINT, and firing my change event off of the DINT tag.
 

Similar Topics

Hi, does anyone know if there is a way to pre-fill the keyboard pop up used to input strings in FTview Studio ME? (v8.0) I have to allow...
Replies
0
Views
2,245
I am creating a global object in FTView SE 13. I want to have a string read from the PLC and display (in this case the tagname). So lets say...
Replies
4
Views
165
G'day all, I'm trying to set up interlock display in FTView (ME, but should apply to SE when I convert to that) in a manner which makes my...
Replies
5
Views
2,569
Hey folks! I've gotten an idea in my head and I'm wondering if anyone can help - and my title is terrible because I'm not good at articulating...
Replies
2
Views
1,029
Hi. I migrated panelbuilder32 hmi to factorytalk view. However character array is not supported in ftview. Appreciate your help how to map the plc...
Replies
2
Views
1,751
Back
Top Bottom