43429members
217967posts

[Imported] Script to generate Crystal Report

Highlighted
Sisko

[Imported] Script to generate Crystal Report

>>Message imported from previous forum - Category:Scripts and Tips<<
User: admin, originally posted: 2018-10-19 19:45:51 Id:160
This is a re-posting from the obsoleted (October 2018) "Schneider Electric Telemetry & SCADA" forum.

-------------------------------

**_Andrew:
Good morning all, i wrote a script that generates and exports a crystal report (that works fine) after the export the script is supposed to change the value of a few points.
ex._**

_call Server.SetOPCValue("1")
Gen.Interface.Generate
Exp.Interface.Export
call Server.SetOPCValue("2")
call Server.SetOPCValue("3")_

**_value 1 changes, but 2 and 3 do not. What am I missing here?
Thanks, Andre_**

-------------------------------

AWoodland:
SetOPCValue takes two parameters, the property you are changing and the value, make sure you provide both.

____________________________

**_Andrew:
Here is a copy of the exact logic i currently have. It's working until i get to
"call Server.SetOPCValue("~HFOTCO.Pipeline.OMNI.Delivery Data.Points.Product Reset", 1)"_**

_sub endBatchNew
DIM Gen, EXP
Set Gen=Server.FindObject("~HFOTCO.Pipeline.OMNI.Reports.Batch.~OutBound Batch Report")
Set Exp=Server.FindObject("~HFOTCO.Pipeline.OMNI.Reports.Batch.~OutBound Batch Report")
if server.thisobject.checkaccess("CTL") = true then
ret = msgbox("Are you sure you want to end the current batch?", vbExclamation + vbyesno + vbDefaultButton2, "WARNING!!!")
if ret vbyes then exit sub
call server.setopcvalue("~HFOTCO.Pipeline.OMNI.Delivery Data.Points.End Batch and Print",1)
Gen.Interface.Generate
Sleep(15000)
Gen.Interface.Generate
Sleep(5000)
Exp.Interface.Export
sleep(1000)
call Server.SetOPCValue("~HFOTCO.Pipeline.OMNI.Delivery Data.Points.Product Reset", 1)

Attached file: (editor/6f/gax8zjmrut0u.jpg), SFC.jpg File size: 22866