Page 1 of 1

Programming of a button

PostPosted: Fri 16. Oct 2015 9:19:39
by jbousek
Hi,

I am trying something that should be very simple, but I am failing at it.

I am looking for the correct way to programm a button to send a value (0 or 1) to a variable in the pmData object, if the button is pushed.


Best regards

Re: Programming of a button

PostPosted: Tue 20. Oct 2015 10:24:25
by admin
Dear Sir,

In order to get the described functionality, you have to proceed with few steps:

1) create the PmData object in your application and in this object create a variable (Boolean type can be used for this purpose)
2) create a PmPanel object and open it for editing in panel editor in order to add a new graphic item from the library - two state button
3) once the two state button exists double click it to edit its configuration - go to button page and use the dynamic binding button in the "Button state" row
4) define a PP binding to the existing variable in PmData object
5) compile the application panels and run the app
6) you can check the correct functionality by opening the info system: PmRoot/Data - vars page (don't forget to activate the auto refresh)

I have prepared a very simple example (attached)
jbousek.zip
(5.66 KiB) Downloaded 1184 times