I'm getting a Null Reference error with a Looped Array. I believe I need to create a new instance but can't figure out syntax.
Here is the Public declaration:
Public fbInitial() As Double
Public bmInitial() As Double
Public dpInitial() As Double
Here is the code that throws the Null error:
' Calculate initial values and write text file header
If x = 1 Then
fbInitial(source) = FormatNumber(detPwrAvg / backMonAvg, 6) 'Sets initial SLD Front/Back ratio on first sample
bmInitial(source) = FormatNumber(backMonAvg, 6) 'Sets initial Back Monitor on first sample
dpInitial(source) = FormatNumber(detPwrAvg, 6) 'Sets initial Detector Power on first sample
file.WriteLine("Sample;Intentionally Blank;Chamber Temp;Intentionally Blank;Back Monitor (uA);Laser Drive (mA);Intentionally Blank;Detector Power (uW);Fwd/Back Ratio;Normalized F/B Ratio;Normalized Back Monitor;Normalized Fwd Power")
End If