[?]: TIA Portal/ WinCC Flex script problem

SIMATIC S7-200/300/400, Step7, PCS7, CFC, SFC, PDM, PLCSIM,
SCL, Graph, SPS-VISU S5/S7, IBHsoftec, LOGO ...
Homeroid_BL
Posts: 258
Joined: Fri Apr 03, 2009 3:24 pm
Location: Bosnia and Herzegovina

[?]: TIA Portal/ WinCC Flex script problem

Post by Homeroid_BL »

Hi all!

I have Windows7 Ultimate OS and WinCC Flexible 2008SP2, and TIA Portal V11 SP2 installed.

But, scripting does not work neither in WinCCFlex neither in WinCC Advanced V11.

Scripts like this, that worked before, now do not work.

Code: Select all

Sub Podizanje()
Dim fso, DatSet
Set fso = CreateObject("Scripting.FileSystemObject")
Set DatSet = fso.OpenTextFile ("D:\Temp\Parking\Postavke\Settings.txt")
If (fso.FileExists("D:\Temp\Parking\Postavke\Settings.txt")) Then
	SmartTags("Sys_Parking_Grad")=DatSet.ReadLine
	SmartTags("Sys_Parking_Naziv")=DatSet.ReadLine
	SmartTags("Sys_Parking_Adresa")=DatSet.ReadLine
	DatSet.Close
Else
	SmartTags("Sys_Parking_Grad")=""
End If
Set fso = Nothing
End Sub
Debuggers indicate line 2 (Set fso = CreateObject("Scripting.FileSystemObject")) as a problem.

What is wrong?


Thanks!
Lepes9
Posts: 17
Joined: Fri Sep 24, 2010 10:03 pm

Re: [?]: TIA Portal/ WinCC Flex script problem

Post by Lepes9 »

Hi Homeroid_BL!


Was the previous OS Windows XP?


Greets
L9
Homeroid_BL
Posts: 258
Joined: Fri Apr 03, 2009 3:24 pm
Location: Bosnia and Herzegovina

Re: [?]: TIA Portal/ WinCC Flex script problem

Post by Homeroid_BL »

Hi L9!

No, it was always Win7 Ultimate.
On this laptop it is not possible to instal WinXP.
Homeroid_BL
Posts: 258
Joined: Fri Apr 03, 2009 3:24 pm
Location: Bosnia and Herzegovina

Re: [?]: TIA Portal/ WinCC Flex script problem

Post by Homeroid_BL »

Sorry, sorry...
I just remembered that in fact I never used scripts in Win7. I used it only in XP SP2 and Vista (only for WinCC Flex, since TIA10.5, valid for that OS, does not support scrtipts), and it worked fine there.
Lepes9
Posts: 17
Joined: Fri Sep 24, 2010 10:03 pm

Re: [?]: TIA Portal/ WinCC Flex script problem

Post by Lepes9 »

Hi Homeroid_BL!


I think it is because Microsux tightened the user rights in Windows 7. Maybe the user doesn't have enough rights to create/write a file. (On Win7 is an administrtator is not equal the Administrator.)
I hava a similar problem: I use a script on my PC to change the proxy-settings in the browers and to launch some programs depending on where I am (in the office or at home). The same script worked fine in WinXP and has errrors in Win7.

Code: Select all

Set wshShell = CreateObject("WScript.Shell")
wshShell.Run "C:\Program Files\someapp.exe"    <- this line causes an error
I hope I could help you a little bit. (At least with some ideas to continue searching for a solution for you problem.)


Greets
L9
Homeroid_BL
Posts: 258
Joined: Fri Apr 03, 2009 3:24 pm
Location: Bosnia and Herzegovina

Re: [?]: TIA Portal/ WinCC Flex script problem

Post by Homeroid_BL »

Yesterday evening worked, now it's not working.
Dear Simenes, how do you expect that someone PAYS for this TIA V11 shit?
Homeroid_BL
Posts: 258
Joined: Fri Apr 03, 2009 3:24 pm
Location: Bosnia and Herzegovina

Re: [?]: TIA Portal/ WinCC Flex script problem

Post by Homeroid_BL »

It is working today, grrrrrr..... But I do not know why..
Homeroid_BL
Posts: 258
Joined: Fri Apr 03, 2009 3:24 pm
Location: Bosnia and Herzegovina

Re: [?]: TIA Portal/ WinCC Flex script problem

Post by Homeroid_BL »

Lepes9, you were right. Something in Win7 'locks' target file and prevents script to be executed.
Deleting target file and restoring then from Recycle bin, helped and script can be executed.