When you want to set new values to the private class data, you need to send these values to Murmex in order to process them. The concept is that you can update values yourself internally and you can set them externally. In LabVIEW Object Oriented Programming (LVOOP) you can set parameters of the private class data either in the class directly by Bundle By Name or wrapping this by a setter or getter.

Let us first look how to set these within the class. Important is, that these values are set within a method that is being called. For example in the Initialise method.

Setting new values internally
  1. Just like in Configuration and settings cluster, create a strict type cluster and save it in the virtual folder of type definitions.
  2. As seen in Configuration and settings cluster, update the Get settings chain, where the empty variant should be replaced by the unbundling of the settings cluster of the private class data.
  3. Add to the folder an accessor of your data. Click right mouse on the virtual folder accessors >> New >> Create from Static Dispatch Template. When you want to read the data e.g. frequency, call it “Get frequency”. If you want to write the data to the variable, call it e.g. “Set frequency”. Accessor setter example
  4. Create a control as input and wire it to the Bundle by Name in order to store it in the private class data. Set on the front panel the newly created control as input on the Terminal block and set this input as Required.
  5. Give the method an appropriate icon. Use for the setters a pen and for the getters the glasses. To describe the method, use text to describe it or even better use an icon. Setter frequency
  6. In this example, add to the Initialise method the accessor. Setting a value in the initialise method
  7. If you like to visualize the most current value on the GUI of the component. Use the Unbundle by Name in the consumer loop. Reading latest value in the GUI
Setting new values externally
  1. When setting values from the GUI to the private class data, we need to send a message to ourselves with the new values of the parameters. In Murmex we use the method Update target. Although with this method you can update any component with new values, often this is used to update your own parameters. Add to the GUI a control, e.g. frequency.
  2. Add to the event structure a new case that responds on a value change.
  3. Add the method Update Target to this case. Use the method Get ID as recipient and use again the local variable with the class data from the message handle loop.
  4. Create a constant cluster for the input of the Update target and wire the output from Get ID to the targer ID. Convert your parameter to use to a variant and build an array of all the parameters you like to update. The key chains represent the names of the parameters you like to use. Keep the key chains in the same order as you build the array of values. Update target
  5. Now we can send the new parameters and have to implement to receive the parameters. Override the method Update.
  6. For each value we would like to implement an action, we have to set it in the array of strings. We use the method ‘Look up setting’ from the UpdateMessage class. When the parameter is found, we like to implement the action to be taken.
  7. Add a case structure for the string and add the bundle by name. Convert the string to the data type of the parameter in the settings cluster.
  8. Make the Call to Parent after updating the parameters. Update search for setting
  9. In the Main method, unlike before, we like to update the control that sent the UpdateMessage. Use therefore a local variable to update to the latest value. In general it is equal, but perhaps in the future you have UpdateMessages coming from other components.