Schneider Unity/Control Expert Block Copy

rwatson

Member
Join Date
Aug 2017
Location
.
Posts
27
I have a third party device (Delta RMC150 motion controller) that I have connected to a Schneider M580 PLC using Ethernet/IP. I have the eds file installed and I can happily pass numbers REAL type numbers between the devices. I also would like to send some DWORD type signals (ie. 32 boolean signals), but but on the Schneider side it only permits me to write REALS into the data structure for interfacing to the RMC, so what I need to do is preserve the binary structure of my DWORD, but change the data type to REAL

In AB land I would use a COP to achieve this, and with Siemens I could use a BLKMOVE with the input being my DWORD and the output being the REAL variable.

Is there a simple way to do this with Schneider? This is my first time in the Schneider environment and everything seems reasonably straight forward, but I'm lost here. On the flip-side, anything I read in from the RMC will be recognised as a REAL by the M580, but I would like to preserve the 1s and 0s while re-defining it as a DWORD or DINT.
 
Cheers, I managed to get that up and running.

I'm guessing that there isn't a way to do it with user defined types. In AB and Siemens, when I'm communicating with an external piece of hardware I usually define a type for the structure (for example a 32 bit boolean array, a couple of DINTs, and a REAL) and then either define a variable of this type beginning at the start of the registers that I have assigned for communications to the external device (Siemens), or COP my variable to the start address of the external device comms registers at the end of the task. Is anything like this possible?
 
I think that with array variables it is possible


Make 2 different arrays for Real and Dint (dword) types.



Name / type

Real_var / array [1..100] of real

Dint_var / Array [1..100] of Dint


Then on Unity settings enable array commands (setting -> variables -> array)


Then you can use extract block (coping between diffrent types). Start from real (array) position 1, 100 variables, copy size is maybe 2.
Destination:
Dint_var, start pos 1, stopping to 100


Extract copies bit stucture without type conversion.


If you need type conversion, then you need to real_to_dword-block for every variable, not sure if there is array conversion block or conversion can used directly to arrays.






Another way to copy data scructure between different types would be to use %MW addressing like on old PL7 Schneider PLCs.


Use same %MW address for real and Dword variable. Data structure is then copied behind to both ways without need of any blocks on code. :geek:


For default Unity gives warnings, if you use same address multiple times for different variables.

Since M580 is symbol based, extract block and arrays is 1st code for this.





ps.

If communication is done on DTM side, then it is maybe possible to change data stucture to be reals and dwords instead of only reals.
 
Last edited:
Thanks for that, I will try this on Monday. Do you know how to enable %MW addressing? I had a look for a setting like that before, but was unable to find anything obvious.
 
MW addressing is enabled allways.


If you double click CPU on hardware config there is maximum addressing for %M, %MW and %KW (Constants)


You can increase address ranges, if default isn't enought.
The there is also selection if %MW are initalized at cold start (You probably want maintain values so uncheck selection)


Then all you need is to add %MW adresses for variables on variable editor.
 

Similar Topics

Hi, I've exported a PL7 application to the .FEF file succesfully. Imported the .FEF file in my Unity Pro project, but two of the five sections in...
Replies
0
Views
752
I want transfer my I/O data from schneider (Unity Pro) as a write data and RS Logix 5000 as a read data. I use Ethernet as an communication...
Replies
0
Views
683
Is there a tool to convert a ControlExpert project (.sta, .ztx or .zef in v14.1 or v15) to be opened using Unity Pro (v11 or V10) ? Thanks,
Replies
6
Views
2,155
Hello everyone! On a project using the P572634M CPU , what is the best/safest way to determine what Words(%MW) have been used in Unity v10 ...
Replies
12
Views
3,010
Hi all, I'm sure this is a stupidly simple question, but I'm really struggling to find any EFB or similar to do this. I want to map a block of...
Replies
10
Views
3,330
Back
Top Bottom