Is there a way to require operator to verify before making a change?

I would like to set some controls so the operator has to verify the change before it is made.

Why? I have some operators that are changing settings (via push button or slider switch) accidentally.

If I can set to 2 step verification on change, this would prevent it.

Hello @tracyfearson,

To do that, you can use MsgBox function to confirm the value.
Like this:

return = Msgbox("Do you confirm this value: " & NewValue & “.”, vbYesNo, “Confirm Message”)
If return = 6 Then
Application.GetObject(“Dados.InternalTag”).Value = NewValue or tag.value
End If

Another option it is use the ESign method.

ESign(ObjName, [Description], [Action], [From], [To], [User], [Comment])
This method is used to validate a field change by using an electronic signature. When this method is used, the dialog box on the next figure is displayed.

Try it and tell me.
Best regards,
Link

Daniel,

Thanks for the help. I have no idea how to get to the Esign.

I have had some success with the MsgBox.

I have a selector button that toggles a value. My operators say they are clicking it inadvertently. Thus, I would like to have a confirmation on it being toggled.

When I double click the button it opens the scripts tab.

I do not see an option for an on click script. My choices are:

OnRelease
OnStartRunning
OnStopRunning

There is a crate new event but it only has 2 options:

Trigger when expression is true
Trigger when expression change

I have went with the event trigger: Whenever the property/expression changes its value

This is the script I am using:

Sub E2Button18_Change in value

’ Displays a MessageBox that asks a user
’ if the new SetPoint value should be used

if value = 0 then

message = "Changed to: " & “Auto” & vbnewline & _
"Was in: " & “Manual” & vbnewline & vbnewline & _
“Do you accept the change?”
If MsgBox (message, vbQuestion + vbYesNo, _
“Validate Event”) = vbNo Then
value = 1
End If

else

message = "Changed to: " & “Manual” & vbnewline & _
"Was in: " & “Auto” & vbnewline & vbnewline & _
“Do you accept the change?”
If MsgBox (message, vbQuestion + vbYesNo, _
“Validate Event”) = vbNo Then
value = 0
End If

end if

End Sub

It kind of works. I get the option box with asking to confirm the change but, it triggers after the change is applied and if you select No, it changes it back.

The preferred would be to have a trigger on click that o0nly changes the value after you confirm.

Is there a way to do this? Is there another spot to enter scripts I am missing?

Thanks.

Hello @tracyfearson,

An option to do that, it is write the value inside the IF.
Something like this:

If MsgBox (message, vbQuestion + vbYesNo, "Validate Event") = vbNo Then
tag.WriteEx 1
else
tag.WriteEx 0
End If

Try it and tell me.

Best regards,
Link

Another idea it is to use an checkbox to enable the button.

image

After the write, the button goes to disable and the user need to check again to execute the OnRelease event.

Sub E2Button1_OnRelease()
'Write the value
Screen.Item(“CheckBox1”).Value = False
End Sub

Best regards,
Link

Daniel,

I am trying to implement the checkbox. I have cut and pasted into the button.

When I open the screen, I get a message:
Error in line 4: 'Invalid character: Screen.item(“CheckBox1”).Value=false (Microsoft VBScipt compilation error)

I cannot seem to figure out what the error is.

Thanks

Daniel,

I have it working nicely now.

My problem was I am using E2Button for my toggle switches. They do not show the full list of event triggers.

I switched to a standard ToggleButton and was able to do:

Sub ToggleButton1_MouseDown(Button, Shift, X, Y)
if value = 0 then

message = "Changed to: " & “Auto” & vbnewline & _
"Was in: " & “Manual” & vbnewline & vbnewline & _
“Do you accept the change?”
If MsgBox (message, vbQuestion + vbYesNo, _
“Validate Event”) = vbYes Then
value = 1
End If

else

message = "Changed to: " & “Manual” & vbnewline & _
"Was in: " & “Auto” & vbnewline & vbnewline & _
“Do you accept the change?”
If MsgBox (message, vbQuestion + vbYesNo, _
“Validate Event”) = vbYes Then
value = 0
End If

end if
End Sub

It works perfectly. Would love to have that function with the E2Button but it does not appear to have that.

1 Like