Schneider M340 And Magelis Hmi With Unlocated Variables

Brendonh

Member
Join Date
Jul 2013
Location
Johannesburg
Posts
88
Hi All

Hopefully someone can help me, i have a Schneider m340 PLC with a magelis HMI that was pre-programmed by the supplier of a piece of equipment.

at the end of the day i want to monitor the plc using wonderwares modbus tcp io server (DASMBTCP).

the trouble is the plc logic is written entirely with unlocated variables, and I assume the hmi is using Schneider's OFS factory server to read and write to/from the plc based on the fact nothing is addressed.

obviously my io server cannot read unlocated variables, so i attempted to copy the unlocated variable values into located memory with unity(just a simple "mov" function block).

When i did this the plc continued to function as normal and i could read the values in intouch, and everything looked fine remotely, but the local hmi stopped functioning, and could no longer read or write to the plc for all variables not just the ones i "copied".

To get the hmi going again i had to do a full download to the plc with the original logic i had made a backup of.

I attempted it again using only 1 variable and with the wonderware physically disconnected from the PLC and the same thing happened.

anything i'm doing wrong?
 
When you change the logic I think you have to update the hmi variable dictionary
Just not sure how to do it
Sorry can't be more help try searching help for data dictionary
 
DDT Unlocated and DDT Located variable addresses are imported into Vijeo Designer as PLC Internal References. PLC Internal References are identified with a %UV or %UI at the beginning of the address (see table below). Although the PLC Internal Reference address is named differently than the Unity DDT's address, they are the same address. The addresses cannot be altered in Vijeo Designer.

Unity Variables
Imported as
Vijeo Designer PLC Internal Reference

DDT Unlocated



DDT Located




The device addresses for the elements of structure and array variables (located or unlocated) are automatically extracted from the Unity XVM and STU files and cannot be altered in the editor.

Array and DDT structure addresses (located and unlocated) are always imported as unlocated in Vijeo Designer.

You must update the links to all unlocated variables any time you make a change to the PLC. Unlike normal variable addressing where there is a defined register to store a value (for example, %MW5), values for unlocated variables in a PLC are stored in memory locations assigned by Unity Pro. These memory locations have internal memory addresses (for example, %UV46.2.16.255.INT.20464430). Each time a change is built in Unity Pro, the internal memory addresses of the unlocated variables are regenerated and different from the last build. When you are satisfied with your changes to the PLC project after building and downloading to the PLC, make sure you save a new STU file or export a new XVM file, and update the variable link in your Vijeo Designer project.

Function Block <input/output> parameters linked in Vijeo Designer as unlocated variables are read-only. For more information regarding the IEC 61131-3 Function Block Diagram (FBD) language and its use in Unity Pro software, please refer to the Unity Pro online help.

Unlocated variables are unaffected by the Double Word word order and ASCII Display byte order configuration settings in Schneider Electric drivers. These configuration settings are automatically defined by the protocol.

Unity BOOL %MWi.j variables are converted to BOOL %MWi.Xj variables while Unity BOOL %MWi variables are converted to UNIT %MWi variables in Vijeo Designer.

Vijeo Designer does not support Unity Date and Time (DT) types. The New Variables From Equipment dialog box will not list the DT data types from Unity Pro. If any Unity Pro data types use the DT variable as an element, the data type will not be listed in the New Variables From Equipment dialog box.

DDT variables do not support indirect addressing.

Vijeo Designer does not support anonymous arrays of more than two dimensions. To link to an array with more than two dimensions, you must define a derived data type array in Unity Pro.

When importing IODDT variables for Unity Pro, use the STU format.

Array indexes start at 0 in Vijeo Designer; however, Unity Pro array indexes can start with any value. Imported Unity Pro arrays are modified so their start index is 0. For example, a Unity Pro array going from 5 to 15 is changed to go from 0 to 10 after importing into Vijeo Designer
 
Above is an extract from vijeo designer. So it looks like you have to save the stu file after making changes in unity and built it....then link the variables again in vijeo designer to the latest save *.stu file
Then download again to the screen
 
Obviously this is an OEM machine which the OEM will never make changes to it....otherwise they would have used %m and %mw registers in the plc and not all unlocated....
Good to know that this is what happens....luckily I still do it the normal(old way) in vijeo designer..
Must have had a bit of a fright hahaha
 
Thanks Chud, your information has at least helped me understand the problem,

i dont have access to the oem's vijeo designer app sadly and no upload available either.

i did manage to read the data i needed using OFS factory server demo and wonderware's FSgateway, looks like i will have to purchase an ofs license...

Thanks again.
 
Hi I think if you enable the data dictionary in the plc then you dont need to do anything extra like exporting stu

from the unity help. The setting is under the General Project Setting
Data dictionary
Data dictionary
Dictionary of symbolized variables with their characteristics (address, type,...) in the PLC memory.
If this setting is enabled, all symbolized variables of the application are embedded in the PLC memory and any client (SCADA using OFS, HMI, embedded Web server...) can then animate or modify those variables. By default, the settings are disabled.
The Data dictionary is generated at build time. This block is updated only if it is needed during an online modification.
NOTE: Comments of the variables are not stored.

The 3 following properties improve the performances of the Data dictionary online build:

  • When checking Preload on Build Changes, download of data dictionary reflecting the change of variable definition will be performed before applying the real change of the application in the PLC. The PLC client tools will then be able to learn new changes of data.
  • The Effective Build Changes Time Out (sec) is the time (1..240 s) that Unity Pro will wait between the download of the new data dictionary and the real online application change, the down counting of the time out will be displayed in the progress bar during the Build Changes operation.
  • Checking the Only HMI variables and identifying the HMI variables necessary in the Data Property table improves online build performances and memory usage of the PLC. This setting means that the data dictionary will embed only variables or DFB/EFB instances that have the HMI attribute set.
 
Last edited:
First time I ever worked with unity and OFS I got stung by this. Made a small online change, OFS suddenly stopped talking and the operations manager at the plant had a hernia. I panicked and reloaded the old program, which caused the treatment plant to jump to different cycle step and almost decanted partially treated effluent.

Needless to say i got myself a spare processor and copy of Unity and OFS to play with after that!
 
Brendonh,

Just curious, when you said "enabling the data dictionary does the trick", did you mean that you did not need to export the STU file only? I would assume you still needed the OFS software? Or, did you mean, after enabled the data dictionary, the Magelis HMI was able to automatically pick up all the changes you made in your PLC code?

Thanks.

You are the man Geoff, enabling the data dictionary does the trick.

many thanks
 
Brendonh,

Just curious, when you said "enabling the data dictionary does the trick", did you mean that you did not need to export the STU file only? I would assume you still needed the OFS software? Or, did you mean, after enabled the data dictionary, the Magelis HMI was able to automatically pick up all the changes you made in your PLC code?

Thanks.

I was able to copy unlocated data to located data and read it into my DAServer without ofs, but i did not do anything to modify what the megelis was reading/writing, it was purely for the remote scada.
 
I was able to copy unlocated data to located data and read it into my DAServer without ofs, but i did not do anything to modify what the megelis was reading/writing, it was purely for the remote scada.
Brendonh,

Thanks for the reply. You mentioned that, at the beginning, the HMI could not find any PLC variables even after only moved one unlocated variable to located one for your remote wonderwares.

I am assuming, by enabling the data dictionary in Unity project settings, you were able to copy the variables to located memory, recompile it and the HMI automatically detected the changes for all variables and continue to work all by itself. Am I right on that?

Regards,
 

Similar Topics

so i have an isssue where if the serial port of an M340 plc disconnect from the screen it would retain the values of the variables being sent...
Replies
1
Views
903
Hello, I'm having a hard time understanding how to get a Modicon M340 to pull a Modbus address from an ABB Totalflow via Ethernet. I set up a port...
Replies
5
Views
1,139
Hello, this is a message for specialists in Schneider, I am trying to establish communication in modbus tcp between a schneider M340 (P3420302)...
Replies
2
Views
1,601
I need to establish communication between Schneider M340 and S7-1500 PLC. I am using gateway converter for MODBUS TCP TO PROFINET protocol...
Replies
12
Views
2,953
Hi, I'm configuring the M340 controller with ATV320 inverters via Canopen. Everything was fine until today, when after starting the electrical...
Replies
1
Views
1,319
Back
Top Bottom