In this article I'll shown how to realize a tank loading sequence function.

Defining a range of 16 tank (water tank), an automation system has to load them by a random adjustable sequence. Something like:

Loading                 -->--->--->--->--->---->---->-----

Loading Sequence  --1---3---6---2---10---11---9----  (1= tank n°1 ; 3=tank n°3 ;....)

Following picture show the sample application (for screen resolution reasons I take a 8 tank system in stand of 16, half function capability)

 Main

In this article I'll test the new Wago PLC controller series PFC200, model number 750-8202 /025-002. PFC200

 

osadl logoPinguiec60870 IconIEC61850 Icon

Recently I've been involved into a PLC development environment not equipped to physical memory storage area such as Merker, DB, %T,... In that project, I had to acquire a 32 bit single precision floating point variable from remote I/O located not directly as REAL but as 2 WORDS: respectively  LSW ( Least Significant Word) and MSW (Most Significant Word). Then, starting from the floating definition (Wikipedia):

 IEEE753 32Single Wiki

     31------------------------MSW-------------------16 + 15----------------------LSW------------------------0

 CodesysRelease

 

Substantially, downloading the Codesys ISO image and installing it into the Raspberry SD card, it's possible to transform your PI into a PLC controller. And it's for free! (you can buy the "fully licensed version for 35€, anyway the demo version run fully featured for 2 hours).

So I though to realize a cheap fully working distributed architecture where:

  • Raspberry PI= PLC Controller (Codesys 3.5 SP
  • Arduino Mega 2560= 1st remote I/O
  • Arduino Uno=  2nd remote I/O
  • Modbus TCP/IP: communication protocol

CoDeSys+ Raspberry+ArduinoLogo+Banner-Modbus= (PLC + remote I/O) 

In this article I'll describe how to use an ANY data type as pointer input in a simple subroutine in Simatic Step 7 v.5.5. ANY parameter type, according to Simatic on-line help, is a 10 byte length with the following structure:

ANY Definition