Help - Search - Members - Calendar
Full Version: Modicon M340-Unity S
Forums.MrPLC.com > PLCs and Supporting Devices > Modicon
Marjan
Hello!

We have a problem with adding DI to digital registers. Is it possible to add all DI (I0.1.0 - I0.1.64) to digital registers (%M0-%M63) at once and not one by one? This I mean if there is a block to do this?

Have a nice day

Marjan
Henrique
QUOTE (Marjan @ Aug 5 2009, 01:58 AM) *
Hello!

We have a problem with adding DI to digital registers. Is it possible to add all DI (I0.1.0 - I0.1.64) to digital registers (%M0-%M63) at once and not one by one? This I mean if there is a block to do this?

Have a nice day

Marjan


1) Go to Tools -> Project Settings -> Language Extensions -> Data Types
enable the options: "Directly represented array_variables" and "Allow Dynamic Arrays"

Now you can build this expression: %m0:64:=%i0.1.0:64;
It means that you want to copy the variables %i0.1.0 ... %i0.1.63 to %m0 ... %m63
Done!
Marjan
Thank you!

Now I have another question. I want to put more rows in my FDB sections, but it seems it doesen´t wor, when I change it in the project settings. How can I do that?
I was using direct adresses until now (like %M2001,...), but now I want´t to use symbols instead of direct adress. Why doesen´t change in the program from %M2001 to Pump1 when I put the symbol in the variable table with this address?

Have a nice day
aggattapauer
QUOTE
Why doesen´t change in the program from %M2001 to Pump1 when I put the symbol in the variable table with this address?


Because basically direct address and symbol are two different variables or better instances of data types. Infact you could assign several symbols to the same variable.

For example you could have a variable at address %MW0 that you use in the program as auxiliary variable in a calculation

in that case you could assign many instances of it.

Variable1
Variable2
Variable3
Variable4

The expression for example is:

%MW0:=1+1;

%MW0:=%MW0*2;

%MW0:=%MW0/2;

%MW0:=%MW0-2;

For better "read" the expression could be useful to have different name for each step, so:

Variable1:=1+1;

Variable2=Variable1*2;

Variable3:=Variable2/2;

Variable4:=Variable3-2;

or better

addition:=1+1;

multiplication=addition*2;

division:=multiplication/2;

subtraction:=division-2;

all variables have the same address %MW0, they are instances of data type INT located in the memory at address 0.

I hope you could understand my poor english and my explanation...
Henrique
You must configure the area (number of rows x columns) for FBD projects.
In Unity click on Tools → Project Settings → Editors. You will see the configuration for FBD project area.

Unity is IEC based and most of the variables are non allocated variables (without a physical address), so you can program it the way you want.
If you used direct address, Unity will not change to symbols. Actually it does not have the same concepts that were used in PL7 for example. You don't have symbols, you have variables.
You should declare the variables with the names and types (bool, ebool, string, integer, real, etc) that you want to use. You do not have to concern about address, Unity will do that part for you.
If you need to use an direct address (%M or %MW) for network or HMI or if the variable is an I/O, than you can go to the Variables & FB instances folder and inform the address for these variables in the address column.
Marjan
OK, thank you for the information!

I want to lock the program with password, so that when someone want´s to change it or upload it from the PLC has to know some kind of password. Is this possible and how can I do that?

Have a nice day
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.