You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old September 11th, 2019, 12:39 PM   #1
rwatson
Member
Scotland

rwatson is offline
 
Join Date: Aug 2017
Location: .
Posts: 17
Schneider Unity/Control Expert Block Copy

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.
  Reply With Quote
Old September 13th, 2019, 12:54 AM   #2
chud
Member
South Africa

chud is offline
 
chud's Avatar
 
Join Date: Oct 2007
Location: KALAHARI
Posts: 922
Unity has converters for all types. In you FB library look for REAL_TO_DWORD
  Reply With Quote
Old September 13th, 2019, 04:31 AM   #3
rwatson
Member
Scotland

rwatson is offline
 
Join Date: Aug 2017
Location: .
Posts: 17
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?
  Reply With Quote
Old September 13th, 2019, 09:43 AM   #4
Lare
Member
Finland

Lare is offline
 
Join Date: Jan 2006
Location: Finland
Posts: 1,136
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.


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 by Lare; September 13th, 2019 at 10:21 AM.
  Reply With Quote
Old September 14th, 2019, 10:28 AM   #5
rwatson
Member
Scotland

rwatson is offline
 
Join Date: Aug 2017
Location: .
Posts: 17
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.
  Reply With Quote
Old September 14th, 2019, 11:13 AM   #6
Lare
Member
Finland

Lare is offline
 
Join Date: Jan 2006
Location: Finland
Posts: 1,136
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.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Control Logix PID block not working russrmartin@hotmail.com LIVE PLC Questions And Answers 8 March 1st, 2012 10:14 PM
Siemens S7 -> Copy RAM to ROM ? doowahdiddy LIVE PLC Questions And Answers 0 June 30th, 2005 03:29 AM
Momentum - Schneider - How does one configure the IEC totalizer block? jhakh LIVE PLC Questions And Answers 1 November 21st, 2004 10:00 PM
Block Transfer Sequencing Andrew Evenson LIVE PLC Questions And Answers 1 April 16th, 2003 02:27 AM
Block transfer control files bulletin blues LIVE PLC Questions And Answers 8 March 11th, 2003 12:58 AM


All times are GMT -5. The time now is 12:24 AM.


.