- 14
- 57 834
AT&U
เข้าร่วมเมื่อ 21 ก.พ. 2021
AT&U offers engineering services for efficient, safe, and connected automation. The software design and programming of Programmable Logic Controllers (PLCs) are our specialties. Through our experience in the field of special mechanical engineering, our deep knowledge in the IEC 61131-3 control languages, and the extended use of a variety of hardware vendors, we'll provide you with the best suitable automation solution for your products. It doesn't matter if the safety and non-safety concepts of your system are ready and you need someone to create the application for them, if you're beginning from scratch or you need an innovative partner with whom you can get on the IoT-board, we are there for you!
CODESYS -Differente between pass by vale and pass by Reference
Source code: github.com/ATandU/PassingArguments
Explaining the difference between pass by value and pass by reference.
Passing an argument by:
- Value
- Pointer
- Reference
- VAR_IN_OUT
Creating an immutable argument.
Getting the execution time by of pass by reference and pass by value.
Explaining the difference between pass by value and pass by reference.
Passing an argument by:
- Value
- Pointer
- Reference
- VAR_IN_OUT
Creating an immutable argument.
Getting the execution time by of pass by reference and pass by value.
มุมมอง: 2 034
วีดีโอ
CODESYS - List all files in a directory. Write a specific file type (.csv, .txt, etc) into a list
มุมมอง 3.9K2 ปีที่แล้ว
Source code: github.com/ATandU?tab=repositories - Open a specific directory - Read all the files in the directory - Write a specified file type, like .csv, .txt, etc. into a list (array of strings) - Close the directory
CODESYS - Runtime polymorphism using inheritance (OOP)
มุมมอง 4.8K2 ปีที่แล้ว
Source code: github.com/ATandU?tab=repositories - Explanation of compile and runtime polymorphism, the object interface and the object property you can fin in the previous video: th-cam.com/video/dcSW0X4gM98/w-d-xo.html - We use a pointer to the base class to point to its child classes. Over the pointer we are invoking the correct method in the child class. - Inheritance: The capability of a cl...
CODESYS - Runtime polymorphism using an ITF (OOP)
มุมมอง 3K2 ปีที่แล้ว
Source code: github.com/ATandU?tab=repositories - Polymorphism is one of the pillars of the OOP and means "Having many forms" - There is a Compile-time polymorphism also known as static polymorphism or early binding and it can be achieved with functions overloading. (not only) - The Runtime-time polymorphism also known as dynamic polymorphism or late binding and it is when the function call is ...
CODESYS - Memory allocation of arrays and function blocks with the NEW & DELETE operators.
มุมมอง 4.1K2 ปีที่แล้ว
Source code: github.com/ATandU?tab=repositories - NEW and DELETE operators - Allocating a standard data_type and allocating a user_defined_type - Accessing the elements of the allocated array with ptrName[n] and ptrName = (SIZEOF(DATA_TYPE)*n). (n=0...elements -1) - Use of NEW and DELETE in a FB - Sort and Find functions explained: th-cam.com/video/Ny8JDpRkHKc/w-d-xo.html TIPS: - When the alloc...
CODESYS - Bubble sort, filter function for an array of string without knowing the size of the array
มุมมอง 2.2K2 ปีที่แล้ว
-What does the [*] operator do and what the UPPER_BOUND and LOWER_BOUND means you can check in the previous video th-cam.com/video/sn84dS9Psic/w-d-xo.html - Simple Bubble sort from A-z and from z-A. (This works for any basic datatype) - Search function that is checking all the elements of the source array and if the searched phrase is found in the checked element of the array, this one will be ...
CODESYS - How to pass an array to F_ FB_ or M_ without knowing its size in the function itself
มุมมอง 3.7K3 ปีที่แล้ว
- 2 Ways how to pass an array to F_ FB_ or M_ without knowing its size in the F_ FB_ or M_ - The bodies of the F_ are dummies and just fill the Arrays with the elements number. - I will create a video in which I'll pass an Array of Strings (List with program names) and create a sort function using the bubble sort method. A second method will filter the program names. Tips: - Prefer the [*] oper...
CODESYS - Random Number Generator, Itf and Visu Template Part 2
มุมมอง 1.9K3 ปีที่แล้ว
- Using the Interface of the Object "Random Number Generator" - Creating the Function Block and the ITF: th-cam.com/video/oUEzksl4Ucs/w-d-xo.html - Creating a simple Visu Template and passing the ITF of the Object "Random Number Generator" to it. - Tips: - Do not use single "direct" variables for the Visu of an Object. If you want to visualize more than one object from the same type, you have t...
CODESYS - Random Number Generator, Itf and Visu Template Part 1
มุมมอง 6K3 ปีที่แล้ว
- Creating a simple Random Number Generator - Use of SysTimeGetMs() Function - Creating an Itf as a Structure In the second part of the video I'll create a Template for the Itf. The Template will be used for objects from the Itf type.
CODESYS - How to use the "ANY" - data type
มุมมอง 2.5K3 ปีที่แล้ว
- ANY Data Type - ANY Structure (TypeClass, pValue, diSize) - Example how to use the ANY Data Type in FB - Creating a FB to convert ANY_INT in REAL with a decimal point. - CODESYS Generic Compare Function with ANY NOTE: The FB must be finished if you want to use it in your project. Some Tips: - Set an ERROR if the passed Var doesn't match the CASE. - Reset the Output result if the passed Var do...
CODESYS - Difference between pointer and reference
มุมมอง 8K3 ปีที่แล้ว
- A pointer from type T points to an object from type T (T = basic or user-defined datatype) - A pointer holds the address of the object that is pointing to - The fundamental operation with a pointer is called "dereferencing". The dereferencing in CODESYS is done with the symbol "^" - A pointer can point to a different object at a different time - Before dereferencing a pointer and assigning a ...
CODESYS - Get a char from a string using reference and pointer
มุมมอง 2.6K3 ปีที่แล้ว
Two functions: 1. Get the n-char from a sting using reference (n=1...sting length) 2. Get the n-char from a string using pointer (n=1...sting length)
CODESYS - Data Logger
มุมมอง 10K3 ปีที่แล้ว
With the AT&U data logger, you can log any type of variables you like into a logbook. Through this process, you can easily find errors in the code. In this video 3 variables from type bool, int and string are stored on change.
CODESYS - File management
มุมมอง 2.4K3 ปีที่แล้ว
This video shows a quick look at the AT&U Data Management Functional Block and its basic functions (Create a file, Write to a file, append to a file, read from a file) 1. Customising row and column over constants (in this case 1000x10). 2. Fill a two-dimensional array with the data. (String row_xxxx, column_yy) xxxx= 1..1000, yy=1..10 3. Create a directory and a file over the Data Management FB...
IN_diMin := -2147483648; IN_diMax := 2147483647; Ups… _diDiv + 1 = 0 → _diResult := … MOD 0 → division by zero
IN_diMax := -IN_diMin; // -2147483647 ⩽ IN_diMin ⩽ 0 Ups… _diDiv + 1 = 1 → _diResult := … MOD 1 is always zero → _diResult is always equal to IN_diMin
can u share the program?
hai, can u share this project.
Hi! Very helpful video. Only one advice, it is easier to do it with only one structure and calling three fb’s also as a reference in the frames 😊. Thanks for your videos
why you upload something without code and you don't say which library you use.
Excellent video!
Can i use memory allocation by __NEW for interfaces?
Thank you very much by your video. I can't see your FB_DataManagement. Please explain for me.
Bubble sorts for big data isn’t efficient.
Hi, Thank you for uploading but i ran into some issues (i am using TwinCat 3) 1. Itf does not generate the FB and IN and OUT automatically when calling in Main. (i am sure some settings need to be turned on). 2. All my numbers are negative. 3. it seems to only generate couple of number and start repeating them. (*One Shot*) _rtExecute.CLK := In_xExecute; _rtExecute(); IF _rtExecute.Q THEN _iStatus :=0; END_IF (* State Machine*) CASE _iStatus OF 0: IF _rtExecute.Q THEN Out_xDone := FALSE; Out_diRand := 0; _diDiv := (In_diMax - In_diMin); _diResult := TO_DINT (SysTimeGetMs()) MOD (_diDiv +1); _iStatus := 100; END_IF 100 : Out_xDone := TRUE; Out_diRand := _diResult; END_CASE i am trying to make a Dice Roll game. Thanks for any help.
Maaan thank you very Much, the video is sublime!!! It's a surprise for me that it's possible to write program for PLC's in a full-blown OOP style!!!
Very cool, thank you! Looks like Codesys 3.5 ST is a full-blown OOP language, so flexible. Inheritance, encapsulation, polymorphism, it supports all of those. Sweet
Goog explanation. But the amount of ads throughout the video is beyond funny.
wow I finally get it.Thanks a lot
as useful as a condom in a convent...
Thanks for your videos May I ask what exactly the advantage when using this in a project
Can you share an example about object oriented programming with hardware I/O?
Can I get the library for random number generator.
can you share the code?
Hi! Can ANY data type be used to pass any structure as an input?
Yes, but you will not know the structure datatype, just that it is a structure. You will need to pass in the data type as a parameter to your function so that it knows how to treat it.
It is very helpful. I have watched this many times to understand. Thanks for sharing your knowledge.
Very nice explanation about polimorfism. I was looking for an easy way to understand it using the codesys environment. Thanks a lot!
Hi there, Geat videos! I've not used interfaces or inheritance in my projects before. What is the advantage of using this type of implementation versus simply creating specific functions or funtion blocks? For example, just having a function for calculating area each shape and returning a result.
For me personally there are some reasonable reasons. 1. An interface / abstract class allows you to guarantee that certain methods exist and return the required types. When the compiler knows this, it can use that assumption to work with unknown classes as if they had certain known behavior. 2. If the classes C, D, E,… implement an interface or inherit a abstract base class AI, you can use a C, D, E,… whenever an AI is expected. Simple example is the function that returns the area of a shape. The function does not care what kind of shape it is passed to it, but if it’s a shape, it will calculate its area. When you don’t have an interface you have to have a explicit function for every shape, in other words, where C is expected you can‘t pass D, you can only pass C. So you need the explicit shape. 3. If you use an abstract class, you can have explicit methods with a default implementation, that are provided to all children classes. Let’s say as an example the calculation of all shape areas is very heavy and complicated. For these we should provide some common functionalities to help us with the calculation. We can create some concrete methods (the common functionalities) and use these methods for the calculation of every area in every child class, you don’t need to copy/paste those to every new function block (circle, triangle….) or break the encapsulation of a class. In simple words, when you provide the concrete methods in the base class, all child classes can have their own implementation of the area, but use the common methods of the base class without having to define those for every shape. 4. You will have a better code maintainability.
@@atu1330 That's very helpful to know! Thanks for taking the time to explain further 😊
Is the AT&U library available, so I can run some tests?
I will provide everything soon in the github repository.
Great content 👍👍
Great content. Thanks!
How would this work with passing in an array of interfaces?
make the code available for everybody!
good job. The video is a good introduction to __NEW and __DELETE with all its pitfalls. Great!
My only suggestion is to interlock at line No 4 in the IF logic with AND (IN_ToSort[_diIdx_2 + 1] <> ''). This is just to avoid comparing if null string in array then no need to sort with that particular element. If in case array has few null strings then it sorts and keeps that null in top. Excellent share, Thanks a lot for the help too 🙂
You can share the project?
Thanks man 🙏 Can you please explain in which case one may need bubble sorts algo in PLC?
I used it alot. I rather say: Why not?
Thanks for the clear explanation bro.
It is a pity that the video is not in Russian. But it's still useful. Keep going maestro...)
very good, if you could host it somewhere it would be very good, to be able to have the example projects ... Thanks for everything.
Hey Victor, thanks for your suggestion. I’m gonna create a git repository and you will be able to download the source code from the videos. Please have some patience until I am able to do it.
@@atu1330, thanks you 👍🏻😉
@@atu1330, thanks you
@@atu1330 , have you had time to create the repository?, thank you very much for everything...
Hey Victor, you can find some of the programs in the repositories. All the projects are saved as Archive. github.com/ATandU?tab=repositories
very good, if you could host it somewhere it would be very good, to be able to have the example projects ... Thanks for everything.
very good, if you could host it somewhere it would be very good, to be able to have the example projects ... Thanks for everything.
very good, if you could host it somewhere it would be very good, to be able to have the example projects ... Thanks for everything.
Decent this is!! This channel needs P R O M O S M!
Thanks for the data logging info. But Where can i find the above project? Thank u.
Your videos are of great help to me, thanks again!
Thank you, it’s been so helpful!
More videos please :)
<identifier> : REFERENCE TO <data type> Example A : REFERENCE TO DUT; B : DUT; C : DUT; A REF= B; // corresponds to A := ADR(B); A := C; // corresponds to A^ := C;