Writing data to S7-300 via opc

ssantiago

Member
Join Date
Mar 2010
Location
Minsk
Posts
28
Hi, friends. I got a strange situation trying to write data to db in s7-314-2dp via opc-server.

The code is written on C#:

I'm connecting to OPC-server. Reads all items. After it - I save OPC-group object to private member gr.
Code:
 private OPCAutomation.OPCGroup gr; // My OPC group
After it I'm trying to write data to OPC-item via my OPC-group:
Code:
try
{
    gr.OPCItems.Item(name).Write(val);
}
catch (Exception)
{
}
And happens unpredictable to me thing: my program hangs, at this moment plc still has old value in db. After it I press "Stop Debugging" in studio and studio hangs for about 1 minute and then data, which I was writing to plc, apears in plc.

Thanks for attention.
 
Last edited:

Similar Topics

Hello, I am trying to send a keyboard command to a pc (press the letter "Y" followed by "Enter". I am modifying existing code which just sends a...
Replies
7
Views
2,568
Hi again guys, This forum has been great for all the questions ive asked these last few days. Another one now.. haha I am currently working...
Replies
3
Views
4,191
Hi friends, I m new to plc programming and i don't know how to write data block in boolean method. I m needed to write data block to...
Replies
0
Views
1,687
Hello everyone. My question is about moving data into selective bits in Controllogix. I want to move a hex value into the last word(bits 16-31) of...
Replies
3
Views
1,455
I have a third party application designed in vb that is reading/writing data to an AB SLC 5/05. I am unable to write more than 80 words of data to...
Replies
0
Views
1,450
Back
Top Bottom