Cimplicity MsgBox Script Help

Sapper307

Member
Join Date
Nov 2017
Location
Maryland
Posts
107
All,

I'm having an issue properly executing a script in Cimplicity. I want to execute a temporary push button, and that part of my script is working fine:

'set the point
Pointset "TAG", 1

'wait 1 second
Sleep 1000

'release the point
Pointset "TAG", 0


that part is working properly throughout (Cimplicity, PLC, interposing relay all pick up for one second). My issue is that I wanted to encapsulate that script in a MsgBox, so the operator has an opportunity to cancel the command. My script has the MsgBox (ebYesNo) pop up, and the yes button executes the script, however the no button also executes the script.

Yes and No buttons execute script:

Sub OnMouseUp (x As Long, y As Long, flags As Long)
MsgBox "OpenV-FG30-1?",ebYesNo,"V-FG30-1"

If ebYes Then
'set the point
Pointset "TAG", 1

'wait 1 second
Sleep 1000

'release the point
Pointset "TAG", 0
End If
End Sub


Any help on pointing me in the right direction of getting the no button to properly function would be great.

Thanks
Chris
 
It sounds like you want a confirmation screen. It has been a long time since I used Cimplicity but I thought it had a confirmation checkbox. Then you enter you message for confirmation. Yes would execute the script and no closed the message box.

But again it's been a long time since my last project.
 
The confirmation check box is an option when you create the Event as a Procedure. If you create the event as a script, you have to execute everything in the script including message boxes etc. My problem with executing the Event as a Procedure is that I need the 1 second temporary push button, which is not an option in Procedures.
 
EUREKA!



Sub OnMouseUp (x As Long, y As Long, flags As Long)
Result= MsgBox ("OpenV-FG30-1?",ebYesNo,"V-FG30-1")

If Result=6 Then
'set the point
Pointset "TAG", 1

'wait 1 second
Sleep 1000

'release the point
Pointset "TAG", 0
End If
End Sub
 

Similar Topics

Hi all, I am having issues accessing my Cimplicity software - the site code changed after re-install and I am no longer able to attain a new key...
Replies
10
Views
158
Hello everyone! This is my first time posting, though I have been to this site a few times hunting for some random problem like we all do. I...
Replies
4
Views
173
Hi good day Everyone, I have a cimplicity v10 project with 7 to 8k tags communicating with AB PLC through OPC and Rslinx classic. I have this...
Replies
3
Views
217
Hi All, I am trying to program some new Versamax micro PLCs through PAC using some programs saved in our archive however whenever i go to import...
Replies
2
Views
123
Hi All, Im using Cimplicity 8.2. after the last restart Server Scada, the PTDL_RP process can not running. so Process can not be login to database...
Replies
2
Views
158
Back
Top Bottom