writing status to PLC

Hi,
I was able to associate status of DO on my PLC via OPC connection. I could use your help on how to write (i mean change) status to my plc. Should I write a script or can i somehow do this through OPC server? Could you give me an example of how to achieve this?
Thanxs in advance!

Comments (1)

RSS Collapse / Expand
+
0
Insert Toggle Button, and in Click event add «OnClick» callback.Then add code:

 # Arguments: Object sender, EventArgs e
 def OnClick(sender, e):
	if sender.IsChecked == False:
		Application.GetChannel("opc_connection_plug.BooleanTag").Value = False
	else:
		Application.GetChannel("opc_connection_plug.BooleanTag").Value = True



Worked like charm for me.
Regards
avatar

Losmi84

  • 05 February 2012, 17:11

Registered and authorized users can post comments only.