Labels
 Computational Science (20)
 Mechanical Engineering (78)
 Misc. (47)
 PowerPoint (1)
 Scilab (15)
 VBA Programming (23)
Sunday, September 24, 2017
Wednesday, September 13, 2017
Eliwell IC901 Plus NTC thermistor probe resistance temperature table
For those who want to know the temperatureresistance data for NTC probe used in Eliwell IC901 digital temperature controller. The following is the data:
Where temperature is measured in degrees Kelvin [K] and resistance is measured in kOhm.
Eliwell and Dixell NTC temperature probe for Arduino
Temp [°C]  Resistance [kΩ] 
40  188.5 
39  178.5 
38  169 
37  160.2 
36  151.9 
35  144.1 
34  136.7 
33  129.8 
32  123.3 
31  117.1 
30  111.3 
29  105.7 
28  100.5 
27  95.52 
26  90.84 
25  86.43 
24  82.26 
23  78.33 
22  74.61 
21  71.1 
20  67.77 
19  64.57 
18  61.54 
17  58.68 
16  55.97 
15  53.41 
14  50.98 
13  48.68 
12  46.5 
11  44.43 
10  42.47 
9  40.57 
8  38.77 
7  37.06 
6  35.44 
5  33.9 
4  32.44 
3  31.05 
2  29.73 
1  28.48 
0  27.28 
1  26.13 
2  25.03 
3  23.99 
4  23 
5  22.05 
6  21.15 
7  20.3 
8  19.48 
9  18.7 
10  17.96 
11  17.24 
12  16.56 
13  15.9 
14  15.28 
15  14.69 
16  14.12 
17  13.58 
18  13.06 
19  12.56 
20  12.09 
21  11.63 
22  11.2 
23  10.78 
24  10.38 
25  10 
26  9.632 
27  9.281 
28  8.944 
29  8.622 
30  8.313 
31  8.014 
32  7.728 
33  7.454 
34  7.192 
35  6.94 
36  6.699 
37  6.467 
38  6.245 
39  6.032 
40  5.827 
41  5.629 
42  5.438 
43  5.255 
44  5.08 
45  4.911 
46  4.749 
47  4.593 
48  4.443 
49  4.299 
50  4.16 
51  4.026 
52  3.896 
53  3.771 
54  3.651 
55  3.536 
56  3.425 
57  3.318 
58  3.215 
59  3.116 
60  3.02 
61  2.927 
62  2.838 
63  2.751 
64  2.668 
65  2.588 
66  2.511 
67  2.436 
68  2.364 
69  2.295 
70  2.228 
71  2.163 
72  2.1 
73  2.039 
74  1.98 
75  1.924 
76  1.869 
77  1.816 
78  1.765 
79  1.716 
80  1.668 
81  1.622 
82  1.577 
83  1.533 
84  1.492 
85  1.451 
86  1.412 
87  1.373 
88  1.336 
89  1.301 
90  1.266 
91  1.232 
92  1.2 
93  1.168 
94  1.137 
95  1.108 
96  1.079 
97  1.051 
98  1.024 
99  0.9984 
100  0.9731 
101  0.9484 
102  0.9246 
103  0.9014 
104  0.8789 
105  0.8572 
106  0.836 
107  0.8155 
108  0.7956 
109  0.7763 
110  0.7576 
Based on the previous data, this NTC sensor can be modeled using very accurate SteinhartHart equation with following constants:
T=1/(0.0008895550077+0.000250946909*Ln(1000*R)+0.0000001960216692*(Ln(1000*R))^3)

Where temperature is measured in degrees Kelvin [K] and resistance is measured in kOhm.
Tags:
Eliwell 10 kOhm NTC temperature probe equation
Dixell 10 kOhm NTC NS6 temperature probe equation
Eliwell 10 kOhm NTC temperature probe datasheet
Dixell 10 kOhm NTC NS6 temperatureresistance datasheet
Eliwell 10 kOhm NTC temperatureresistance table
Dixell 10 kOhm NTC NS6 temperatureresistance table
Monday, May 1, 2017
Prolific USB driver for Windows 10
The latest driver is not compatible with Windows 10. If you update the using device manager, it will install the latest version which is not compatible. After some internet search, the following driver is compatible with Windows 10, you can download it from this link
Tags:
HXSP2108D driver for Windows 10
Prolific USB driver for Windows 10
RS232 TO USB driver for Windows 10
Tags:
HXSP2108D driver for Windows 10
Prolific USB driver for Windows 10
RS232 TO USB driver for Windows 10
Wednesday, April 5, 2017
Excel VBA read LabView date time stamp
To read a binary file you have to know the structure of it. In my case I was trying to read binary file written by LabVIEWbased software which records measurement data. The file represent a onedimensional array of clusters, the cluster has two elements: TimeDate stamp and double precision number.
According to the following link http://www.ni.com/tutorial/7900/en/
LabVIEW 7.0 or earlier used a 64bit double (DBL) to represent time, yielding 15 digits of precision. The number of seconds between 1st Jan 1904 (the time stamp Epoch or year zero) to 1st Jan 2000 is 3027456000. Representing this as a DBL would use 10 out of the 15 digits of precision. That leaves a very small resolution space to perform hardware timings using most of the resolution by simply going from 1904 to today. Representing time as a DBL was not ideal since it did not meet industry requirements.
In MS office the date reference is year 1900, while LabVIEW date reference is year 1904. So, in calculations we will compensate this date reference difference. Number of days difference is 1462 days.
References:
http://www.binaryconvert.com/
https://en.wikipedia.org/wiki/Doubleprecision_floatingpoint_format
Keywords:
VBA Binary file read
Read binary file written by LabVIEW
Parse (parsing) binary file
Read LabVIEW binary file using Excel VBA
Read data in binary file
Read IEEE754 Double precision 64bit number from binary file
LabVIEW DateTime stamp to binary
According to the following link http://www.ni.com/tutorial/7900/en/
LabVIEW 7.0 or earlier used a 64bit double (DBL) to represent time, yielding 15 digits of precision. The number of seconds between 1st Jan 1904 (the time stamp Epoch or year zero) to 1st Jan 2000 is 3027456000. Representing this as a DBL would use 10 out of the 15 digits of precision. That leaves a very small resolution space to perform hardware timings using most of the resolution by simply going from 1904 to today. Representing time as a DBL was not ideal since it did not meet industry requirements.
In MS office the date reference is year 1900, while LabVIEW date reference is year 1904. So, in calculations we will compensate this date reference difference. Number of days difference is 1462 days.
'
Function to convert binary to decimal
Function
BinaryToDecimal(ByVal Binary As String)
As Double
Dim
BinaryNum As Double
Dim
BitCount As Integer
For
BitCount = 1 To Len(Binary)
BinaryNum =
BinaryNum + (CDbl(Mid(Binary, Len(Binary)  BitCount + 1, 1)) * (2 ^
(BitCount  1)))
Next
BitCount
BinaryToDecimal
= BinaryNum
End
Function

'
Function to convert 64bit binary to doubleprecision float
Function
BinaryStringToDouble(ByVal BinaryString As
String) As Double
Dim
i, Sign, Exponent, BitCounter As Integer
Dim
Fraction, DoubleNo As Double
'Read
number sign
Sign = (1) ^
CLng(Mid(BinaryString, 1, 1)) 'Mostsignificant bit
'
Read exponent
Exponent =
BinaryToDecimal(Mid(BinaryString, 2, 11))
'
Read the fraction
Fraction = 0
BitCounter =
0
For
i = 13 To Len(BinaryString)
BitCounter =
BitCounter + 1
Fraction =
Fraction + (2 ^ (BitCounter)) * CDbl(Mid(BinaryString, i, 1))
Next
i
BinaryStringToDouble
= Sign * (1 + Fraction) * 2 ^ (Exponent  1023)
End
Function

'
Function to convert LabView datetimestamp to string date and time
Function
DoubleToDateTime(ByVal LVDateTimeStamp As
Double) As String ' input
LabVIEW DateTime stamp (64bit double precision number)
Dim
RefOffset As Double
Dim
MSDateTimeStamp As Double
Dim
MSDate As Double
Dim
DateString As String
Dim
DayElapsedTime_sec, Hours,
Minutes, Seconds As Double
RefOffset =
126316800 'Reference
offset in seconds 1462[days]*24[h/day]*60[Min/h]*60[sec/Min]
'Convert
it to Microsoft DateTime stamp: number of seconds from 1Jan1900
MSDateTimeStamp
= LVDateTimeStamp + RefOffset
MSDate =
Application.WorksheetFunction.Floor(MSDateTimeStamp / 86400, 1) ' number of
days from 1900
'
86400: number of seconds per day
DateString =
CStr(CDate(MSDate))
DayElapsedTime_sec
= MSDateTimeStamp  MSDate * 86400+7200
'Egypt time = UTC time + 2 hours (7200
sec)
Hours =
Application.WorksheetFunction.Floor(DayElapsedTime_sec / 3600, 1)
Minutes =
Application.WorksheetFunction.Floor((DayElapsedTime_sec  Hours* 3600) / 60,
1)
Seconds =
DayElapsedTime_sec  Hours * 3600  Minutes * 60
DoubleToDateTime
= DateString + " " + CStr(Hours) + ":" + CStr(Minutes) +
":" + CStr(Round(Seconds, 0))
End
Function

References:
http://www.binaryconvert.com/
https://en.wikipedia.org/wiki/Doubleprecision_floatingpoint_format
Keywords:
VBA Binary file read
Read binary file written by LabVIEW
Parse (parsing) binary file
Read LabVIEW binary file using Excel VBA
Read data in binary file
Read IEEE754 Double precision 64bit number from binary file
LabVIEW DateTime stamp to binary
Subscribe to:
Posts (Atom)