E2E probe - Need an alarm to be generated based on Performance Threshold values in Excel

Document ID : KB000115378
Last Modified Date : 19/09/2018
Show Technical Document Details
Issue:
We are trying to use the e2e probe to measure some time value then compare that to a value in an Excel spreadsheet (this is the threshold) and,
depending on whether the time value is higher/equal to or lower, generate an alarm.
How would we achieve this ?
Resolution:
The basic calls in the script would be as follows:

...
qostime = nimQoSGetTimer()/1000
ReadExcel("C:\sample_threshold.xlsx","Sheet2!F2:H2",Thres$())
             
if qostime >= Val(Thres$(2)) then
...
do some work 
nimalarm(5,"Value greater than or equal to threshold")
...
else
do some other work
nimalarm(1,"Value less than threshold")
...

endif
...

Notes:
ReadExcel specifies the path to the Excel spreadsheet.
Sheet2! identifies the sheet (if there are more than one)
F2:H2 identifies values from Row 2 columns F through to H
Thres$ is an array in which to hold the cell values

The subsequent compare then uses the second value from the array to compare against.