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
Unread September 14th, 2019, 02:09 PM   #1
abishur
Member
United States

abishur is offline
 
Join Date: May 2012
Location: Texas
Posts: 47
Accessing variables in DFB Schneider Electric/Unity Pro

I've used Schneider Electric and Unity Pro for a long time and have always assigned a variable external to the DFB and then assigned that external variable a modbus address.

Is there a way to assign a modbus address to a variable inside a DFB or assign the DFB itself a modbus address? I know I could create a DDT to hold all the variables I want to give a modbus address to, but that would make troubleshooting the code difficult as I wouldn't be able to see the values live in the code sections, I'd have to initialize an animation table on the DDT.
  Reply With Quote
Unread September 14th, 2019, 02:46 PM   #2
Lare
Member
Finland

Lare is offline
 
Join Date: Jan 2006
Location: Finland
Posts: 1,166
On old P57 platforms there was put4x and get4x blocks for addressing variable on code.

M340/580 don't support them.
If you only need to monitor values, you can use DDT-type for FBD.

Code also another FBD, which decodes your DDT-variables to Outputs of DFB. You should see variable values on outputs on program side, even that there is no variables linked to outputs of DFB.



If you use in/out variable for DDT and decoded DDT-variables, you can on program side copy from DDT to single variables or vice versa. But You should look which side has newest value before copy, and decide copy direction between variables.

That way code you could change values from DDT or even from separate variables

Last edited by Lare; September 14th, 2019 at 02:50 PM.
  Reply With Quote
Unread September 15th, 2019, 09:01 PM   #3
abishur
Member
United States

abishur is offline
 
Join Date: May 2012
Location: Texas
Posts: 47
Quote:
Originally Posted by Lare View Post
On old P57 platforms there was put4x and get4x blocks for addressing variable on code.

M340/580 don't support them.
If you only need to monitor values, you can use DDT-type for FBD.

Code also another FBD, which decodes your DDT-variables to Outputs of DFB. You should see variable values on outputs on program side, even that there is no variables linked to outputs of DFB.
Thanks Lare your suggestion led me to an obvious solution. I made my DDT and then just assigned the DDT values to the IO pins of my FBD.

So for example, I made an DDT and then created instance called AI1 and it has a member name input. So on my FDB where it has a pin called Input I assigned AI1.input. Now I can give the DDT instance a starting address and it will automatically assign the rest an appropriate address and I can see their values.
  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
Schneider Unity Pro DFB import Problem attendre LIVE PLC Questions And Answers 7 January 5th, 2017 01:25 AM
Schneider Unity Pro - DFB / DDT / Arrays majorv LIVE PLC Questions And Answers 9 February 16th, 2015 05:12 PM
Schneider - Unity Pro - Citect etc BobB LIVE PLC Questions And Answers 11 January 15th, 2010 03:13 PM
Accessing PLC Variables from WinCC V6.0 RMA LIVE PLC Questions And Answers 5 July 8th, 2008 06:07 AM
S7 - Archiving variables in ProTool Pro RMA LIVE PLC Questions And Answers 3 April 15th, 2005 06:20 AM


All times are GMT -5. The time now is 05:05 PM.


.