WinCC how to know if running on a PC or Panel

Willheisen

Member
Join Date
Feb 2016
Location
FR
Posts
39
Hello everyone!

In WinCC, when you want to read or write a text file using VB script, it's not the same way to deal with on a PC or on a Panel (ex: TP1500 Comfort), you have to use different functions.

So I'd like to know if there's a way to know if the project is running on a PC or on a panel.
The Vb functions related to the system seem poor when you want to get system information.
 
https://cache.industry.siemens.com/dl/files/640/73453640/att_67202/v1/WinCCInformationSystemScripting_en-US.pdf

VBS and C
VBScript can be used in WinCC parallel to C-Script, but do not mix the script types:
● VBScripts and C-scripts can be configured within a picture and project.
● C-scripts cannot be invoked in VBScripts and vice versa.
● VBS provides internal interfaces to tags and picture objects while the C environment
enables access to other WinCC subsystems (e.g. the report system).

VBS and VBA
VBA is used in WinCC Configuration during the configuration in order to adapt Graphics
Designer to your individual requirements and to simplify and automate configuration. VBA programs only run in the WinCC configuration environment.
As opposed to VBA, VB scripts only run in WinCC Runtime and, from there, enable access to graphic objects and tags. Objects and pictures can be neither created nor modified on a permanent basis in VBS, as opposed to VBA.

I would check out the C-Script information from the following link:
https://support.industry.siemens.com/tf/WW/en/posts/c-instructions-used-in-wincc/35966?page=0&pageSize=10

Hope this helps you out.
Regards,
 
Thanks gclshortt, but the client bought WinCC Advanced, which doesn't support C scripts (only Professionnal version can handle that).:confused:
 
I"m a bit confused about your question.

When you set up the HMI, you select what HW it will be on. The capabilities of the Basic vs Comfort vs PC based panels are different, and it will only allow you to use the capability of the model you select.

It should detect an error in one of your scripts when you try to compile the HMI, if it is written with commands the platform doesn't support. This may come up if you change device from one platform to another.

It would probably make sense to have two panels in the same project, one in Comfort and one PC based. You can then keep the scripts separate, but change device as needed to change screen sizes within the same HW family.
 
It should detect an error in one of your scripts when you try to compile the HMI, if it is written with commands the platform doesn't support. This may come up if you change device from one platform to another.
That's the way I think I will solve the problem.

In the project, I only have a TP1500. The problem was when I used the simulation (for debugging) on the programmation PC, some errors appeared, related to the fact the functions used in my VB script didn't work on the PC, but only on the TP.

I will try to get the error number related to the device to know if I'm on the programmation PC or on the panel.
 
When compiling VBS code for example for accessing the Windows CE file system (CreateObject("filectl.file") etc..) when the target platform is a PC RT, then there will be no compiling errors to indicate that the Object type is not supported on the platform.

For detecting the type of Windows at runtime, maybe you can use this:
http://stackoverflow.com/questions/1749557/detect-windows-ce-in-vbscript-logon-script
edit: Just checked if the in the above linked example code (using WMI object) is supported on windows CE. It is not.
So it will not be possible to use as a way to detect Windows CE in a controlled manner.

But you can also simply have an internal tag "windows_CE", set or reset it manually via a button, and then test your VBS code.
 
Last edited:

Similar Topics

How can you tell if it's running? Do I need to open all logs first? I have the same questions as this post. The answers here are in German, or...
Replies
2
Views
1,626
Hello folks, does anyone of you experienced running two different WinCC Flexible Runtime projects on single PC with two monitors (extended...
Replies
9
Views
9,502
Does anyone know how to keep WinCC from loading all those behind the scenes services, etc from loading and running in the background at startup...
Replies
3
Views
4,672
I am novish in PLC. How can i understand that in my wincc computer OPC client or server is working? Why i asked this is , some signal are coming...
Replies
2
Views
4,880
In our production plant we have multiple different networks (subnets). IT dept have setup routing between them so different subnets can...
Replies
0
Views
49
Back
Top Bottom