Jump to content

hofzge

Members
  • Posts

    5
  • Joined

  • Last visited

Posts posted by hofzge

  1. Well I see a GZipStream in there, but not knowing the actual language you use it is hard to judge what specifics that may imply. Are you sure you did proper preparation of the byte stream, namely first removing the "Zipped:" string from the stream and then doing the correct Base64 decoding before trying to pass the resulting byte stream to the GZIP function?

    Thanks - being an idiot i forgot to convert from Base64 to String and this helped.

  2. Sorry for being so cryptic: What i try to replace is this:

    1. # Converts from base64 to binary   
    2. function ConvertFrom-Base64($string)    
    3. {   
    4.    $bytes  = [system.Convert]::FromBase64String($string);   
    5.    $decoded = [system.Text.Encoding]::UTF8.GetString($bytes);    
    6.    return $decoded;   
    7. }   
    8.   
    9. # Does buffered read of all bytes from a stream   
    10. # returns a char array   
    11. function ReadAllBytes($stream)    
    12. {   
    13.     $buffer = New-Object byte[](4096)      
    14.     $ms = New-Object System.IO.MemoryStream   
    15.   $bytesRead = 0   
    16.   do   
    17.     {   
    18.         $bytesRead = $stream.Read($buffer, 0, $buffer.Length)   
    19.     if ($bytesRead -gt 0)   
    20.     {   
    21.       $ms.Write($buffer, 0, $bytesRead)   
    22.     }   
    23.   } while ($bytesRead -gt 0)   
    24.   return [system.Text.Encoding]::UTF8.GetChars($ms.ToArray())   
    25. }   
    26.   
    27. # Removes 'Zipped:', Converts from base64 and unzips   
    28. function FromBase64AndUnzip($string)   
    29. {   
    30.     $string = $string.Replace("Zipped:""")   
    31.     $dataBytes = [system.Convert]::FromBase64String($string)   
    32.     $memStream = New-Object System.IO.MemoryStream $dataBytes, 0, $dataBytes.Count   
    33.     $memStream.Position = 0   
    34.     $gzipStream = New-Object System.IO.Compression.GzipStream $memStream, ([iO.Compression.CompressionMode]::Decompress)   
    35.     $uncompressed = ReadAllBytes($gzipStream)   
    36.     return New-Object String(($uncompressed), 0, $uncompressed.length)   
    37. }  

    From what i understand this is in fact a gzip stream. Am I wrong?

  3. I already replied on NI and would like to ask here for help. Using Sam_Sharps method i try to decopress a zipped stream of and run out of memory, which seems strange as the string is only about some about 1 MB long.

     

    Do I need to work on parts of the string? I see there is a calculation for the compression and the memory allocated to the containing the uncompressed string. How can this be so large for such a small stream?

     

    What I did is similar to this:

     

    post-53992-0-02930800-1456829076.png

  4. I have a project that i took over and as part of this project drivers are packed into a .llb which is then loaded. This has all worked well in the past on my predecessors PC but I get this:

     

    LabVIEW cannot find a file that is a dependency of a Startup, Exported, or Always Included VI.
     
    File Not Found: C:\Program Files (x86)\National Instruments\LabVIEW 2013\vi.lib\utf\common\utf_test_result_troll.ctl
     
    The missing file might be referenced by one of the libraries included in the build or by the file - HIPI-Simulation.lvclass. To fix this issue:
     
    - Open all Startup, Exported, or Always Included VIs, recompile them (CTRL+SHIFT Click the Run arrow) and save them to update their dependencies.
     
     
    <Call Chain>Error 7 occurred at AB_Engine_HandleLinkErrors.vi -> AB_Engine_Update_Source_from_Linker.vi -> AB_Build.lvclass:CalculateDependencies.vi -> AB_Build.lvclass:Build.vi -> AB_API Do Two Step Build.vi:4020001 -> AB_API Build.vi:4700001 -> NI_AB_API_Build.lvclass:Build.vi -> NI_AB_API_SDIST.lvclass:Build.vi -> Build_HipiDriversThunderball.vi -> Build.vi
     
    Possible reason(s):
     
    LabVIEW:  File not found. The file might be in a different location or deleted. Use the command prompt or the file explorer to verify that the path is correct.
    =========================
    NI-488:  Nonexistent GPIB interface.
     
    -------
     
    Is my Labview too new and vi.lib has changed? Did I delete parts of vi.lib?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.