Hi Tonny,
right now there is just one step missing. In your constellation each time when your device class method ‘ApplicationDeviceClass__UpdateSelChannel’ is called, it only calls the function ‘UpdateSelChannel’ without calling your application function ‘SelChannelSlot’. So, the slot function ‘SelChannelSlot’ is never triggered and your text won’t update too.
To connect your device class with any function within your application, it’s highly recommended to use an so called Property Observer. Therefore you should declare a variable ‘SelChannel’ in your device class which can be changed by the update method ‘UpdateSelChannel’. As you can see below, within the function ‘UpdateSelChannel’ the device class variable ‘SelChannel’ will be updated if it’s changes. Additionally with the command ‘notifyobservers ^SelChannel;’ your device class is able to inform property observer(s).
As next, you need to setup the already mentioned Property Observer. For this, please drag & drop the brick ‘Property Observer’ from ‘Templates->Device’ into your application class and set it up like in the picture below:
As you can see, the property observers ‘Outlet’ is connected to the device variable ‘SelChannel’ which is defined in the device class and the ‘OnEvent’ function is linked to your already defined slot method ‘SelChannelSlot’. Now, every time when you call the device class function ‘ApplicationDeviceClass__UpdateSelChannel’ within your C development project, it automatically updates the string element as well.
By the way, your slot function ‘SelChannelSlot’ is already configured correctly:
Hopefully this helps to modify your own project, otherwise you can download here the example project that I’ve used. With this project you can simulate with the keyboard key ‘A’ the behaviour when you use the Embedded Wizard Prototyper.
Best regards,
Tim