By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,558 Members | 1,373 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,558 IT Pros & Developers. It's quick & easy.

How to get firmware version

P: 25
I have the following code that will request the Version of firmware from the device.

The problem is how can i display this in a textbox control?


Below are the specs of the call:

VER
Description:
The firmware version command allows for the master to check which version of firmware is loaded on the slave device. Firmware version is hard coded and cannot be changed by the factory of end user.

Request Syntax:
[VER]
Example:
[VER] - Request Version number

Reply Syntax:
{VER version}
Where the version values are:
0 65535 (decimal)
Example:
{VER 15} - Version 15



Expand|Select|Wrap|Line Numbers
  1.  
  2. Public Sub GetIndicator_Info()
  3.         comm1.InBufferCount = 0
  4.         comm1.InputLen = 0
  5.         comm1.InputMode = InputModeConstants.comInputModeBinary
  6.         comm1.Output = ("[VER]")
  7.     End Sub
  8.  
Sep 7 '07 #1
Share this Question
Share on Google+
2 Replies


P: 1
I have the following code that will request the Version of firmware from the device.

The problem is how can i display this in a textbox control?


Below are the specs of the call:

VER
Description:
The firmware version command allows for the master to check which version of firmware is loaded on the slave device. Firmware version is hard coded and cannot be changed by the factory of end user.

Request Syntax:
[VER]
Example:
[VER] - Request Version number

Reply Syntax:
{VER version}
Where the version values are:
0 65535 (decimal)
Example:
{VER 15} - Version 15



Expand|Select|Wrap|Line Numbers
  1.  
  2. Public Sub GetIndicator_Info()
  3.         comm1.InBufferCount = 0
  4.         comm1.InputLen = 0
  5.         comm1.InputMode = InputModeConstants.comInputModeBinary
  6.         comm1.Output = ("[VER]")
  7.     End Sub
  8.  
Actually how you got the VERSION from Comm. device , where the VERSION was show
Sep 8 '07 #2

Robbie
100+
P: 180
If the reply could be for example:
{VER 3.21}

Then you can use this code to get the 3.21:


Expand|Select|Wrap|Line Numbers
  1.     Dim StartPos As Long
  2.     Dim EndPos As Long
  3.     StartPos = InStr(1, AllData, "{VER ")
  4.     EndPos = InStr(StartPos, AllData, "}")
  5.  
  6.     dim VersionString as String
  7.     VersionString = Mid(AllData, StartPos + 5, EndPos - (StartPos + 5))
  8.  
AllData is the string containing which, somewhere in it, contains "{VER " and then some string, then "}".
After this is run, VersionString is a STRING which contains the 'version'. So you need to use Val() if you want to convert it to a numeric form.
Sep 8 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.