classGettingStarted
Extends from Modelica.Icons.Information (Icon for general information packages).
Information
This package contains functions to exchange information between a Beckhoff PLC and a Modelica simulation model at runtime. The package uses functions provided through a C API provided for use by Beckhoff via *.dll-file and two header files by Beckhoff.
The user needs to provide the AMD net ID of the target PLC and the port of the machine, usually this is 851. Also the names of the in and output variables as they are named in the PLC need to be provided.
General Communication Procedure
Currently only functions to read and write a floating point number are provided. The communication is structured as follows:
1.) Before starting the communication call funAdsConstrutor() open an ADS port on the local system and connect to the foreign system;
2.) Send and receive with a fixed samplingTime values at runtime via funAdsSendReal() and funAdsReceiveReal();
3.) End communcation when simulation finished by calling funAdsDestructor().
Starting Point
A good starting point is the model ExampleAdsLoop which serves as an example how to handle the ADS communication within a simulation setting
Error codes from the ADS C API are reported via ModelicaFormatMessage() and displayed in the simulation tab.
Revisions
- November 01, 2015
by Georg Ferdinand Schneider:
Implemented - January 30, 2016
by Georg Ferdinand Schneider:
Revised for publishing