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.