×
Siemens Industry Online Support
Siemens AG
Entry type: Application example, Entry ID: 40603943, Entry date: 07/25/2014
(2)
Rate

Reading Data Matrix Codes With S7-1200 and Archiving Them in an MS Access Database (Set 27)

  • Entry
  • Associated product(s)
Task With an unambiguous coding, all the production steps for every part produced can be planned and carried out. The purpose of this application is to identify products reliably with a coding and to trace them after they have been delivered. A reader should read various codes on the surface of t...

Task
With an unambiguous coding, all the production steps for every part produced can be planned and carried out. The purpose of this application is to identify products reliably with a coding and to trace them after they have been delivered. A reader should read various codes on the surface of the products, and transmit them with RS232 to a SIMATIC S7 station and then to a database.


Fig. 01

Solution
The application example shows the concrete connection of the MV340 reader via the RS232 communication module CM1241 to an S7-1200 PLC. With the reader the matrix codes are transmitted into the S7-1200. The SIMATIC NET OPC server forwards these codes to the OPC Client (MS Access database). The corresponding scancode is searched for in a product table in the data base and its product name is transmitted back to the PLC via the SIMATIC NET OPC Server.

Functions of the application
The following functions have been realized in this application:

  • Configuration of the point-to-point connection of the communication module CM1241 RS232.
  • Receiving of the code from MV340 from the CM1241 and storing it in a data block on the S7-1200.
  • Using an MS Access database, in which an OPC client has been realized in VBA for the communication with the PLC.
  • Monitoring the communication between the PC and the PLC.


Fig. 02

Advantages and benefits
This application provides several universal S7 and PC program parts you can easily adapt for your projects. In particular, the communication between SIMATIC S7 and OPC Client is structured on the PC side and also in the SIMATIC S7 program so generally that it can be used for many variants of communication between the SIMATIC S7 and the PC.

Downloads

Content of Downloads

Download

Flyer 40603943_Set_27_Flyer_V20_en.pdf ( 227 KB )
Documentation 
Reading Data Matrix Codes With S7 and Archiving Them in an MS Access Database
40603943_DataMatrixCode_S7-1200_DOKU_V20_en.pdf ( 2681 KB )
Code 
STEP 7 V12 project for the application example
40603943_DataMatrixCode_S7-1200_CODE_V20.zip ( 5565 KB )

Last modification
Figures, Flyer, Security Note


Security information
In order to protect plants, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art industrial security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about industrial security, please visit
http://www.siemens.com/industrialsecurity.