This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RE: Msp430 gang Programmer Serial Number and MSP-GANG.dll

Other Parts Discussed in Thread: MSP-GANG

Hi Katie,

I would like to know if it's possible to get the SN of the MSP gang programmer(for exemple SN: 0813-1229) with this command.

I tested this one but it didn't work. I used your C-Application DLL. I added this:

pMSPGangGetLabel        = GetProcAddress(hDLL430, "MSPGANG_GetLabel");

What kind of parameter I need to put in this command?

Best regards

Guillaume Mahut

  • Hi Guillaume Mahut,

    To add one of the commands to the C example program, there are a few steps.

    1. In the section at the top of the program, add this with the other pointers to DLL functions:
      1. static FARPROC pMSPGangGetLabel			= NULL;
    2. Next, in the Load_DLL() function, add a line to load the function (this is the line you had in your previous post:
      1. pMSPGangGetLabel = GetProcAddress(hDLL430, "MSPGANG_GetLabel");

    Now you should be able to use the pMSPGangGetLabel function in your program. If you look up the get label function in the MSP-GANG user's guide, you'll find that it is expecting you to pass it a pointer to a buffer where the returned label data can be stored. See www.ti.com/lit/pdf/slau358 p. 87 section 4.2.37 MSPGANG_GetLabel. Section 3.5.2.9 on p. 56 provides more information on the large data structure that will fill this buffer that you pass to the function.

    Fortunately, there is a handy structure already defined in the header file MSP-GANG.h for exactly this purpose, that sets aside the appropriate number of bytes and even has the data already broken down into the different data fields. In MSP-GANG.h (found in the Lib folder) go to line 1048 and you will see the union  UNIT_LABEL_DEF defined for this label data - with each of the fields contained in it. Back in your main program, you can define:

    UNIT_LABEL_DEF unit_label;

    And then you can call your function later like this:

    pMSPGangGetLabel((BYTE*)unit_label.bytes);

    This will get the label data from the MSP-GANG and fill the buffer you provided with it. Now you can access just the data you want (in your case the MSP-GANG serial number HW_SN) like this - this example shows printing it to the console:

    printf("  %s\n", unit_label.x.HW_SN);

    To access other data, just change the field from the structure that you are referencing (see the header file structure for the list of fields you can access).

    I hope this helps!

    Regards,

    Katie

**Attention** This is a public forum