Tutorial


To work with a PLC, you must connect it to you application.

  1. Open the developement environment Studio in the main menu under ? / Studio.
  2. In the Explorer, open the DataAccess project.

The DataAccess project contains the class S7Service with the subclass PLC1. This class serves as an example for the use of PLCs in your project.

Enter the data you need to connect to the PLC.

  1. Select class PLC1.
  2. Open the Property tab.
  3. Under Properties, choose the property IPAddress.
  4. In the Value text box, enter the IP address of the PLC you want to use.
  5. In the Rack and Slot properties, add the other values for determing the end point according to the same scheme.

 




FieldDescription
DatatypeSelection of the data type of the used .NET variable
RefreshrateFrequency of PLC updates (in time units or event-based)
OPC-Address<Range><.Datatype><.Start address>
Standard structure of the address syntax.

<Range><.Datatype><.Start address><.Bit number>
For Boolean values, the bit number is also required.

<Range><.Datatype><.Start address><.String length>
For strings the string length is also required.

 Range Syntax
 data block DB
 flag* M
 flag byte* MB
 flag word* MW
 flag double word* MD
 input bit* E, I
 input byte* EB, IB
 input word* EW, IW
 input double word* ED, ID
 output bit* A, O
 output byte* AB, OB
 output word* AW, OW
 output double word* AD, OD
 timer* T
 counter* Z, C
* Not yet fully tested

 Datatype Syntax
 BIT X
 BYTE B
 WORD W
 INT I
 REAL R
 STRING S


Start address
The start address determines the address from which the read/write operation starts.

Bit number
The bit number is always required for Boolean data types.