Wincc Flexible Advanced 2004 Issue

Rookie_Eng

Member
Join Date
Sep 2005
Location
Mass
Posts
19
Not sure how many people are using Wincc Flexible yet but I am developing an application that will be implemented on a PC. I am trying to utilize the "MsgBox" command in a VBS script. Within the script the command is recognized by the compiler since the syntax pop up box appears but when checking syntax it states that the VB function is not supported on this device. I would think that an application on a PC would support this command as opposed to a touch panel.

I contacted Siemen's tech support and agreed with my logic that it should work. They forwarded the issue off to Germany. Its already been a week with no reply.

I was wondering if anyone has used this command within VBS for Flexible and am I completely wrong to assume this command would be supported for a PC.

Any feedback would be appreciated!
 
I have not had any luck with msg box's. I did get a file open/save box to work by using windows API calls. If you get a message box to work I would love to see it.
 
Here is the code I used for the File Save dialog. Maybe this will help.


Dim file_name , myvar, fso
Set myvar = CreateObject("SAFRCFileDlg.FileSave")
myvar.FileType = "txt"
myvar.OpenFileSaveDlg
SmartTags("File_Name")= myvar.FileName & ".txt"
 
A solution to the problem

Charles,

Here is the code they forwarded me. From what I was told they did it in Protool and imported into Flex. It still does not answer why Flex didnt directly support the command for "MsgBox" but this code does work. Also, I weeded out all the German comments.

Dim WSHShell,Text,Time_in_s,Title,Buttons, Ruckgabewert



Text = "Displayed Text in the Box" 'displayed text in the box



Time_in_s = 10 ' display duration in seconds



Title = "Title of the Dialog Box" ' Title of the dialogbox



Buttons = 51 'The values for symbols and buttons in the messagebox must be added

'51 = exclamation mark (symbol) + Yes + No + Abort (Buttons)



Set WSHShell = CreateObject("WScript.Shell")



Ruckgabewert = WSHShell.Popup (Text,Time_in_s,Title,Buttons)



'call the PopUp-method as function, that you can analyse the return value





'Used storage will be freed



Set WSHShell = Nothing
 
For the same issue in ProTool I use the attached MsgBx activeX program to utilize the built in Windows popup (Run it on your PC and the ActiveX will be available from ProTool. I got this program from Siemens Tech Support about 2 years ago. To simplify things I this function script to parse thi parameters.
Code:
  Case "VBCRITICAL"
		buttons = 16
  Case "VBQUESTION"
		buttons = 32
  Case "VBEXCLAIMATION"
		buttons = 48
  Case "VBINFORMATION"
		buttons = 64
  Case Else 
End Select

If buttons < 4096 Then
	buttons = buttons + 4096
End If

Dim oCls, res, Answer
Set oCls = CreateObject("Project1.Class1")
oCls.MsgBx prompt,buttons,title,Answer
Set oCls = Nothing

Popup = Answer
I call this function scrip "popup" it accepts prompt, buttons, & title as input parameters and returns a value. The parameters are the standard VB input and return values.

And call it like this:
Code:
If Pump_Run = true Then
	Answer = PtScp.Popup("This Will Discontinue This Test Immediately Without" _
	& "  Completing.", 49, "CONFIRM STOP")
	If Answer = 1 Then
		Pump_Run = false
	End If
Else.....

Hope this helps
 

Similar Topics

Hello, I do not know why but i cannot make a faceplant in WinCC. Normalny i should make it by marking buton or whatever and chose option "create...
Replies
2
Views
1,891
Hi all! Suddenly, I can not connect any PC HMI application to S7-1200 (6ES7 214-1AG31-0XB0) via Ethernet. Both HMIs, WinCC Advanced V11 SP2, and...
Replies
2
Views
8,960
Hi. We purchased SIMATIC WinCC flexible 2008 Advanced SP3 and I am not able to install it. Details: - Desktop w/Intel Core2 Duo E8400 3.00 GHz...
Replies
4
Views
19,337
I have a device that is running an OPC Server. I need to get about twenty real values from this device and display them in WinCC flexible advanced...
Replies
1
Views
6,106
Hi! I shall connect my s7 1200 CPU with a computer. I have wincc flexible advanced and I have made my program. I found on the siemens site how to...
Replies
2
Views
5,166
Back
Top Bottom