8/21/2020 8:12 PM | |
Joined: 8/24/2011 Last visit: 10/11/2024 Posts: 68 Rating: (2) |
Sorry, i forget this detail Wincc Unified V16 |
8/21/2020 8:58 PM | |
Joined: 12/28/2016 Last visit: 10/28/2024 Posts: 435 Rating: (51) |
In wincc the coding is by vb script and c script and there is no javascript. For more information, please see the following links. Training Manual/Document for learning VB Scripting in WinCC Change bg color via Dynamic VBS script Of course, I think( return value;) in the second line is problematic, but I'm not sure it should be compiled and tested Dim Obj, pdf , msg , ret item.Enabled = False Set Obj = CreateObject("VBScriptLibraryWinCC.dll") HMIRuntime.Trace "Start: " & Obj.GetDateTime() & vbNewline pdf = "<head><style>.test { background-color: linen;color: maroon;}</style></head>" _ & " <body Class=""test""><p><h1>Hello PLC HMI SCADAS</h1>This is html generated with HtmlRenderer.PdfSharp and rendered text with css and image.</p>" _ & " <p><img src=""https://plc-hmi-scadas.com/images/header1280.gif"" height=""100%"" width=""100%""></p>" _ & " </body>" ret = Obj.GeneratePdf(pdf , "C:\\PDF\\CodeHTML2PDF_2.pdf",msg) If ret = -1 Then HMIRuntime.Trace "Error: " & msg & vbNewline End If HMIRuntime.Trace "Finished: " & Obj.GetDateTime() & vbNewline item.Enabled = True |
Last edited by: Madadi at: 08/21/2020 21:02:29Last edited by: Madadi at: 08/21/2020 21:07:55https://pnap.ir |
|
8/24/2020 2:27 PM | |
Joined: 8/24/2011 Last visit: 10/11/2024 Posts: 68 Rating: (2) |
Thanks friend, The code works perfectly. The point is, the code only works in normal mode, simulation mode not work. |
Follow us on