Thank you for your videos but Im curious when should I use the DUT or Struct and when will I use the Global List..
@TohidAlizadeh Жыл бұрын
Thanks for your comment. You normally create and use a global variable (which will be inside a global variable list) when you need to have access to the variable globally in the project, from any of the POUs. Global variables could be Boolean, Integer, or of any type. While DUT is declared and used to fit your needs for a specific variable, which could be used only within a single POU, or could be placed in a global variable list. I hope this helps.
@ahoxha97488 жыл бұрын
Hello Mr. Tohid, Thank you for allowing us to access this great work. I am interested in Structured Text(ST), i have a project in twincat(visual studio) which is the same as codesys, and i'm trying to figure it out. There is a Function block (FB) which contains most of the code logic, and other structs, one Global variable list, and the Main(PRG) program of course where there are only variable declarations and the inheritance of FB in PRG. I wanted to ask what is the reason of using FB and Global Variables when we could use just Main(PRG) and structs. I checked your tutorials of ST but there aren't many. I've been searching on internet about ST tutorials but i had no luck, do you know any website which could provide broader information about the language.
@TohidAlizadeh8 жыл бұрын
+Admir Hoxha Thanks a lot for your comment and interest in my videos. I would say that the main aim of using Function Blocks (FBs) is to make the programming easier and more organized. Specially, when you want to do a specific task (piece of code) more than once in the main program. Then it would be better to create a FB and refer to that. You may use your created FB later on in some other project as well, saving you the time and effort. the concept is somehow similar to the idea of creating Functions in Matlab and using them later as well (if you are familiar with Matlab). The aim of using Global variable list, is to create variables which are accessible all around the project (in the main program, FBs, ...).I hope this comment would be helpful for you. I may later leave another comment providing resources on ST.
@ahoxha97488 жыл бұрын
+Tohid Alizadeh Thank you, I'm grateful
@abdullaheisajan23005 жыл бұрын
Hello Tohid, Thank you for the great tutorial videos you make. I was wondering why my counter doesn't get reset after reaching the PV value, or is it that the PV value is used for something else. Thanks in advance.
@TohidAlizadeh5 жыл бұрын
The counter continues to count even after reaching the PV value. It's output becomes True once it passes the PV value. To reset the counter, you should use the Reset input of the counter.
@muhammaddanish4253 Жыл бұрын
So it seems struct variables are not global variables ,so you can not directly access using it you need to instantiate that structure first in program?
@TohidAlizadeh Жыл бұрын
That's true. With Struct you create a new type of variable. You can instantiate a variable of the new type in the global variable list, if needed.
@azamafzaal7697 жыл бұрын
Hello Tohid, can you please upload a video creating functions/methods and calling them in the main program (ST)
@TohidAlizadeh7 жыл бұрын
Hi Azam, I will try to do so in the following days, however, for now, you can have a look at the following video, where TON and CTU function blocks are called within ST:kzbin.info/www/bejne/Y3e8l6yvmputhNU and this one, where you learn how to create Function blocks (in LLD, but you can do it with ST as well): kzbin.info/www/bejne/iX20dqeKq85mo5o Then, you can call the created function in a similar way to calling TON/CTU. I hope this will help you!
@azamafzaal7697 жыл бұрын
Thanks but i have seen this video already. I need to make a custom ST function/method and then calling it in the main program e.g. a derivative function (P.S. i know its already in the util library but i am not allowed to use it for my project)
@TohidAlizadeh7 жыл бұрын
I see. I will try to prepare the video till next week. I will update you here!
@TohidAlizadeh7 жыл бұрын
This video is for you: kzbin.info/www/bejne/oGrNnWpsaZVja9k I hope you will find it useful.
@V3loxX3 жыл бұрын
How can I use structs on more level? I mean struct in a struckt.
@TohidAlizadeh3 жыл бұрын
I think you only need to declare one structure first (call it struc01, for example), then in declaring the second structure, use struc01 as one element.
@ahsankhalid66725 жыл бұрын
Hello :) Your videos are really helpful. I would like to suggest that before explaining the actual program, it would be great if you first explain the topic on which you have written the program. In the case of this video, you should've explained what structures actually are and what are their uses. Otherwise, I really like your way of explaining.
@TohidAlizadeh5 жыл бұрын
Thanks a lot for your valuable feedback, Ahsan. I will consider it in my next videos (if I manage to make).
@tarrensmith96578 жыл бұрын
Hello Tohid, thank you for the great videos. Excuse my ignorance, but what is the purpose of a structure, why would you use it?
@TohidAlizadeh8 жыл бұрын
+tarren smith Dear Tarren, Structure type variables can contain more information within only one variable. When you want to group a set of variables which are related to each other in some sense, you can create a structure variable, and use each of those variable as the fields of the structure. Think about the Timers and Counters. Referring to them as a variable, you deal only with a single variable, Timer01 for example, however, you have some fields for the variable as Timer01.IN, Timero1.Q, Timer01.PT and Timer01.ET. In general, having Structure type variables makes the programming easier and the variables more compact. I hope this would help you. Let me know if you have any other concerns. You can also refer to the Google+ community, where I provide some more explanation in the written form, for the videos: plus.google.com/u/0/communities/114767566156039270858
@tarrensmith96578 жыл бұрын
+Tohid Alizadeh Thank you so much Tohid, this makes perfect sense. Thank you for your time and patience and great tutorials.