Main siteMain site  ForumForum  ForumSearch  Private messageEmail contact  RegisterRegister  Log inLog in 
Topic: Sending fixed value in place of dynamic value
Reply to topic
Author Message
EMebane



Joined: Apr 15, 2019
Posts: 86

PostPosted: Mar 6, 2020 12:03 AM    Post subject: Sending fixed value in place of dynamic value

I either want to send an input value or a predetermined value (0.5) depending on a toggle input. What's the best way to handle this? Let's assume I my want to select from more than 2 options with a Combo List.

I have tried inputting the dynamic value and the fixed value into a Source Selector and using an Input Combo List to pick among the inputs as the Selected Input that will be sent along. The part I'm not sure of is how to send the fixed value input every time a value comes into any input channel of the Source Selector. i.e., I essentially want to have a mode where a dynamic value is converted to a fixed value.

An Expression Evaluator would work if I wanted to establish the fixed value in advance, however I'd like to customize the fixed value with a Property Setter on some element.
jarek



Joined: Oct 22, 2007
Posts: 789

PostPosted: Mar 6, 2020 10:24 AM    Post subject:

I would probably use Buffer to hold the last input value. And use something like Set or Property to hold the constant value (which can be set with PropertySetter or directly).

And then select which one of them will be sent out. Many ways this can be done. ExpressionEvaluator is one of the ways which I often use because of its flexibility.

SourceSelector may be an overkill. Its primary purpose is to switch between real time streams from devices.
EMebane



Joined: Apr 15, 2019
Posts: 86

PostPosted: Mar 6, 2020 10:46 AM    Post subject:

So, connect a Buffer and a Value to In1 and In2 of an Expression Evaluator. Then I would apply some third input, such as the output from an InputComboList, and write an expression to switch among inputs 1 and 2 based on the value of 3? Sounds OK.

To confirm, a Property element with no connector to its input port will not send anything to its output (except perhaps on initialization of the app). Is there a solution for continually emitting a constant value from an element, either A) at the expected rate that the connected device is sending data, or B) when an input value is received.

Would there be value to BioEra in modifying the Value element to include a "Send Constant Value" field that causes the element to disregard the input value and sends the Initial Value of the component instead? (User could adjust the Initial Value with Property Setter at runtime to change the value that is emitted).
jarek



Joined: Oct 22, 2007
Posts: 789

PostPosted: Mar 6, 2020 11:21 AM    Post subject:

Yes, sounds OK to me.

Property sends a value at start, so when used with PropertySetter it can be restarted to send out its value.

I will add RESEND option in Value element similar to what I recently added in Slider (which is very similar to Value element, but has GUI component).
Reply to topic