Gets the value of the device from device class

64 views
asked Mar 9 in System Integration by Tonny

Hi Team,

      https://ask.embedded-wizard.de/3458/updating-a-view-text-object-from-device-class?show=3458#q3458

      I studied it ,but i still have a little problem.I couldn't understand when I studied step 13.  I set the  value of 120. 

      In the link above,which code is in step 13. Implementation in .c document ?(DeviceDriver.c ?)

      If i set Voltage 36V in my C Code(This is what I set outside ),and how can i get 36V in the code and display it?

      In addition,in the example-device-class-property-1.https://doc.embedded-wizard.de/device-class-property?v=9.30

This function requires me to declare externally?If I only want to get the value of the device, do I need to define it?

 

Best regards

Tonny.

1 Answer

0 votes
answered Mar 9 by Paul Banach

Hello Tonny,

concerning your first question, sorry but I don't understand what you mean. Are you looking for a way to notify the GUI when some device value has been changed? In such case the step 8-12 addresse it. The invocation of the function ApplicationDeviceClass__UpdateVoltage() in step 13 is performed from your C code. This invocation triggers then the observer from step 8 to execute its associated slot method from step 9. The displayed value should be updated thereupon. Or are you asking where to implement the code from step 13? In this is the case, the code can be implemented in any C module.

Concerning your second question, the C function write_dac_voltage_value() expects to be declared. This function is just an example to demonstrate the idea. In the real project you will have other functions. Please see the section Implement the OnSet method of the Property. It explains the possible approaches how to declare the C function. 

Best regards

Paul Banach

commented Mar 10 by Tonny

Hello Paul

     Yes,As you said.For example:I have a hardware knob,and when i turn the knob,I want synchronization with the HorizontalSlider on embedded wizard,I followed the 1-12 steps, in step 13 ,my code is :

    #define knob

    call function functions;

    call ApplicationDeviceClass_Update();

Can this method achieve my purpose ?   I just need UI show the data,and no functionality required.

Best regards,

Tonny

commented Mar 10 by Paul Banach

Hello Tonny,

I far as I understand your application case, yes, it should be the right way. Please ensure to call the right Update function. Please see for this purpose the section Update the Property in ANSI C and C++ compatible systems.

Best regards

Paul Banach

commented Mar 10 by Tonny
Hello Paul,

        Thanks for your  patient guidance ,I probably know how to use it .

Best regards,

Tonny

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...