.ModelicaADS.UsersGuide.Documentation.GettingStarted

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


Generated at 2024-11-21T19:25:40Z by OpenModelicaOpenModelica 1.24.2 using GenerateDoc.mos