Forums › SA Series Discussions › Get Firmware String
- This topic has 1 reply, 2 voices, and was last updated 7 years, 3 months ago by
Andrew.
Viewing 2 posts - 1 through 2 (of 2 total)
- AuthorPosts
MallaugParticipantTrying to get the firmware version from a SA44B. Spike says it is 2.12. I must be doing something wrong….
I’m using C# and this code, but I’m only getting Zeros:
public static string saGetFirmwareString(int device) { char[] firmware_version = new char[16]; if (saGetFirmwareString(device, firmware_version) == saStatus.saNoError) return new string(firmware_version); return ""; }
[DllImport("sa_api.dll", CallingConvention = CallingConvention.Cdecl)] public static extern saStatus saGetFirmwareString(int device, char[] version);
AndrewModeratorHello Mallaug,
Since Spike also uses the API to retrieve the firmware string and is working for you, it would lead me to believe the issue is probably in the C# interop.
Hopefully someone here has enough C# experience to answer your question. You might also try searching online with search terms like “PInvoke char pointer parameter” or similar. It seems to bring up a lot of relevant results.
Regards,
Andrew- AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.