one-state button

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

one-state button

Postby klopot » Wed 16. Nov 2016 13:38:28

Hello,
could You provide me with a simple working example of setting one bit in PLC on press of one-state button? (onButtonDown method for example).
I've tried defining methods for panel, methods for data, for pmfolder and calling them from button events but neither of them worked.
PLC is S7-1200, communication is working, two state buttons are working too.
But I need a momentary set button as trigger.
Regards
Klopot
klopot
 
Posts: 1
Joined: Wed 16. Nov 2016 12:39:51

Re: one-state button

Postby admin » Wed 23. Nov 2016 14:50:15

Dear Klopot,

You need to write a method into the onButtonDown event that uses the SetBit function - see more details here:

http://www.promotic.eu/en/pmdoc/Objects ... SetBit.htm

Example:

dim oVal
set oVal = pMe.Pm(here enter the path to variable in PmData object that is bound e.g. by data extension ExtComm with the variable in the PLC device you want to write to)
oVal.Value = Pm.SetBit(oVal.Value, 4, True)

More detail regarding ExtComm data extension:
http://www.promotic.eu/en/pmdoc/Objects ... xtComm.htm
admin
Administrátor
 
Posts: 67
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 2 guests

cron