0:00
Programming and XGB PLC using a Structured Text or ST can be efficient for control engineers and automation professionals
0:11
Structured text is a low-level programming language commonly used for PLC's, Programmalogic Control or Programming
0:17
It offers a robust, structured approach, design control logic for industrial automated systems
0:23
ST programming is sometimes a more straightforward method for those with a background and programming languages such as C, C++
0:29
plus Java or Python over the more popular ladder logic diagram. In addition, ST can be used with artificial intelligence AI using the large language model, LLM
0:42
This is ideal for creating an example program to adjust to your application
0:46
This post will explore the fundamentals of programming and XGB PLC using structured text programming
0:52
We will be programming or lighted push buttons to control a start-stop circuit
0:56
Let's get started. The detailed information contained in this video can be found at ECC Automation.ca
1:02
A link has been put in the description below. If you have not watched the other videos yet, it will be links in the description below that
1:07
will start you at video one. There will be links to the rest of the videos in this series as well Start a new project Please start a new project with the free XG programming software we installed previously
1:23
We can start a new project by selecting the icon on the main menu
1:27
This can also be done by selecting the main menu project new project, or by using the shortcut
1:32
combination of Control Plus N. The new project window will now be displayed
1:38
a name for the new project. You will see the default directory in which our program will be stored
1:44
Under the heading PLC, ensure we select the make and model of an LS Electric PLC we will be programming
1:50
This is the XGB IEC series, XEM, DXXXXX, H2 type, and we will leave the LSPLC name as a default
2:01
Under the program heading, we can select the program's name and the programming language
2:05
We will name this program and ensure the language is set for structured text
2:26
Select OK Ensure the name does not have any special characters or spaces An error message will be displayed and you must correct the name
2:37
If we expand the program under the project window, you will
2:52
If we expand the program under the project window, you will see the local variable list
2:58
Note, as we program, ensure that you select save often. This can be done with the main icon page or main menu project save
3:09
Artificial Intelligence AI for programming STPLC code. Generative artificial intelligence AI can be used to create sample programs using ST
3:21
This is because ST is a structured language that follows a set of rules and guidelines making an ideal candidate for machine learning algorithms
3:29
ChatGPT is a powerful AI tool that can generate code for ST for a start, stop circuit
3:34
We can ask chat GPT to create an ST PLC program for a start stop circuit ChatGPT will respond with the following sample code This is very good to learn the structured methods of programming structure text in the PLC
3:54
We can ask CHOTGPT to create an STPLC program with green normally open and a red normally closed push buttons
4:01
When the green push button is pressed and not the red push button, the green LED light will come on and the red LED light will be off
4:08
If the green LED light is on and the red LED is off and vice versa
4:15
This is a little more detailed about what we are trying to accomplish with our ST PLC program
4:24
Once we understand the structured text or ST programming, we can program our PLC
4:36
Structured text, Gram, XGBPLC. Paste the sample code that ChatGPT created in the program window
4:46
The program code variables are entered into local variables for the XG-5,000 programming software
4:52
Enter the variables in this window for our sample program