Application examples

The PLC Agent uses CODESYS libraries and example projects as a knowledge base. This enables it to provide support for specific tasks related to the programming of WAGO components.

The following examples provide a brief overview of possible questions:

 

Below are some specific examples of possible queries:

► Implementation of Projects with WAGO Devices

This example searches for options to connect a PFC to a cloud and log measured values.

Example prompt

„My machine sends measurement values to the PFC in a 30s interval. I want to send the data to the cloud every 15 min. Which option do I have to log the data with my WAGO device? Please return the specific function blocks (fb).“

Possible answer

„The library you need is probably the WagoAppCIoud. Below are the options you got to periodically send your measurement data to the cloud with their steps and function blocks needed:

If you could further specify the requirements of your application, I could recommend you one of the options and continue with providing you an implementation suggestion.“

 

► Generating Code

A code example is sought to obtain the measured values from a 3-phase power measurement module.

Example prompt

„I've connected the WAGO 750-494 3-phase power measurement module to my PLC. How can I access the measurement values? Please explain what I need to do and provide a code example if possible.“

Possible answer

„Use the WAGO 750-494-specific function block from the WagoAppPowerMeasurement (FbAC_Values_494, FbAC_Compact_494, …).

The FbAC_Values_494 provides 4 measured values. These are selected through corresponding IDs in the parameters. You can specify the IDs for the measurement values you want to access. Here is a list of the IDs for each possible value: …

The FbAC_Compact_494 provides the most common measurement values.

The following code example shows how different values are accessed through the FbAC_Compact_494:

//— ST Code —

//— End of ST Code —

If you tell me the specific values, you want to access I can refine the code example.“

 

► Explain Existing Code

Help should be provided to navigate unfamiliar source code. The code is transferred to the chat window for this purpose.

Example prompt

„My colleague sent me a CODESYS project. Can you help me understand the project by explaining the code in serialCommunication (PRG)? Here I send the code: …“

Possible answer

„This PROGRAM implements a simple, robust serial-communication cycle: open a configured serial port, send a message, wait for a reply, mark when a full reply has arrived, wait until the reply is processed by other logic, then repeat. It uses WAGO’s FbSeriallnterface_cpt function block to abstract the low-level device access.

Components:

Code structure:

Please reach out to me if I can help you making changes to the code.“