-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
54 lines (50 loc) · 1.6 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
var edge = require('./lib/edge');
var getVoltage = edge.func(function() {/*
#r "C:\Program Files\nodejs\EzDNAApiNet.dll"
using System;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
using InStep.eDNA.EzDNAApiNet;
class Startup
{
public async Task<object> Invoke(dynamic input)
{
return await Task<object>.Run(() => {
try {
double value;
DateTime time;
string status, desc, units;
int iRet;
value = -1;
time = DateTime.Now;
status = "";
desc = "";
units = "";
string pointName = input.point;
iRet = RealTime.DNAGetRTAll(pointName, out value, out time, out status, out desc, out units);
return new {value = value, time = time, status = status, desc = desc, units = units};
}
finally {
}
});
}
}
*/});
function getPointData(pnt, callback){
getVoltage({ point: pnt }, function (error, result) {
if (error) {
console.log(error);
callback(error);
}
else {
console.log(JSON.stringify(result));
callback(null, result);
}
})
}
getPointData("WRLDC.PHASOR.WRDC0783", function(error, result){
console.log("reached here...");
if(error){
console.log("Oops, error occurred...");
}
});