User Tools

Site Tools


code:open-source:s7netcom:getting-started

02 Getting Started

Palette

You can find the most relevant VIs for daily usage in the function palette in
Connectivity ⇒ S7NetCom ⇒ API:

Example / Test Tool

The function palette also holds a simple stand-alone tool which is useful for testing purposes at
Connectivity ⇒ S7NetCom ⇒ S7NetCom Simple Test Harness.vi


Connecting to a PLC

  • Use Create Object to instantiate a new S7NetCom object with all necessary connection and PLC settings.
  • Open a connection to the PLC with the Open Connection VI.
  • Now you can read and write data from and to the PLC with the polymorphic VIs Read Scalar PLC Data, Read Array PLC Data, Write Scalar PLC Data and Write Array PLC Data.

Reading and writing data

Use the appropriate polymorphic instance for the data types you want to read or write.

Simple read example
Simple write example

The following types are supported for read/write:

Scalar Array
Bit (boolean) yes -
Byte (U8) yes yes
Char (I8) yes yes
Word (U16) yes yes
Int (I16) yes yes
DWord (U32) yes yes
DInt (I32) yes yes
Real (Float32) yes yes
String yes -
TDL (Timestamp) yes -
S7 D&T (Timestamp) yes -

Closing the connection

To close the connection use the Close Connection VI.

code/open-source/s7netcom/getting-started.txt · Last modified: 2024/02/09 09:19 by joerg.hampel