-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8fc4269
Showing
2 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
|
||
#ifndef __HSLGetSerialNumber_hsl__ | ||
#define __HSLGetSerialNumber_hsl__ 1 | ||
|
||
#include "HSLStrLib.hsl" | ||
|
||
// Gets the serial number from the instrument (instrument must be initialized) | ||
function GetSN(device& ML_STAR, variable i_blnTrace) variable | ||
{ | ||
variable command(""); // Command string | ||
variable parameter(""); // Parameter string | ||
variable serialNumber(""); // Serial number | ||
variable rc[]; // Low level step return values | ||
|
||
// Get serial number | ||
command = "C0RI"; // Request Installation data | ||
parameter = ""; | ||
rc = ML_STAR.FirmwareCommand( "1e78330b_4cb4_456b_84d80d3b33e97e73" ); | ||
if (4 == rc.GetSize()) | ||
{ | ||
serialNumber = StrMid(rc.ElementAt(3), StrFind(rc.ElementAt(3), "sn"), 6); | ||
} | ||
if (i_blnTrace==1) | ||
{ | ||
Trace("///// Hamilton SN: ", StrMakeUpper(serialNumber)); | ||
} | ||
return(StrMakeUpper(serialNumber)); | ||
} | ||
|
||
function GetMethodName(variable i_blnTrace) variable | ||
{ | ||
string strTemp(""); | ||
string strReturn(""); | ||
variable intPosition(0); | ||
|
||
strTemp = GetMethodFileName(); | ||
intPosition = strTemp.GetLength() - StrReverseFind(strTemp, "\\") - 1; | ||
strReturn = StrRight(strTemp, intPosition); | ||
intPosition = strReturn.GetLength() - 4; | ||
strReturn = StrLeft(strReturn, intPosition); | ||
if (i_blnTrace==1) | ||
{ | ||
Trace("##### Method Name = ", strReturn); | ||
} | ||
return(strReturn); | ||
} | ||
|
||
function GetMethodFolder(variable i_blnTrace) variable | ||
{ | ||
string strTemp(""); | ||
string strReturn(""); | ||
variable intPosition(0); | ||
|
||
strTemp = GetMethodFileName(); | ||
intPosition = StrReverseFind(strTemp, "\\") + 1; | ||
strReturn = StrLeft(strTemp, intPosition); | ||
|
||
if (i_blnTrace==1) | ||
{ | ||
Trace("##### Method Folder = ", strReturn); | ||
} | ||
return(strReturn); | ||
} | ||
#endif | ||
// $$author=Hamilton$$valid=0$$time=2024-11-08 13:36$$checksum=840d3527$$length=085$$ |
Binary file not shown.