Programming of a button

This is the main technical forum for discussing problems that were encountered by users while developing PROMOTIC applications, and their possible solutions.

Programming of a button

Postby jbousek » Fri 16. Oct 2015 9:19:39

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
jbousek
 
Posts: 1
Joined: Fri 16. Oct 2015 9:11:22

Re: Programming of a button

Postby admin » Tue 20. Oct 2015 10:24:25

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 1404 times
admin
Administrátor
 
Posts: 70
Joined: Wed 12. Dec 2012 15:43:09


Return to I don't know how to...

Who is online

Users browsing this forum: No registered users and 9 guests

cron