New here and my first post. A question I am trying display only seconds on a px page without any decimal places. I reviewed the BFormat Cheat Sheet and tried a few different things but it did not work (%out.Minute%)
The program object is Boolean Delay With Time, Time Reamaing Output to a String Writable which converts the display from seconds to ms.
First of all, welcome @mreining . To answer your question:
In you’re case you are BFormatting the object type of BRelTime. When we look at the bajadoc for BRelTime we can see all the methods available to us. As a general rule when using BFormat we can use any methods that begin with get, do not take any arguments and are not void.
In BFormat we simply drop the get and () and use camel case. For example:
If we want to return just the seconds part, we can see in the bajadoc we have the method getSecondsPart() which in BFormat would equate to %secondsPart%.
When we look at the slot sheet for the BBooleanDelayWithTimer we can see the slot type for timeRemaining (this is how me know what type to lookup in the baja doc and what methods we can use):
That description on how to use the Niagara API docs for accessing methods wihtin a BFormat string is awesome! Thank you for posting that.
I noticed, though, that the intial question mentions the slot whose value he wants to display is from a ProgramObject and his image shows decimal places where a BRelTime doesn’t appear to show decimal places (by default) when linked to a String slot.
Thanks, @Eddie! You’ve made some excellent points. @mreining, if you’re okay with it, could you share a snippet of your program object and code? That would help us understand your context better.
Given that you’re working with a program object, it might be more efficient to to adjust the code to output the format that you’re looking for.
Thanks for the information. I was unable to use the BFormat as posted. The boolean delay with timer displays (axcommunity or vykon block not sure) is correctly but when linked to the px page in a bound label is shows the seconds to the thousands.
That binding of seconds seems a lot like something I had to do to get a Boolean Delay Block to work. I had to pass the input (min), multiply by 60,000 to get milliseconds, which is the only input the “Off Delay” the Boolean Delay Block would take.