about simatic protool/pro

bleach

Member
Join Date
Jul 2007
Location
Jeddah
Posts
61
hi every body
i am working on SIMATIC Protool, i want to ask
how to make a pop up window for an object (pump for example) so when i press the pump a pop up window will appear so i can control the pump from that window.
thank you
 
Hi bleach.

In principle it is not possible, Siemens has blocked the messagebox object in Protool and WinCC Flexible.

However, I know some people use the WScript.Sehll object in stead:
http://msdn.microsoft.com/en-us/library/x83z1d9f(VS.85).aspx
With this you can call the "popup" method.

Something like this maybe:

Code:
Dim shellobj, UserReturnval
Set shellobj = CreateObject("WScript.Shell")
 
UserReturnval=shellobj.Popup ("Are you sure?",,"Start",)
 
If UserReturnval=1 Then 
  Set_bit(biStartTag)
End If
 
Last edited:
You could also add an invisible button over the Pump and switch to another screen where you can control the pump.
 
The WScript.Shell method that Jesper described will work simular as a regular windows message box but only on a pc based system (ProToolPro).

I advice you not to use this method for the following reason.

In Protool you can only execute one script at a time and the popupmessage will queue up all other scripts until you accept the message. And if you click somewhere else on the screen with the messagebox displayed it will hide behind the ProTool screen and all other scripts will get queued until you click the message box that you cant see!!!!! You can add a timeout to the messagebox but then the operator might get confused if he sees a popup box that suddenly disappears in front of him.
 
Last edited:
Hi Bratt.

Your concerns are valid, but I know that the following is true for WinCC Flexible, and maybe also for Protool.

The number of scripts that can run simultanously is 20.

The messagebox will stay in front even if you click besides it.

It is a good idea to put the timeout, 5-10 seconds for example. The trick is to trigger another messagebox with a message like "Timeout - no action done", and this should have a short timeout of for example 2 seconds.
 
I have gone as far as to create an image of the screen and use it as a background for a new screen. I then draw a box (making sure to obscure all touch controls on the original screen) to simulate a popup with the desired info. I then just switch to/from this screen and it looks like a popup comes up.
 
Commenting on my own musings:

JesperMP said:
The number of scripts that can run simultanously is 20.
Actually, the number of scripts that can be queued are 20. So if it is a problem that a script does not execute immediately, then you can indeed not use the WScript.Shell method.

JesperMP said:
The messagebox will stay in front even if you click besides it.
Here, the trick is to add 4096 to the type. If you need a Yes/No box which is type 4, then write 4096+4 where you specify the type. The box will then stay in front.
 
I just made a test out of pure interest.

The code is a script for WinCC Flexible. It will display a Yes/No popup box. If the user does not click "yes" within 10 seconds, it will time out with a message "Timeout, nothing done".
The neat thing is that it uses parameters for the tag, the value that must be set, and the header over the popup box.
So you call the script and specify the tag name (simply write it as a string without quotes), the value to set, and the header string (without quotes).
In this way, you can use it in a reusable way without having to write a new script each time you want to display the popup.

Parameters of the script:
strTagname
strHeader
iValueToSet

Code:
Dim shellobject,iUserReturnVal,shellobject_message
 
Set shellobject = CreateObject("WScript.Shell")
Set shellobject_message = CreateObject("WScript.Shell")
 
'Possible popup box variants are: 0=OK, 1=OK+Cancel, 2=Abort+Retry+Ignore, 3=Yes+No+Cancel, 4=Yes+No, 5=Retry+Ignore
iUserReturnVal=shellobject.Popup ("Set " & strTagname & " to " & CStr(iValueToSet) & ". Are you sure ?", 10 , strHeader, 4096+4)
 
'Possible returnvalue variants are: 1=OK, 2=Cancel, 3=Abort, 4=Retry, 5=Ignore, 6=Yes, 7=No, -1=timeout
If iUserReturnVal = -1 Then
	shellobject_message.Popup "Timeout, nothng done",2 ,strHeader, 4096
Else 
If iUserReturnVal = 6 Then
	 SmartTags(strTagname) = iValueToSet
	End If
End If
 
If iUserReturnVal = 7 Then
	shellobject_message.Popup "Aborted",2 ,strHeader, 4096
End If
I think it can be adapted to Protool without too much trouble.

As Bratt warned about, you should not use this method if you use scripts for other purposes.

edit: Made the popup box display a more informative text.

popuptest.GIF
 
Last edited:
JesperMP said:
Here, the trick is to add 4096 to the type. If you need a Yes/No box which is type 4, then write 4096+4 where you specify the type. The box will then stay in front.

4096 you say dident know that. You learn something everyday.

I'll still go with Desert Dogs idea or use the hide/unhide attributes on some buttons if its about controlling a pump even though your example is nice. A big invisible button alignend between your regular controls and the buttons you hide/unhide will prevent the operator from pressing anything else.
 
Here is a listing of socalled "vb constants" that are interesting for the messagebox:

# MsgBox Codes
vbOKOnly = 0 # OK button only (default)
vbOKCancel = 1 # OK and Cancel buttons
vbAbortRetryIgnore = 2 # Abort, Retry, and Ignore buttons
vbYesNoCancel = 3 # Yes, No, and Cancel buttons
vbYesNo = 4 # Yes and No buttons
vbRetryCancel = 5 # Retry and Cancel buttons
vbCritical = 16 # Critical message
vbQuestion = 32 # Warning query
vbExclamation = 48 # Warning message
vbInformation = 64 # Information message
vbDefaultButton1 = 0 # First button is default (default)
vbDefaultButton2 = 256 # Second button is default
vbDefaultButton3 = 512 # Third button is default
vbDefaultButton4 = 768 # Fourth button is default
vbApplicationModal = 0 # Application modal message box (default)
vbSystemModal = 4096 # System modal message box
vbMsgBoxHelpButton = 16384 # Adds Help button to the message box
VbMsgBoxSetForeground = 65536 # Specifies the message box window as the foreground window
vbMsgBoxRight = 524288 # Text is right aligned
vbMsgBoxRtlReading = 1048576 # Specifies text should appear as right-to-left reading on Hebrew and Arabic systems

I think that it will be clever to add 256 as well as 4096 because then the "No" button will be the default.
And adding 48 will display a warning triangle.

This is how the final code looks like:
Parameters are
strTagname
strHeader
iValueToSet
Code:
Dim shellobject,iUserReturnVal,shellobject_message
 
Set shellobject = CreateObject("WScript.Shell")
Set shellobject_message = CreateObject("WScript.Shell")
'Possible popup box variants are: 0=OK, 1=OK+Cancel, 2=Abort+Retry+Ignore, 3=Yes+No+Cancel, 4=Yes+No, 5=Retry+Ignore
iUserReturnVal=shellobject.Popup ("Set " & strTagname & " to " & CStr(iValueToSet) & "." & vbCrLf & " Are you sure ?", 10 , strHeader, 4+48+256+4096)
'Possible returnvalue variants are: 1=OK, 2=Cancel, 3=Abort, 4=Retry, 5=Ignore, 6=Yes, 7=No, -1=timeout
Select Case iUserReturnVal
 Case -1 shellobject_message.Popup "Timeout, nothing done",2 ,strHeader, 4096
 Case 6 SmartTags(strTagname) = iValueToSet
 Case 7  shellobject_message.Popup "Aborted",2 ,strHeader, 4096
 Case Else shellobject_message.Popup "Wscript.Shell popup code error." & vbCrLf & "Returnval = " & CStr(iUserReturnVal),2 ,strHeader, 4096
End Select
 
hi again
frankly speaking i am a begginner in protool and i am working on RO project, when i press any of the pumps a pop up window will apear with 3 buttons (run, stop and trip) such a thing is easy to do in Win CC. i hope it is in protool.
for me i have neverused WScript.Sehll, but it look intrested.
thank you every body
 
For 3 buttons with a different meaning than the ones that are available in the standard message boxes, you have to do it in a different manner.
It is not possible to create a popup window for each pump. Protool simply does not have this functionality.
The closest thing is to create a "window"-looking rectangle with the required buttons, and which is turned on and off with vsibility animation. The buttons of the window can then be assigned multiplexed tags. See Protool help for more details on multiplex tags. You also need a visibility tag for the show/hide animation.
When you click on a pump, the "index tag" must be set to point to the pump AND the visibility tag must be set to "show".
When you click on a button on the "window", the multiplex tag is set AND the visibility tag must be set to "hide".
 
hi Jesper

i have more than 18 pumps, are u saying that i put them in one screen (control room for example). if this the only way. since i am using MP370 15" touch.... the space is limited...
thank you
 
MP370 !
Aha, I thought it was a PC RT because you mentioned Protool Pro and WinCC.
In that case you cannot use scripts anyway. (You CAN do scripts on a CE based panel, but I dont recommend doing very complex stuff, and wscript.shell is not available).

I think you can fit the 18 pumps on one screen, and use the multiplex tags as suggested. The difficulty is navigating the screen without a mouse cursor, it will require a lot of navigating with the TAB-key.edit: I just see that it is a Touch screen, so that is not a problem.
 
Last edited:

Similar Topics

I am in the process of moving software from one laptop to another. So far everything is going OK except I can't find the Siemens Simatic...
Replies
0
Views
1,590
Does anyone know where I can download the Simatic ProTool software? Thanks.
Replies
5
Views
1,514
Hello All I need to get the Backup of TP170A for this I tried PROTOOL and PROSAVE and configured communication parameters via COM1 Gives Error...
Replies
0
Views
3,033
Hi all, I am using Protool 6.0 with Step 7 V5.3 and Simatic S7 300. The problem is that in Runtime mode when I push switch button to ON position...
Replies
1
Views
2,691
hello, In my office several people are having problems installing Simatic, WinCC flexible and Protool on the same computer. Some are using...
Replies
3
Views
3,846
Back
Top Bottom