Saturday, May 11, 2019

5 Tips for Newcomer Codesys Programmer


Today we gonna talk 5 tips for newcomer Codesys programmer, this experience purely coming from my experience while using Codesys software. I got some mistakes while programming, i try many times, read from other forum read the Online Help to fix it, finally i got 5 basic tips as a beginner like me. Here we go :



1. Right in choosing a project template
Again i said this is important, since i make instruction for making Raspberry talking Hello World. Wrong selecting project template will make you confuse why another library/ function not working as well. as for example i create new project  with new Empty Project template.


You will get blank project without device include, but don't worry about that you still can add the device by right click > Add Devices.


I found another issue when i code with empty template, also you need to add the POU and Task for programming object into the devices.


After that add you POU into the Task Configuration, because if you not add the POU into the task your program will not running, Task Configuration like Void Loop on arduino.


And finally you need also add the library with double click on Library Manager by following below picture, add the Standard library and Util library.


Now at least if you choose empty project template we have the solution to solve your self from miss understanding.

2. Right in choosing target devices
When you start using empty project or standard project, you will facing with selecting target devices. I got some mistakes when selecting my target devices. This is the way i find the answer and solve the issue, especially if you use Raspberry Pi as a target devices since we can choose the runtime Multicore or Standard Core. You will see the message below picture if you wrong select the devices when to do connecting or uploading project.


To fix the issue, First navigate to Raspberry toolbox (Tools > Update Raspberry), then click configuration. You will see two selection button, once where button is selected its describe your runtime type.


Second navigate to Devices toolbox (ALT+0) you will see your device below the project name. Please check the device type following below picture.


After knowing what runtime you use, you need to update the devices following installed runtime on your PI by right click project devices > Update Device and choose the right option.


After changing the device with correct one you can continue uploading your project into target device.

3. Turning on the Smart Coding feature
When you coding with Microsoft Visual Studio you will get intellisense or auto complete feature, so coding will be easier because you don't need to remind all the parameter or variable that you made. 



On Codesys we can also activate this feature, by default this feature is turned off. Navigate to Tools > Option and find the Smart Coding options and follow below picture to check the button.


Once you finish setting the options Smart Coding, when you try to types the parameter or variable some item will be appear see this picture below for result.


4. Don't forget to save your progression

This things is should be easy habits for new programmer, but sometimes we forget to do it until our computer get not responding and we lost all of our project. Sure we don't need this things happen, please take look at the upper window of Codesys Software, you will see your project name with star symbol "*". If you see star symbol like " Try Empty Project.project* " it means your project not saved and if there is no start symbol your project already saved.

5. Keep stay up to date with any information
The last tips from me is don't hesitate to ask on forum also on this blog, to solve the issue or suggest for a good things. You can come to Raspberry forum to see what people talk also visit the Codesys it self forum for detail information.

That's all for today,  i hope you enjoy for my self experience tips. Again i want to say if you like this blog share to other people and subscribe so you can stay up to date. For all, thanks for reading and  happy trying.

No comments:

Post a Comment