Configure ComboBox

Hello rapidM2M Community,
I use to configure an ComboBox with some entries in config0 register. For example let the entries ON and OFF.
To code the descriptor I use DDE in rapidM2M Studio.
How do I configure the descriptor, to get different values or strings dependent on the selection of different entries?
This is my previous approach to view the ComboBox on portal:

#config0 LED1_config_0	down
LEDstate		u32		title="state"	editmask=1=OFF;ON

If I don´t use editmask=1=OFF;ON I can setup a numeric value on rapidM2M Portal. Also I get this value down on my device.
But how can I handle the ComboBox?

Kind regards,
Marcel

Hi Marcel,
let me see if I understood you correctly.
What you want to do is to add a new state e.g. TOGGLE to toggle the LED, right?
So the thing you have to change is editmask, so it would look like this:
editmask=0=OFF;1=ON;2=TOGGLE
Something i would always do is to start with 0 and not with 1 and set a default value.
Furthermore if you just want to switch between a few states like in this example I would use just 1 Byte (u8) instead of 4 Byte (u32).
So in the end it would look like this:
#config0 LED1_config_0 down title=“LED 1 Config”
LEDstate u8 title=“LED state” editmask=0=OFF;1=ON;2=TOGGLE default=0
I hope this helps you.

Kind regards,
Johannes

Hi Johannes,
Thats exactly what I mean! Thanks for the helpful answer and tips.

Kind regards,
Marcel

Hi Johannes,
ich habe nochmal eine Frage zur vergangenen Thematik:
#config0 LED1_config_0 down title=“LED 1 Config”
LEDstate u8 title=“LED state” editmask=0=OFF;1=ON;2=TOGGLE default=0

Wenn default=0 ist, sollte in der ComboBox standardmäßig beim öffnen von LED1_config_0 im Portal OFF voreingestellt sein, bei default=1 dementsprechend ON, usw.
Bei mir ist immer der erste Wert voreingestellt, in diesem Fall also auch OFF.
Wann genau kommt der default Fall zum tragen?
Viele Grüße,
Marcel

Hi Marcel,

der Defaultwert kommt dann ins Spiel, wenn du an der Messstelle den Wert dieses Parameters noch nicht geändert hast. Wenn du den Wert änderst, wird das mitgespeichert. Dir wird immer der zuletzt eingestellte Wert angezeigt. Wenn du z.B. den Wert auf 2 setzt, wird dir, wenn du wieder auf die Einstellungen gehst, in der Combobox TOGGLE angezeigt, bis du den Wert wieder änderst.

Mit freundlichen Grüßen
Johannes

Hello @mklueh,

The default value is set as the initial value for the parameter when you create a site. If you change the “default” value for a Parameter in the data descriptor this has no effect to sites which have already been created using this data descriptor. If you add parameters to the data descriptor the “default” value for this new parameters is applied to new sites as well as sites which have already been created using this data descriptor.

The reason therefore is:
If you create a new site the “default” values are used to setup the configuration for this site. Changed “default” values have no effect as for the parameter already a valid setting is available. If parameters are added to the Data Descriptor existing sites have no valid settings for the new parameters. Therefore the “default” values are adopted for the new parameters. The existing settings in the configuration are not modified as they are valid.

Kind regards
Josef

Hi,
ok, that makes sense.
Thank you very much.

Kind regards,
Marcel