RobotStudio event

Create module using Webservice?

Hello, How Can I create a new module using WebService?. I found how to load, unload, delete, etc.
Thanks

Jorge Turiel

Answers

  • Hi Jorge, 

    I'm not sure about WebService, I have never used it,
    but the standard Write instructions can be used in RAPID, e.g:

    VAR iodev iod_Dev;
    
    Open "HOME:", \File:="asdtest.mod", iod_Dev, \Write;
    		
    ! Write Doc Header
    WriteString iod_Dev, ByteToStr(37, \Char) + ByteToStr(37, \Char) + ByteToStr(37, \Char) + ByteToStr(0x0A, \char)
    + ByteToStr(0x09, \Char) + "Version:1.0" + ByteToStr(0x0A, \char)
    + ByteToStr(0x09, \Char) + "Language:ENGLISH" + ByteToStr(0x0A, \char)
    + ByteToStr(37, \Char) + ByteToStr(37, \Char) + ByteToStr(37, \Char);
    		
    ! Write Module Title
    WriteString iod_Dev, ByteToStr(0x0A, \char) + ByteToStr(0x0D, \char) + ByteToStr(0x0A, \char)
    + "MODULE asdtest" + ByteToStr(0x0A, \char)
    + "ENDMODULE";
    		
    Close iod_Dev;

    If the file does not exist, the Open instruction creates it. In this case it writes a blank module afterwards.
    Special characters need to be added using ByteToStr. It's not the most eloquent solution, but is there a way you can make a RAPID procedure call using webservice? 

    I hope this helps, 
    Regards, 

    Harry
  • lemster68
    lemster68 ✭✭✭
    These days your modules don't need that header, btw.
    Lee Justice
  • I'm curious, why is that? Or why did they ever need the header? I'd seen it in examples so I've been using it.