OpenPLC-with-LDmicro/C2/Introduction-to-LDmicro/English
|
|
Slide 1: | Welcome to the spoken tutorial on Introduction to LDmicro. |
Slide 2:
Learning Objectives
|
In this tutorial, we will
|
Slide 3:
System Requirements
|
To record this tutorial I am using:
|
Slide 4:
Pre-requisites
|
To follow this tutorial, you should have LDmicro installed on your system.
If not, please refer to the relevant LDmicro tutorials on this website. |
Type LDmicro
Click on LDmicro icon |
Let us launch the ‘LDmicro’ interface in Linux.
Go to the unity search bar and type ‘LDmicro’. Double-click on the ‘LDmicro’ icon. |
Open terminal
Type ldmicro |
You can also launch LDmciro through terminal.
Open the terminal by pressing Ctrl + Alt + T keys simultaneously. Type ldmicro. Note that all the letters in LDmicro are smallcase. Press ENTER. |
narration | Windows users can launch it by double-clicking the executable file. |
We can see Program editor window opens. | |
Point rungs | The horizontal lines in which we write our ladder diagram are called rungs.
The rung with ‘END’ instruction denotes the end of the ladder diagram. |
Point rails | The two vertical lines at the start and end of each rung are called Rails. |
Point left rail
Point right rail |
The left rail is connected to Positive, and the right rail is connected to Ground. |
Show the direction of current flow | Thus, the current flows from left rail to right rail. |
Highlight ‘Instructions’ | Now, we’ll see about instructions |
Slide 4:
Instructions
|
|
Now we will learn how to place instructions in LDmicro. | |
Switch back to LDmicro
Click on ‘Instructions’ and highlight the elements |
Switch back to LDmicro interface.
In the top menu bar, click on Instructions. There are many elements available under Instructions. |
Point cursor | Every instruction is placed at the current cursor position. |
Instruction >> Insert Contact
Highlight the Keyboard shortcuts |
We will first place a contact by clicking on Instructions -> Insert Contacts.
The letter ‘C’ in the Insert Contacts menu represents the keyboard shortcut. You can either use the menu or the shortcut keys to place the instruction. We can see that the cursor is blinking before the new Contact. |
Point to Xnew | We can now see that the contact is inserted at the current cursor position.
It is named as Xnew by default. |
Point to I/O list | We can see an Input Output list at the bottom of the window.
All the variables used in the program will be displayed in this I/O list. |
Point to the icon and show the tooltip | Below the menu bar, you can see a toolbar with icons which are frequently used.
For example, the first icon is ‘Normal contact’. You can use this tool bar as well to place instructions. |
Demo of cursor position | Next we will place a coil.
For that, place the cursor to the right end of the contact. This can be done by clicking with the mouse pointer at the appropriate position. Otherwise with the help of arrow keys you can change the cursor position. |
click on Instructions->Insert Coil | In the menu bar, click on Instructions->Insert Coil. |
Highlight Contact and Coil | We can observe that the contact appears red whereas coil in white.
This is because an instruction gets highlighted when cursor is placed near it. |
Highlight the coil and right power rail | Here, the coil is placed automatically at the extreme right of the rung.
This is because it is an output instruction. |
Place the cursor on the right side of the coil
Click on ‘Instructions’ HIghlight Instructions list |
Try placing an instruction to the right of the Coil.
Place the cursor to the right of the coil. Click on ‘Instructions’. We can see that no instruction is enabled. |
Therefore, no other instruction can be placed at the right of an output instruction. | |
Place the cursor on the right side of the coil
Click on ‘Instructions’ Highlight ‘Insert Contact’ Highlight ‘Insert Coil’ |
If we move the cursor to the left of the coil, we can place another contact.
But we cannot place a coil. Place the cursor to the left of the coil. Click on Instructions. |
Highlight the instructions which are disabled | We can observe few instructions are disabled.
These are output instructions. |
Highlight instructions on Instructions list except ‘Insert Contact’ | Contact is an example of an input instruction.
There are many such input instructions. We will learn about different instructions and their behavior later in this series. |
We can even add multiple input and output instructions in a single rung. | |
Slide 5:
Multiple inputs and Multiple outputs
|
|
Switch back to LDmicro | Switch back to LDmicro. |
Place the cursor below the ‘switch’ | First, we will see how to place input instructions in parallel.
Place the cursor below the contact. We can see the cursor blinking horizontally. |
Click Instruction >> Insert Contacts | Insert a Contact by clicking Normal Contact icon. |
Place the cursor to the right of the first contact
Click ‘Normal Contact’ icon |
Now, we will see how to place input instructions in series.
We can add another contact in series to the first contact. Place the cursor to the right of the first contact. Now, we can see the cursor blinking vertically. Insert Contact as shown. |
Place the cursor below the coil
Click on ‘Normal Coil’ icon Highlight both the coils in parallel |
Similarly, we can add Coils in parallel as shown. |
Place cursor to the left of the coil in the first rung.
Click on ‘Instructions’ Point ‘Insert Coil’ |
Let us try to add two coils in series.
Place the cursor to the left of the coil in the first rung. Click on Instructions. Notice that we are unable to add coils in series. |
Highlight ‘Edit’ in the top menu bar | We can also delete a particular instruction or an entire rung.
Now let us see how to delete. |
Select the Contact in series with ‘switch’
Click ‘Edit >> Delete Selected Rung’ |
Select the newly added contact which is in series with the first contact.
In the menu bar, click on ‘Edit’ Click ‘Delete Selected element’ |
Select the Contact in parallel with ‘switch’
Click ‘Edit >> Delete Selected Rung’ |
Similarly, delete the contact in parallel to the first contact.
And coil parallel to the first coil. |
Click ‘Edit >> Insert Rung after’
Highlight ‘Insert Rung Before’ |
Now, we’ll add a new rung.
Click on ‘Edit’. We can see options such as Insert Rung after, Insert Rung Before. I’ll select Insert Rung after. |
Place the cursor on the new rung
Click ‘instructions >> Insert Coil’ |
Now insert a coil in the newly added rung as shown. |
Now, we’ll see how to change the default names of these instructions. | |
Double-click on the contact
Change the name to ‘switch’ Highlight the other options i.e ‘Input pin’ etc. Click OK |
Double-click on the contact.
A dialog box opens. Change its name in the Name textbox to ‘switch’. Click on the OK button. |
Double-click on the Coil
Change the name to ‘LED1’ Click OK |
Similarly, change the name of the coil in first rung to LED1. |
Double-click on the Coil
Change the name to ‘LED2’ Click OK |
Change the name of the coil in second rung to LED2. |
Highlight the ‘YLED1’ in I/O list | The reflected names will appear in the I/O list. |
Point to X and Y | We can notice an X prefixed before the name of the Contact and Y for Coil.
The first letter is prefixed for some instructions by default. |
Click ‘Help’ >> Click ‘Manual’ | Let us see the manual of LDmicro for prefixed naming convention.
In the menu bar, click on Help and then Manual. |
Highlight the prefixes list. | Scroll down.
Under ‘BASICS’ we can find the list. These are the prefixes if we create a variable called ‘name’. The prefixed letter indicates what kind of object it is. Close the manual. |
Click ‘File -> Save’ | Let us save the file.
Click on File and then ‘Save’. Save pop up window appears. The ladder logic files are saved with the extension .ld |
Type sample.ld | I’ll save it as sample.ld in ‘LDmicro’ folder on the Desktop. |
This brings us to the end of this tutorial.
Let us summarize. | |
Slide 8:Summary
|
In this tutorial, we learnt to
|
Slide 9:
About Spoken Tutorial project |
The video at the following link summarises the Spoken Tutorial project.
Please download and watch it |
Slide 10:
Spoken Tutorial workshops |
The Spoken Tutorial Project team:
For more details, please write to us |
Slide 11:
Forum for specific questions: |
Please post your timed queries in this forum. |
Slide 12:
Forum for specific questions: |
Do you have any general / technical questions on OpenPLC?
Please visit the FOSSEE forum and post your question. |
Slide 13:
Acknowledgement |
Spoken Tutorial Project is funded by MHRD, Government of India. |
Slide 14:
Thank you slide |
This tutorial has been contributed by FOSSEE and Spoken Tutorial Project, IIT Bombay.
And this is Harsha Priyanka from FOSSEE team, signing off. Thanks for watching. |