Industry Online Support
Technical Forum
8/24/2006 5:55 AM | |
Posts: 3 Rating: (0) |
Hello: My English is not very well, so invites everybody to pardon me. Now i am studyinguse Borland C++ Builder to read thevalue of SIEMENS PLC S7-300 CPU315-2DP,i use the SIEMENS CP1613 card to link the PLC,now i use the OPC SCOUT can link to PLC and can read/write,that means it link correctly. But now i use BorlandC++ Builder to create an element(that include in SIMATIC NET),the element's name is S7Data,Myprogram code is as follows: //This is write: Variant value; long state; long result; value=Edit2->Text; result=S7Data1->WriteVariable(WideString("S7:[S7_LINK1|VFD1|CP_H1_1:]DB98,CHAR0,1"), value,0); //This is read: Variant value; long state; long result; result=S7Data1->ReadVariable(WideString("S7:[S7_LINK1|VFD1|CP_H1_1:]DB98,CHAR0,1"), &value, &state, 100); Label1->Caption=result; The result should be 0 if the program is correctly,now i say my question: My program can write the value into PLC, but i can't read it,i don't know why,if i change the writevariable's address,(like :[S7_LINK1|VFD1|CP_H1_1:]DB98,CHAR0,1"<----this), the result wno't be zero,but if i change the readvariable's address, the result still be zero...i don't know why my readvariable is no action, Please someone help me,i had send an e-mail to www.siemens.com.tw, but no response, i hope here is someone can help me, but my English is not well,please help me... |
Follow us on