Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Start a VBScript from code

sbiughy
2017-12-05
2017-12-14
  • sbiughy - 2017-12-05

    I have done a VBScript that works if I launch it by prompt, but if I try to start the script from code I can see wscript.exe starts but looks like that the execution is blocked.

    BR

     
  • eschwellinger

    eschwellinger - 2017-12-05

    Hi,
    which plc are you using?
    Guess an entry in CODESYSControl.cfg

    [SysProcess]
    Command.0=xxxxx
    is probably needed.

    BR
    Edwin

     
  • sbiughy - 2017-12-06

    Thanks for replay,
    I am using a Codesys Control Win V3 on a PC

    BR

     
  • sbiughy - 2017-12-11

    On CODESYSControl.cfg I have this:

    Zitat:
    [SysProcess]
    BasePriority=Realtime
    Command=AllowAll

    Using Codesys 3.5 SP9 Patch8, I have tryed SysProcess library 3.5.7.0 and SyOS23 3.5.8.0 library but each time I can see that starts wscript.exe but is not executed the code inside the script (using the prompt works, so the vbs script is ok).

    BR

     
  • sbiughy - 2017-12-13

    Any Suggestion?

     
  • eschwellinger

    eschwellinger - 2017-12-13

    Hi,
    I would try:

    and check the reaturn value.

    BR
    Edwin

    IMG: SysProcess2.jpg

     
  • sbiughy - 2017-12-13

    Hi,

    using the "SysProcess._" function I got 1 as Result

     
  • eschwellinger

    eschwellinger - 2017-12-13

    Hi,
    and copy your script which you want to execute to the runtime directory.
    BR
    Edwin

     
  • sbiughy - 2017-12-14

    I have attached the vbscript that I want to execute (I have modified the extension from .vbs to .txt due to forum restriction)

    BR

    SendMailCopy.txt [2.61 KiB]

     
  • eschwellinger

    eschwellinger - 2017-12-14

    Hi,

    stop the plc by tasktray, then execute the Control Win in debug mode:
    c:\Program Files (x86)\3S CODESYS\GatewayPLC\CODESYSControlService.exe -d
    check the the log there if you execute your script
    BR
    Edwin

     
  • sbiughy - 2017-12-14

    I have done this procedure, and I don't know why, but if I keep the service in debug mode the script works.
    Whitout the "-d" parameter the service doesn't work
    Launching the script in debug mode doesn't generate any verbose message on debug panel.

    BR

     

Log in to post a comment.