Forum

Notifications
Clear all

Object ref error  

  RSS

(@jason)
Active Member
Joined: 10 months ago
Posts: 8
October 29, 2019 2:41 am  

Hi, I'm stuck again.  I was writing a script to do a boil for an hour so I could calibrate my boil off rate.  It's my first script and it was working good until I got to the point that I wanted to do something when the temperature reached a certain point. 

I borrowed from your post "Brewery Code" here in the Scripts section of this forum.  I noticed that it was hanging on my wait statement even though the condition was true.  I dumbed it down to a little test script here and it is still doing the same thing. 

I have a 1-Wire temp sensor called "Boil Kettle Temp".  In my test here, I can assign it to a local variable and you can see that it properly evaluates to 202.1.  The next line down though when I'm trying to use the same thing in a wait statement like you had done in your script, it errors out with an object reference error. 

Where am I going wrong?!  This is on version 1.1 Build 4. 

Thank you!

Jason

A portion of your script:

wait "Boil Temp" Value >= 210
Status = "Boil"

 

My test script:

[setup]
new value testTemp

testTemp = "Boil Kettle Temp" Value
wait "Boil Kettle Temp" Value >= 200
testTemp = 0

Quote
(@pbruno3)
Reputable Member Admin
Joined: 3 years ago
Posts: 266
October 29, 2019 1:45 pm  

You are assigning the temperature to a value, but then not actually using it. Your wait statement should evaluate the variable, like below. That said, you could also eliminate the variable and use the wait as you have it - I am not sure why you are getting an error... it should work fine (my guess is the name you are using is not the actual Element name):

[setup]
new value testTemp

testTemp = "Boil Kettle Temp" Value
wait testTemp >= 200
This post was modified 7 months ago by pbruno3

ReplyQuote
(@jason)
Active Member
Joined: 10 months ago
Posts: 8
October 29, 2019 3:44 pm  

Hmm.  Sorry, in hindsight I didn't explain clearly what I was doing above (my bad)...  Those 5 lines are the entire test script I had made to try and figure this out. 

The first two lines (creation of the variable and assignment) were just in there to debug and show that the element name (same as in the "real one" in the next line down) was indeed producing a number of 202.1 when I looked up the value property of the same object.  The image I attached in the original post should illustrate that a bit more.

The only line that is in the "real" script(which I think(?) is the same as your own script sample?) is

wait "Boil Kettle Temp" Value >= 200

 

 

This post was modified 7 months ago 3 times by Jason

ReplyQuote
(@pbruno3)
Reputable Member Admin
Joined: 3 years ago
Posts: 266
October 29, 2019 5:55 pm  

Do you have a Device Element with the Name of "Boil Kettle Temp"?


ReplyQuote
(@jason)
Active Member
Joined: 10 months ago
Posts: 8
October 29, 2019 6:04 pm  

Yes sir, that's the 1-wire device I mentioned. 

I'm able to read the temperature value and successfully stuff it into a variable in the test script.  The wait statement on the very next line using the same exact element throws the object reference error. 

In the real script, I only had the wait line...  no intermediary variables.  It was throwing the obj ref error in both scripts.


ReplyQuote
(@pbruno3)
Reputable Member Admin
Joined: 3 years ago
Posts: 266
October 29, 2019 6:08 pm  

Please email your configuration file to us.


ReplyQuote
Share: