A few questions about working with numbers

Forum to ask for any help
Post Reply
wwat
Posts: 30
Joined: Mon Dec 03, 2012 7:12 pm

A few questions about working with numbers

Post by wwat » Fri Dec 07, 2012 2:59 pm

Is this the best method to display a number in a text object?
1) create a text object on the canvas
2) create a label variable
3) set the text objects dynamic label property to the label variable
3) create a number variable
4) set the value of the label variable to the number by placing [NameOfNumberVariable]
in a set label action

The other question relates to calculations on numbers. Is it possible to do some division on numbers.
i.e the actual temperature sent from the ISY is double the actual temperature so you have to
divide by two to get to the actual. A number of 148 is actually 74 degrees so I have to have a way to
divide the number by 2.

Thanks Wayne

User avatar
DemoPad
Site Admin
Posts: 734
Joined: Thu Jun 14, 2012 10:46 am
Contact:

Re: A few questions about working with numbers

Post by DemoPad » Fri Dec 07, 2012 3:13 pm

Yes - that is the way to display your number variable as text.

As for dividing, we've only put in [+] and [-] as operations at the minute, but the next version of the app supports [*] and [/] for multiplication/division.

wwat
Posts: 30
Joined: Mon Dec 03, 2012 7:12 pm

Re: A few questions about working with numbers

Post by wwat » Fri Dec 07, 2012 4:03 pm

> but the next version of the app supports [*] and [/] for multiplication/division.

Phenomenal, Many thanks.

AKWillows
Posts: 53
Joined: Mon Aug 25, 2014 5:46 pm

Re: A few questions about working with numbers

Post by AKWillows » Fri Mar 03, 2017 11:47 am

This is an old thread, but reviving as I have a question re dividing the value of numbers

So, I capture a number into a number variable which I would like to divide by 1000 and then display.

This is the way I have it set up at the moment, but it behaves irratically - sometimes the divide by 1000 happens twice, sometimes it doesn't happen, sometimes a zero is displayed

1) Capture value into "Number 1"
2) Action 1: Type Set a number Number Number 1 Data: [/]1000
3) Action 2: Type Set a label Label Label 1 Data {Number 1}
4) Display Label 1 on the page

I also tried the division being targetted to a second number

1) Capture value into "Number 1"
2) Action 1: Type Set a number Number Number 2 Data: {Number 1}[/]1000
3) Action 2: Type Set a label Label Label 1 Data {Number 2}
4) Display Label 1 on the page

But this resulted in a zero being displayed all of the time.

Any thoughts on where I am going wrong please?

User avatar
DemoPad
Site Admin
Posts: 734
Joined: Thu Jun 14, 2012 10:46 am
Contact:

Re: A few questions about working with numbers

Post by DemoPad » Sat Mar 04, 2017 10:54 am

Try putting a slight delay on those actions - to give the feedback routine time to assign the captured value to the number.

asimp11
Posts: 39
Joined: Fri Oct 19, 2012 1:00 pm

Re: A few questions about working with numbers

Post by asimp11 » Sun Mar 05, 2017 7:09 pm

I have found that a delay of 0.2 or 0.3 seconds works best for serial (RS232) feedback but for IP feedback it can get missed if you have a lot of network traffic. Feedback sent from your 3rd party device will not buffer, if it is squashed by another command it will most likely display default. Mind the gap!!

Post Reply