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

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.
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: ... SetBit.htm


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: ... xtComm.htm
Posts: 66
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