They can declared anywhere in declaration. Below are examples
myBool AT %MX0.0 : BOOL; //Boolean Type
myInput AT %IX0.0 : BOOL;
myOut AT %QX0.0 : BOOL;
myByte AT %MB0 : BYTE; //Byte Type
mySINT AT %MB0 : SINT;
myUSINT AT %MB0 : USINT;
myByteArary AT %MB0 : ARRAY[0..10] OF BYTE;
myWORD AT %MW0 : WORD; //16 bit types
myINT AT %MW0 : INT;
myUINT AT %MW0 : UINT;
myWordArary AT %MW0 : ARRAY[0..10] OF WORD;
myDWORD AT %MD0 : DWORD; //32bit Types
myDINT AT %MD0 : DINT;
myUDINT AT %MD0 : UDINT;
myReal AT %MD0 : REAL;
myDwordArray AT %MD0 : ARRAY[0..10] OF DWORD;
mySTRING AT %MB0 : STRING; //STRING
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
yes it is a known location , and you when having several PLC in a communication like the old MODBUS you can ask any plc for a memory location and get its results.
Many HMI displays work with these MARKERS.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Maybe this will help. This is an excel sheet with how the memory is aligned. Like Shooter said not all PLC/HMI align the memory the same. This sheet is based off SoMachine/Vijeo hardware built by SE.
Hi,
Can any give me an example of how %M is used in the program,means where I have to declare this ?
Thanks
same place as you would do with the in and outputs
I tend to put them all global so i can see and change them anywhere.
They can declared anywhere in declaration. Below are examples
myBool AT %MX0.0 : BOOL; //Boolean Type
myInput AT %IX0.0 : BOOL;
myOut AT %QX0.0 : BOOL;
myByte AT %MB0 : BYTE; //Byte Type
mySINT AT %MB0 : SINT;
myUSINT AT %MB0 : USINT;
myByteArary AT %MB0 : ARRAY[0..10] OF BYTE;
myWORD AT %MW0 : WORD; //16 bit types
myINT AT %MW0 : INT;
myUINT AT %MW0 : UINT;
myWordArary AT %MW0 : ARRAY[0..10] OF WORD;
myDWORD AT %MD0 : DWORD; //32bit Types
myDINT AT %MD0 : DINT;
myUDINT AT %MD0 : UDINT;
myReal AT %MD0 : REAL;
myDwordArray AT %MD0 : ARRAY[0..10] OF DWORD;
mySTRING AT %MB0 : STRING; //STRING
Hi,
Thanks for the reply.
What is the difference between
sarath:array [1..10] of DWORD; and myDwordArray AT %MD0 : ARRAY[0..10] OF DWORD;
Is it just that %MD0 is known location?
Thanks
yes it is a known location , and you when having several PLC in a communication like the old MODBUS you can ask any plc for a memory location and get its results.
Many HMI displays work with these MARKERS.
Maybe this will help. This is an excel sheet with how the memory is aligned. Like Shooter said not all PLC/HMI align the memory the same. This sheet is based off SoMachine/Vijeo hardware built by SE.
SoM Modbus Table.xls [418.5 KiB]