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.
I have to use ‘Get Label Command’ from MSP Gang Programmer user guide,which retrieves all hardware and software information. This information also has a ‘Programmers serial number YYMMnnnn’ field. I want to fetch value for serial number field.I am facing problem to understand how this command should be executed and how to get serial number from the obtained response? can you please help us to find the solution for this problem.
I am using following code in my implementation.
unsafe
{
var memHandle = MccService.WinBufAlloc32Ex(140);
var details = MSPGANG_GetLabel(memHandle);
var memBytePtr = (byte*)memHandle.ToPointer();
var readStream = new UnmanagedMemoryStream(memBytePtr, 140, 140, FileAccess.ReadWrite);
var byteArray = new byte[140];
readStream.Read(byteArray, 0, 140);
}
and imported MSPGANG_GetLabel() method from MSP-Gang.dll like given below:
[DllImport("MSP-Gang.dll")]
internal static extern uint MSPGANG_GetLabel(IntPtr dataBuffer);
As per your suggestion, I have created memory buffer with 140 points which returns intptr memory handle.
and then I called method MSPGANG_GetLabel() from MSP_Gang.dll by passing this memory handle as a parameter to this mehod.
but in response its giving me an response 306, and as per the MSP Gang programmer guide that I am referring, this issue is COM port selection issue. But I am confused about this response of GetLabel method.
It should return following data
Am I using wrong parameter to 'MSPGang_GetLabel' method or am I using wrong method to get serial number?
Can you please share any link or any c# code snippet where I can see the actual implementation of this command with correct parameters , all the details about what to pass, how to implement
this command and how to get serial number from the obtained response in C#? I am stucked with this from long time. It will be thankful if you can share any link for this implementation.
Hi,
Thank you for your valuable feedback. We have resolved that issue. But I am stuck at an another implementation.
I am using ‘GangMainProcess()’ function imported from Gang430.dll. Its executing successfully.
Post this I am executing following code snippet for ‘GangGetResult()’ from the same Gang430.dll.
I have referred MSP430 guide document from the link given below:
www.promelec.ru/.../MSP-GANG430.pdf
As per this user guide GangGetResult returns data in the following format:
I am getting result string in the same format. But the issue I am facing is that its always returning a zero value
For ‘D02’. Can you please tell us the scenario when this error emerges? Is it related to any device setting?
We are using MSP430 gang device for this execution.
Thanks & Regards,
Shradha K.
**Attention** This is a public forum