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 February 10th, 2009, 04:03 PM   #1
majorv
Member
Portugal

majorv is offline
 
Join Date: Jul 2006
Location: gondomar
Posts: 4
Schneider Unity Pro - DFB / DDT / Arrays

Sorry for the bad English...


I'm used to Rockwell RSLogix 5000 (version 16.0)

Now I have to develop a program for a Modicon M340. It seems to have some advantages: much better"animation table" management, built-in simulation mode. The Red/Green background on Structured Text is also a plus.
On the negative side: I can't "see" a subroutine ("user function block") instance, like I can on RSLOGIX 5000.

My main issue is this: RSLogix 5000 allows me to create UDT's (User Defined Data Types), that can include Timers. Unity Pro DFB's can't include this. (timers are functions, not variables).

I'm used to create "multilevel" UDT's, nesting several UDT's. I allways call the subroutines using only InOut parameters, which is very practical.

My application for Modicon is as follows:

I have 10 machines, with 8 pneumatic valves, each one.
Each valve has an error bit, SET if the Closed/Open limit switches do not match the desired position, after a preset maximum allowed time.

I would like to define my DDT as Machine1.Valve3.Error, and so on.

On RSlogix I can call a subroutine using "Machine1" as an InOut argument and then (inside this subroutine) call the error subroutine using "Machine1.Valve3" has an InOut argument. This will use the TON I've included on "Valve" definition.

On unity Pro, I'm having dificulty to achieve the same results. I can store the "Preset time" and "internal time" values on the Machine1.Valve1 structure (as TIME data type), but I can't manage to make things work.

I would like to build a DFB "Machine" that would include several nested "Valve error" DFB's.

On "unity Pro - Program Languages and structure reference manual" I read that "Nested DFBs are declared as private variables of the parent DFB". This prevents me from using only "Public" variables.

How shall I organize my DFB an DDT to achieve my purpose ?
  Reply With Quote
Old February 10th, 2009, 11:48 PM   #2
GeoffC
Member
Australia

GeoffC is offline
 
GeoffC's Avatar
 
Join Date: Aug 2006
Location: Newcastle
Posts: 683
UnityPro lets you define both user defined data types (DDTs) and user defined functions (DFBs). DDTs can contain other DDTs. These DDTs can be passed into user defined functions as inputs, outputs and inouts. DDTs and user functions (logic not the interface) can be modified on line. User functions can contain other user functions.
To create a DDT (defined data type) Tools - Data Editor and select the DDT tab.
To create a DFB (defined function block) Tools - Data Editor and select the DFB tab. In each case go to the end of the table and enter the name of the new DDT/DFB, select the plus symbol to expand and add elements to your definition.
Note when the DFB is used in the program it will automatically create the data instance. This is also the case with standard function blocks. These data instances may be referenced within the program if the variables within the function are of type in, out, inout, or public.
The function block may be monitored on-line by right clicking on it and selecting refine.

Hope all this helps
Geoff
  Reply With Quote
Old February 11th, 2009, 05:38 AM   #3
GeoffC
Member
Australia

GeoffC is offline
 
GeoffC's Avatar
 
Join Date: Aug 2006
Location: Newcastle
Posts: 683
As to how to achieve your goal of a machine with eight valves I would do the following.
Build a valve dfb which would control the valve and monitor timeout (using a ton instruction). The interface to each of these would be a valve ddt passed as inout to the valve dfb. The eight valve ddt structures would be defined as public variables within the machine dfb. From outside the dfb you would then refer to machine1.valve1.error

I think this is what you are after

Geoff
  Reply With Quote
Old February 11th, 2009, 06:33 AM   #4
majorv
Member
Portugal

majorv is offline
 
Join Date: Jul 2006
Location: gondomar
Posts: 4
To GeoffC:

thank you for your quick reply !
I'll try to implement you recommendation. I'll give some feedback later.
  Reply With Quote
Old February 11th, 2009, 10:40 AM   #5
majorv
Member
Portugal

majorv is offline
 
Join Date: Jul 2006
Location: gondomar
Posts: 4
To GeoffC:

It works perfectly. Thank you.

The "Valve DFBs" included on the "Machine DFBs" are not shown on the "Derived FB Instances" Data Editor list.
This was confusing: I allways had tryed to create (first) each DFB instance on the Data Editor list, before using them on the program sections. Now I realize that this procedure is wrong.


Thanks a lot !!!
  Reply With Quote
Old February 16th, 2015, 03:33 PM   #6
Furbs
Member
United States

Furbs is offline
 
Join Date: Sep 2013
Location: USA
Posts: 34
DDTs mapped to DFBs

Is there anyway to get these DDT and DFBs to work nicely with each other. In RSLogix5000, when you make an "DFB" it automatically makes a "DDT" to go with it. That way when I drop a function block on the page, I just need to name it and I am done. I see that you can call parts of a DFB within the program, but it does not look like you can assign an address to a DFB. So do people usually still map everything from the DFB over to the DDT? Or is there a way to automatically make that reference?
  Reply With Quote
Old February 16th, 2015, 04:50 PM   #7
GeoffC
Member
Australia

GeoffC is offline
 
GeoffC's Avatar
 
Join Date: Aug 2006
Location: Newcastle
Posts: 683
You can name an instance of a DFB and then use that instance name within the program to reference all the out and public variable within that dfb. Each DFB instance contains both the program and its own data. The example below shows an instance of a DFB and using that dfb instance variables within a program
Attached Images
File Type: jpg Capture.JPG (33.1 KB, 236 views)
__________________
Geoff C
______________________________________
  Reply With Quote
Old February 16th, 2015, 05:06 PM   #8
Furbs
Member
United States

Furbs is offline
 
Join Date: Sep 2013
Location: USA
Posts: 34
Yes, I know that functionality, but now I want to address that PV so the HMI can read it too. I don't see anyway to address the function block instance. I see from your screenshot that you did not use a DDT with this block, rather created standalone tags for its inputs. I'm trying to avoid the numerous copy/paste find/replace that I have to do when adding new pumps or when I add a new output to the existing DFB.

Is there any talk of Schneider going away from addressing in any aspect to a tagname format that Allen-Bradley has? Function codes seem rather "old school" in comparison to the tagname ease of use.
  Reply With Quote
Old February 16th, 2015, 05:10 PM   #9
GeoffC
Member
Australia

GeoffC is offline
 
GeoffC's Avatar
 
Join Date: Aug 2006
Location: Newcastle
Posts: 683
I did use a DDT with the block shown, it is on the in/out variable called hmi. this ddt contains all the data that the hmi reads and writes
__________________
Geoff C
______________________________________
  Reply With Quote
Old February 16th, 2015, 05:12 PM   #10
GeoffC
Member
Australia

GeoffC is offline
 
GeoffC's Avatar
 
Join Date: Aug 2006
Location: Newcastle
Posts: 683
Schneider have been using a tag based system since Concept (late 90s). they are moving further away from using any addressing for io
__________________
Geoff C
______________________________________
  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
Unity Pro XL Import from Excel RheinhardtP LIVE PLC Questions And Answers 2 February 10th, 2009 08:50 AM
unity pro baidimed LIVE PLC Questions And Answers 1 September 26th, 2008 05:05 AM
Unity Pro Documentation Marie1982 LIVE PLC Questions And Answers 2 September 8th, 2008 09:27 AM
Unity Pro Vendor/Intern Version zimbricd LIVE PLC Questions And Answers 6 December 22nd, 2007 02:51 PM
C++ in Unity Pro Schtiel LIVE PLC Questions And Answers 5 October 27th, 2007 04:25 PM


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


.