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

How to implement IVisuStreamReader

ryusoup
2023-03-01
2023-03-02
  • ryusoup - 2023-03-01

    Hello,

    I am working on downloading a file exists on remote controller over WebVisu.
    Following the file transfer example , I prepared a FB implements IVisuStreamReader to use file transfer feature on Visu as the screenshot attached, and it works with some small files enough to read whole content in 1 scan.
    But with larger file, downloaded file contains only the end part of the original file.

    Does anyone know how to fix this?

    Best regards,

     
  • ryusoup - 2023-03-02

    Self resolved.
    Changing

    readLen := SysFileRead(hFile:=hFile, pbyBuffer:=pbyBuffer, ulSize:=udiMaxNrBytes, pResult:=ADR(error));
    

    to

    readLen := SysFileRead(hFile:=hFile, pbyBuffer:=pbyBuffer, ulSize:=udiMaxNrBytes-10, pResult:=ADR(error));
    

    cleared the problem.
    But still, I don't understand why that happens.

     

Log in to post a comment.