Re: BCS 4.0 .NET API and BCS Temperature Logger
Posted: Thu Mar 24, 2016 9:57 am
by Broph
MikeRussell wrote:Hey Broph,
thanks for giving it a try!
Here's my hunch - are you on a BCS460 or 462?
I bet the app is requesting
http://192.168.1.122/api/temp/4 and getting a 404, parsing the response and throwing an exception.
That exception message is written in place of all of the temperatures and thus, destroys the use of the program. I need to fix the error handling there.
ok thanks. Yep nothing comes up with that URL.
When I change that URL in the browser for 0,1,2,3 is what I get (4,5,6,7 are blank):
http://192.168.1.122/api/temp/0
{"name":"Hot Liq","temp":498,"setpoint":null,"resistance":19945,"enabled":true,"coefficients":[0.001137155,0.0002325949,9.5400029999e-8]}
http://192.168.1.122/api/temp/1
{"name":"Mashtun","temp":497,"setpoint":null,"resistance":19985,"enabled":true,"coefficients":[0.001137155,0.0002325949,9.5400029999e-8]}
http://192.168.1.122/api/temp/2
{"name":"Boil Kettle","temp":492,"setpoint":null,"resistance":20277,"enabled":true,"coefficients":[0.001137155,0.0002325949,9.5400029999e-8]}
http://192.168.1.122/api/temp/3
{"name":"RIMS","temp":494,"setpoint":null,"resistance":20166,"enabled":true,"coefficients":[0.001137155,0.0002325949,9.5400029999e-8]}
Re: BCS 4.0 .NET API and BCS Temperature Logger
Posted: Thu Mar 24, 2016 10:09 am
by JonW
Why not just use the "poll" API call? It will work the same for the 460 or 462 and then you just iterate the number of elements returned.
Results for BCS-460 /api/poll
{"alarm":{"on":false},"din":[null,null,null,null],"output":[0,0,0,0,null,null],"temp":[804,null,null,null],"process":[{"running":false,"paused":false,"current_state":255,"waiting":false,"timers":[0,0,0,0]},{"running":false,"paused":false,"current_state":255,"waiting":false,"timers":[0,0,0,0]},{"running":false,"paused":false,"current_state":255,"waiting":false,"timers":[0,0,0,0]},{"running":false,"paused":false,"current_state":255,"waiting":false,"timers":[0,0,0,0]},{"running":false,"paused":false,"current_state":255,"waiting":false,"timers":[0,0,0,0]},{"running":false,"paused":false,"current_state":255,"waiting":false,"timers":[0,0,0,0]},{"running":false,"paused":false,"current_state":255,"waiting":false,"timers":[0,0,0,0]},{"running":false,"paused":false,"current_state":255,"waiting":false,"timers":[0,0,0,0]}],"setpoint":[null,null,null,null]}
Results for BCS-462 /api/poll
{"alarm":{"on":false},"din":[null,null,null,null,null,null,null,0],"output":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"temp":[669,640,659,647,667,646,642,null],"process":[{"running":false,"paused":false,"current_state":255,"waiting":false,"timers":[0,0,0,0]},{"running":false,"paused":false,"current_state":255,"waiting":false,"timers":[0,0,0,0]},{"running":false,"paused":false,"current_state":255,"waiting":false,"timers":[0,0,0,0]},{"running":false,"paused":false,"current_state":255,"waiting":false,"timers":[0,0,0,0]},{"running":false,"paused":false,"current_state":255,"waiting":false,"timers":[0,0,0,0]},{"running":false,"paused":false,"current_state":255,"waiting":false,"timers":[0,0,0,0]},{"running":false,"paused":false,"current_state":255,"waiting":false,"timers":[0,0,0,0]},{"running":false,"paused":false,"current_state":255,"waiting":false,"timers":[0,0,0,0]}],"setpoint":[null,null,null,null,null,null,null,null]}