Knowledge Base
Applied Automation Using Embed...
Basic Project with LD Micro
6min
the project below is designed to introduce you to the basic requirements of creating a project it's a "hello world", where simply triggering an input sets an output ld micro requires a few steps to set up the environment and the mcu, and this is complicated by menus only accessible as part of the setup process create a new file from the file menu, select "save as" locate a suitable folder for your project enter a file name, for example, "myfirstproject" click save select the mcu before you can create any ladder, you must either select no device, or a device to write ladder for for the purpose of this tutorial, we will use the pic16f887, which is one of the devices available on the scale auto see also recommended devices docid\ p2y65rcbj1tb9 9az6j7o to setup the device, do the following menu > settings > microcontroller > microchip10 16 mcus > microchippic16f887 44tqfp menu > mcu parameters plc configuration > plc cycle time set to 20ms plc configuration > mcu crystal frequency set to 8mhz tap ok at the top right of the screen save the file to store changes configure an input input is represented by two vertical lines, and is prefixed by the letter x to create the input, do the following ensure you have completed select the mcu above create the input highlight a rung number by left clicking the number, and then select instruction > contacts / coils and relays > insert contact input pin, and the contact is displayed with the designation xnew left click on the newly created input, and in the name field change the name, for example, in1 and client ok the contact name is now renamed to xin1 in the i/o listing, select xin1, and double click from the i/o pin listing, select the relevant i/o click ok, the i/o is now configured as a standard digital input configure an output the output is represented by two round brackets, and only one output is normally used per rung to configure the output, do the following to do this ensure that you have ensure you have completed select the mcu above ensure that you have created an input, as above to create the output highlight a rung number by left clicking the number, and then select instruction > contacts / coils and relays > insert coil output pin, and then the output coil is displayed with the designation ynew left click on the newly created output, and in the name field change the name, for example, out,1, and click ok the contact name is now renamed to yout1 in the i/o listing, select yout1, and double click from the i/o pin listing, select the relevant i/o click ok, the i/o is now configured as a standard digital output the code can now be compiled programming the device the device is not programmed directly from ld micro programming the device now requires that you use the hex file created by compiling ldmicro and program the device programming options include mikro c bootloader docid 1w vtboze3thviztjf2kb programming the device docid\ cwfrveyggcdu25v63spki