The General Interest forum is for non-support discussion only. If you have a question about, or need help with a Silicon Labs product, please visit one of the individual product forums.
 

Application engineers do not monitor this forum.
 

View General Interest Board Guidelines ›

Hello,

I want to get the release number (major and minor values) of SLAB_USB_SPI.dll and i am using function

CP213x_GetLibraryVersion(BYTE* pMajor, BYTE* pMinor, BOOL* plsRelease) but it seems to be it doesn't work properly.

First of all, i defined pMajor and pMinor as BYTE variables and i passed their addresses (referenced with &) to CP213x_GetLibraryVersion but i get 0 for both variables whereas the probably version number is 1.0 as indicated in .chm Help file.

If i define pMajor and pMinor as char arrays (strings), passing their names to CP213x_GetLibraryVersion, i get 0x01 in first element of pMajor but for pMinor i get "ERROR: Over array bounds".

If you can share a piece of code solving this issue i would appreciate.

Regards!

Alejandro Pinto

 

  • Discussion Forums
  • Answered
Answered
  • Hi,

     

    What language are you writing your code in?

     

    ~Manasa

    0
  • Hi, 

     

    I forgot to mention i am writing the code in ANSI C. LabWindows/CVI is the IDE i am using.

     

    Regards!

     

    Alejandro Pinto

    0
  • You should be sending the arguments as BYTE and not as strings. The function CP213x_GetLibraryVersion uses __stdcall convention. Make sure that your function is also using the same. Also, initialize your parameters to a known value (0xA, for instance) and see if the return value is changing when you pass these parameters? Finally, can you write the code in command line and then try to see if it works? If it doesn't, then please paste the code that you wrote on command like here, so that I can take a look. 

    Correct Answer
    0