declaration of variables?

mrnicks

Member
Join Date
Nov 2012
Location
ohio
Posts
20
I'm always hearing about the declaration of variables.

If I were to start to write a plc program and make a declaration of variables is that just a list of variables? I'm confused can someone shine a little light in this?
 
What PLC platform ?

In Siemens STEP7 you have FBs and FCs for "reusable code". It is possible to declare variables in the FCs and FBs. The declared variables are used in the code part of the FBs and FCs.
 
Yes, FB function blocks in Siemens is used to write reusable code where you declare variables that is used inside the FB.

I dont know the function blocks in Allen Bradley, but I think that it is a somewhat different concept. However, I am sure that you declare variables in a similar if not exactly the same way.
 
Rockwell, as is there way, uses different terminology from the reset the world. So, while any computer programmer or controls engineer for a different platform would call it declaring a variable, Rockwell calls it creating a tag. So, your tag lists are Rockwell's version of a declaration of variables. I'm kind of curious what they call it in the Yaskawa world.

In a lot of platforms (including everything based on Codesys), you can define the variables in the Structured Text standard format like this:

MyBool : BOOL;
MyInt : INT:=5; (*I initialize this INT to 5 on startup*)
MyArray : ARRAY[0..9] OF INT; (*an array of ints*)
 
This clears it up. I know tags. I just started with yaskawa motion controllers so I couldn't tell you just yet. I'm still learning everyday!



Rockwell, as is there way, uses different terminology from the reset the world. So, while any computer programmer or controls engineer for a different platform would call it declaring a variable, Rockwell calls it creating a tag. So, your tag lists are Rockwell's version of a declaration of variables. I'm kind of curious what they call it in the Yaskawa world.

In a lot of platforms (including everything based on Codesys), you can define the variables in the Structured Text standard format like this:

MyBool : BOOL;
MyInt : INT:=5; (*I initialize this INT to 5 on startup*)
MyArray : ARRAY[0..9] OF INT; (*an array of ints*)
 
I just started with yaskawa motion controllers so I couldn't tell you just yet.

The answer for Yaskawa depends on if you are using an IEC version of the controller or an original one.

The former is IEC61131-compliant so you would have to declare all the variables in a standard way using VAR...END_VAR (and the related) blocks.

The latter is a traditional address-based PLC so no declaration would be needed.
 

Similar Topics

Hi all in a SCL FB I've decalred some variables like this: VAR ShiftRegister:ARRAY [0..100] OF BOOL; ValvesOutputCMD: ARRAY...
Replies
1
Views
1,635
Hello. Is it possible to imoprt i.e. a excel list with variables I want in a DB? So I don't have to make every entry? Or maybe if there is a...
Replies
2
Views
2,853
Hey all, So I've had some experience with C++ style programming and I'm trying to figure out the best way to declare an array of numbers for each...
Replies
15
Views
1,518
Hello everyone ! I'm programming a PFC 750-8207 on e!****pit. I need to declare some vars in a POU, but not in variables declaration zone but...
Replies
2
Views
1,693
Hello, Does anyone know if there is a method or function that can be used to define the Trend start date? I would like my trend to automatically...
Replies
1
Views
1,459
Back
Top Bottom