In addition to the functions available in the standard version http://cargocal.com/SNsOil.html and Advanced version
http://cargocal.com/SNsAOil.html the following functions are made available in the Premium version. This will keep the file size small and give fast calculations. Further, you can access and call the functions in multiple projects at the same time. However, a registered Dll has to be purchased for each machine it is being used on. Select the level from Standard, Advanced, Premium or Universal according to your need.
Extract the zipped file to "C:\Cargocal". Then from the Start-Run button, register the add-in by typing RegSvr32 "c:\cargocal\SNsPmOil.dll". Then from Excel, Tools-Addins, click on the 'Automation, button. Select SNsPmOil.PmOilCalc from the list or use the Browse button to the Cargocal folder and select the add-in SNsPmOil.dll With the universal addin the names are SNsUOil.UOilCalc
The functions are -
HeelDeg(NetMoments As Double, Displacement As Double, GoM As Double) As Double
ListInDeg(PortDr As Double, StbdDr As Double, Beam As Double, Optional MF As String = "M") As Double ' if drafts in feet, pass MF = "F"
IntpTrimListCorr(mTrim As Double, mUll As Double, TbCol1 As Range, TbCol2 As Range, Optional delta As Double = 1) As Double
'Pass the trim as double, measured ullage as double and two corresponding columns as ranges.
IntpTOV(CorrdUll As Double, TbUlg As Range, TbVol As Range) As Double
CrudeWaxPct(WtPct149 As Double, WxPct149 As Double, WtPct232 As Double, WxPct232 As Double, WtPct342 As Double, WxPct342 As Double, WtPct369 As Double, WxPct369 As Double) As Double
CrudeCloudPt(Wt149 As Double, CP149 As Double, Wt232 As Double, CP232 As Double, Wt342 As Double, CP342 As Double, Wt369 As Double, CP369 As Double) As Double
ViscAtTemp(oVis As Double, TkTempC As Double, BFactor As Double, ResultTempC As Double) As Double
BFactorFmVisc(oVis1 As Double, TkTempC1 As Double,
oVis2 As Double, TkTempC2
As Double) As
Double
BlendVols(TkVols As Range) As Double 'This saves tank volumes, tank-wise, in program memory. Computes percentage for each tank against total volume and stores this in memory for use by the following Blend functions. Function returns the total of all tanks
BlendItem(TkItem As Range, TkVols As Range) As Double. 'Computes and returns the blended value for the selected range Item [example: API, Temp, Vanadium, etc]
BlendWeight(TkApi As Range, TkVol As Range) As Double 'Computes and returns the weight for single tank basis tank API and Volume
BlendVisc(TkVisc As Range, TkApi As Range, TkVols As Range) As Double 'Computes and returns the blend viscosity for all the tanks. The parameters to be passed to the function are: Ranges containing Viscosity, API and Volumes
BlendPourPt(TkPourPt As Range, TkVols As Range) As Double 'Computes and returns the blend Pour Point for all the tanks. The parameters to be passed to the function are: Ranges containing Pour Point and Volumes
RoofCorr(Temp As Double, CF As String, APIorDens As Double, Tables As String, WtOfRoof As Double, Optional LiqType As String = "C") As Double
ShellCorr(Insu
As Boolean, CF
As String,
AmbT As Double, TkT As Double, RefT As Double,
TkType As Byte)
As Double
'TkType is from 1 to
4, where coeffs are -
Type 1 - If CF = "F" Then TCoeff = 0.0000062 if 'C'
Then TCoeff = 0.0000112
Type 2 - If CF = "F" Then TCoeff =
0.0000096 if 'C' Then TCoeff = 0.0000173
Type 3 - If CF = "F" Then TCoeff =
0.00000883 if 'C' Then TCoeff = 0.0000159
Type 4 - If CF = "F" Then TCoeff = 0.000006 if 'C'
Then TCoeff = 0.0000108
NetMassOrWTFmGSV(GSVol As Double, Tables As String, APIorDens As Double, Temperature As Double, FWPct As Double, SedPct As Double, Optional MassOrWt As String = "M", Optional AD As String = "D", Optional CentFarh As String = "C", Optional FWType As String = "F") As Double
DensAtTankTemp(Table As String, APIorDens As Double, DegC As Double) As Double ' A more comprehensive function to obtain density at tank temperature.
DensInAir(Dens As Double) As Double
PlaySound(FileName As String) As Integer ' Plays the sound file once. example formula =IF(H14>2000000,PlaySound("c:\cargocal\Err.wav"),"")
DraftAtLPFwd(FwdDrafts As Range, AftDrafts As Range, FwdOffset As Double, AftOffset As Double, LBP As Double) As Double
DraftAtLPFwd(FwdDrafts As Range, AftDrafts As Range, FwdOffset As Double, AftOffset As Double, LBP As Double) As Double
DraftMeanOfMeans(FwdDrafts As Range, AftDrafts As Range, FwdOffset As Double, AftOffset As Double, LBP As Double) As Double
AppString(JoinRange As Range, Optional Separator As String = "Zm^") As String ' used in VBE or in the file
UnAppString(A() As String, PassedStr As String, Optional Separator As String = "Zm^") ' used in VBE, pass an array. The function will populate the passed array with the string split by the separator value.
RunFile(FilePath As String) 'Open and Run any file. Example =if(H1>20000,Runfile("c:\medJournal\cholesterol.pdf"),"")
GenRandomNum(Optional FromNum As Double = 0, Optional ToNum As Double = 10, Optional WholeNum As Boolean = False)As Double
GenInputBox(Prompt As String, OrigText As String, TitleBar As String,, Optional DataType As Integer = 1 + 2) 'Example =if(H1>20000,GenInputBox("Enter Last Overhaul run hours","0","Customised Solutions",8),"") Note - valid datatypes are
value
Meaning
0
a Formula
1
a
Number
Use sum of numbers for multiple data types
2 Text (a string) Example: 2 + 4 for Text and logical.
4
A logical value (True or
False)
8
A cell reference, as a Range object
16 An error
value, such as #N/A
64 An array
of values
OpenRunCMD(Prompt As String, Title As String) 'Shows a custom run command dialog box.
ShowPCClock() as String 'Shows the PC clock icon in the system tray, Opens the Date & Time Dialog Box. Click on Excel in the task bar to bring the D&T box to the front . Example - =if(H1+1<now(),showpcclock,"")
ShowControlPanel() As String 'Example =if(H1>20000,ShowControlPanel(),"")
ShowRegSettings() As String 'Example =if(H1>20000,ShowRegSettings(),"") ' Region Settings
ShowDispSettings() As String ' ScreenSaver tab Example =if(H1>20000,ShowDispSettings(),"")
StartScreenSaver() As String 'Example =if(H1>20000,StartScreenSaver(),"")
OpenExplorer() As String
OpenWebPage(Url As String) ' Opens passed web page url in default browser
RunOnTime(MacroName As String, AfterNSeconds As Long) 'Example = if(H1>20000,RunOnTime("TT",10),StopOnTime("TT",10,False)) Where TT is a name of a macro you have written.
StopOnTime(MacroName As String, AfterNSeconds As Long) 'Example = if(H1>20000,RunOnTime("TT",10),StopOnTime("TT",10,False))
Where TT is a name of a macro you have written.
LogE(dVal As Double) As Double ' Natural Log
Some Derived Mathematical Functions -
Sec(dVal
As Double) As Double
Cosec(dVal As
Double) As Double
Cotan(dVal As
Double) As Double
Arcsin(dVal As Double) As Double 'Inverse Sine
Arccos(dVal As Double) As Double
'Inverse CoSine
Arcsec(dVal As Double) As Double ' Inverse
Secant
Arccosec(dVal As Double) As Double 'Inverse
Cosecant
Arccotan(dVal As Double) As Double 'Inverse
CoTangent
HSin(dVal As Double) As
Double ' Hyperbolic Sine
HCos(dVal As Double) As
Double ' Hyperbolic CoSine
HTan(dVal As Double) As Double '
Hyperbolic Tangent
HSec(dVal As Double) As
Double ' Hyperbolic Secant
HCosec(dVal As Double) As
Double
' Hyperbolic CoSecant
HCotan(dVal As Double) As Double '
Hyperbolic CoTangent
HArcsin(dVal As Double) As
Double ' Hyperbolic ArcSine
HArccos(dVal As Double) As
Double ' Hyperbolic ArcCoSine
HArctan(dVal As Double) As
Double ' Hyperbolic ArcTangent
HArcsec(dVal As Double) As Double '
Hyperbolic ArcSecant
HArccosec(dVal As Double) As
Double ' Hyperbolic ArcCoSecant
HArccotan(dVal As Double) As Double 'Inverse
Hyperbolic Cotangent
LogN(dVal As Double, N As Double) As Double
'Logarithm of number dVal to base N
For sake of uniformity, temperature to be passed is in degrees Centigrade to all the functions and is automatically changed to Fahrenheit internally, if required. (Unless either is allowed by the argument 'CF' as string).
Though most of the functions can be used by any application (not limited to MS Excel), some of the functions need data from an Excel range. Therefore in the "Universal' addin, we have supplemented the list of functions which require ranges with the following, where the user will pass data in an array instead.
Buy Universal Level Addin (not limited to MS Excel)
UAppString(JoinRange()
As String, Optional Separator
As String = "Zm^")
As String
UDraftAtLPAft(FwdDrafts() As Double, AftDrafts() As Double,
FwdOffset As Double,
AftOffset As Double, LBP
As Double) As
Double
UDraftAtLPFwd(FwdDrafts() As Double, AftDrafts() As Double,
FwdOffset As Double,
AftOffset As Double, LBP
As Double)
As Double
UDraftMeanOfMeans(FwdDrafts() As Double, AftDrafts() As Double,
FwdOffset As Double,
AftOffset As Double, LBP
As Double) As Double
UBlendVols(TkVols()
As Double) As Double
UBlendItem(TkItem()
As Double, TkVols()
As Double) As
Double
UBlendPourPt(TkPourPt()
As Double, TkVols()
As Double)
As Double
UBlendVisc(TkVisc()
As Double, TkApi() As Double,
TkVols()
As Double) As
Double
UBlendWeight(TkApi As Double, TkVol As Double)
As
Double
'This is the same as BlendWeight as
only single cells are involved
UIntpTrimListCorr(mTrim
As Double, mUll
As Double,
TabCol1() As Double, TabCol2() As Double, Optional delta As Double = 1) As
Double
UIntpTOV(CorrdUll As Double, TUll()
As Double, TVol() As Double) As Double
STANDARD FUNCTIONS ADVANCED FUNCTIONS
Users may send their queries to
for any clarification.
This project has a limit of 30 calculations and / or prevents printing with the unregistered copy. With 30 calculations, the user can test the usefulness of this add-in substantially for a tank or two. To get the registered version, click on the button below to purchase via secure transactions and send us by e-mail the file "licSNOilPCID.pvf" generated by the project. You will find this file in 'C:\Cargocal\DllP. We will send you the release code file by return e-mail.