Create a user-defined function block element and variables

In this task you will create a user-defined function block and then add input and output variables.

1. In the Project Organizer, right-click User-Defined Function Blocks, select Add, and then select New LD: Ladder Diagram.


2. Rename the Ladder Diagram UDFB:

Right-click UntitledLD and select Rename.
Type TRAFFIC_CONTROLLER_FB, and press Enter.



3. Under TRAFFIC_CONTROLLER_FB, double-click Local Variables to display the Local Variables grid as a tab in the workspace. Note the tab name (TRAFFIC_CONTROLLER_FB-VAR), which is the user-defined function block name with -VAR added to the end.


4. Arrange how columns appear in the Local Variables grid (optional):

Right-click the header row and click Hide Column to remove a column from the display
Click Show Column and select a column name to add a column
Click and hold a column header and drag it to an alternate location to move a column;
Click Reset Settings to display all the columns in the default layout.


5. If necessary, arrange the columns so they appear as shown in the following example.


6. Enter four input variables to represent a car sensor in each of the four positions in the intersection (N, S, E, W) as shown in the following table:

Name
Data Type
Direction
N_CAR_SENSOR
BOOL
VarInput
S_CAR_SENSOR
BOOL
VarInput
E_CAR_SENSOR
BOOL
Var Input
W_CAR_SENSOR
BOOL
VarInput

7. Enter six output variables to represent red, yellow and green traffic lights in each of two directions (NS, EW) as shown in the following table:

Name
Data Type
Direction
NS_RED_LIGHTS
BOOL
VarOutput
NS_YELLOW_LIGHTS
BOOL
VarOutput
NS_GREEN_LIGHTS
BOOL
VarOutput
EW_ RED_LIGHTS
BOOL
VarOutput
EW_ YELLOW_LIGHTS
BOOL
VarOutput
EW_ GREEN_LIGHTS
BOOL
VarOutput

8. Verify your input and output variables are the same as those listed in the following the Local Variables grid example.



0 comments :

Create a User-Defined Function Block (UDFB)

Before you begin

If you have not already done so, create a new project (Traffic_Light) that contains a Micro850 controller (2080-LC50-24QVB) and a plug-in memory module (2080-MEMBAK-RTC).

What you will accomplish

In this step, you will perform the following tasks.
  • Create a user-defined function block element and variables <View>
  • Add contacts to the first ladder rung <View>
  • Add an instruction block and time delay to the first ladder rung <View>
  • Add a second rung <View>
  • Add additional rungs and edit variable assignments <View>

0 comments :

Add a controller plug-in module

Before you begin

If you have not already done so, create a new project that contains a Micro800 controller (2080-LC50-24QVB) and save the project (Traffic_Light).

What you will accomplish

In this task, you will add a plug-in module to the Traffic_Light project, which will provide a real-time clock for the project.

To add a controller plug-in module

1. View and modify the Controller properties:

From the Controller tree, click the plus (+) sign next to Controller to expand the selection.
Click General to view the Controller properties.
Type Traffic Light in Description.


2. From the Controller tab (Micro850), right-click the first slot (slot 1) of the controller, and then select a plug-in module (2080-MEMBAK-RTC).


3. Add a second plug-in module:

From the Controller tree, click the plus (+) sign next to Plug-In Modules to expand the selection.
Right-click the second slot and click a plug-in module (2080-IF4).


4. Note the controller now has two plug-in modules ((2080-MEMBAK-RTC and 2080-IF4).


5. Click the first slot of the controller to display the Plug-in module properties, and note the configuration options for the plug-in module (2080-MEMBAK-RTC).


6. Save your project.

Result

You added several plug-in modules to your controller in your Traffic_Light project. The following tasks remain:

Status
Step No.
Task
X
1
X
2

3
Create a User-Defined Function Block (UDFB)

4
Create a new ladder program

5
Establish communications to the Micro850 controller

6
Configure Password Protection for the controller

7
Download the project to the controller

8
Test the running program

0 comments :

Create a new Connected Components Workbench project

Before you begin

If you have not already done so, install Connected Components Workbench.

Tip: Set focus on a specific item within the application and press F1 to display context-sensitive help for the item.

Open Connected Components Workbench

1. On the Start menu, click Programs, Rockwell Automation, CCW, and then Connected Components Workbench.
2. Familiarize yourself with the main areas of Connected Components Workbench as shown in the following figure.


No.
Name
Description
1
Device Toolbox
Contains the Discover, Catalog and Toolbox tabs.
2
Discover
Displays all the devices that are connected to your computer and have been found by the software.
3
Catalog
Contains all the controllers and other devices for your project.
4
Catalog device folders
Each folder contains all available devices of that type.
5
Toolbox
Contains elements you can add to a LD, FBD and ST programs. The program category changes based on the program type you are currently working in.
6
Workspace
Use to view and configure devices, and build programs. Contents depend on the tab you select, which are added when you add devices and programs to your project.
7
Output
Shows the results of program builds, included success or failure status.
8
Project Organizer
Contains all the controllers, devices and program elements within your project.

3. Customize the layout of the Connected Components Workbench environment by clicking and dragging any window to an alternate location. You can also dock any window into another window that has tabs (optional).

Tip: To restore the layout to its default settings, click Reset Window Layout from the Window menu.

4. From the Device Toolbox, double-click the Micro800 controller (2080-LC50-24QVB) to add it to the Project Organizer.

Tip: You can also drag an item from the Device Toolbox to the Project Organizer.


5. Save the project:
  • On the File menu, click Save Project As.
  • In the Save Project As dialog box, type a project name (Traffic_Light).
  • Click OK.

6. From the Project Organizer, double-click the controller (2080-LC50-24QVB) to open a controller tab in the workspace.


Result
You created a new Connected Components Workbench project for the traffic light example, added a Mcicro850 controller to control operations, and named the project Traffic_Light. The following tasks remain:

Status
Step No.
Task
X
1

2
Add a controller plug-in module

3
Create a User-Defined Function Block (UDFB)

4
Create a new ladder program

5
Establish communications to the Micro850 controller

6
Configure Password Protection for the controller

7
Download the project to the controller

8
Test the running program

0 comments :

Getting started with Connected Components Workbench™

In this section, you will use Connected Components Workbench™ to perform the following tasks:

  • Create a Traffic Light project that includes a Micro850™ controller (2080-LC50-24QVB) and a 2080-MEMBAK-RTC plug-in module.
  • Configure a Micro850 controller program to run during peak hours and cycle traffic lights through green, yellow, and red in the North-South and East-West directions.
  • Configure the Micro850 controller program to support off-peak hours (where the traffic lights will change to blink yellow in the North-South direction and blink red in the East-West direction).
    The Micro850 controller program will use four inputs and six outputs - the inputs will be based on car sensors placed in each of the four directions at an intersection.
What you will learn

After working through the steps in the Getting started section, you will be familiar with the Connected Components Workbench environment and its features. You will also learn how to perform the following tasks:

Step No.
Task
1
2
3
Create a User-Defined Function Block (UDFB)
4
Create a new ladder program
5
Establish communications to the Micro850 controller
6
Configure Password Protection for the controller
7
Download the project to the controller
8
Test the running program

Hardware and software components

The following list summarizes the hardware and software components referenced in the Getting Started tasks.

  • Connected Components Workbench
  • RSLinx Classic, which installs automatically with Connected Components Workbench.
  • Micro850 controller (2080-LC16QWB)
  • 24-volt DC power supply (2080-PS120-240VAC or equivalent)
  • Plug-in module (2080-MEMBAK-RTC)


0 comments :

Setting up communication between AB & Siemens (Part. 3)

Configuring the MVI56-PDPS Module

Set Up the Project

To begin, start ProSoft Configuration Builder. If you have used other Windows configuration tools before, you will find the screen layout familiar. ProSoft Configuration Builder's window consists of a tree view on the left, an information pane and a configuration pane on the right side of the window. When you first start ProSoft Configuration Builder, the tree view consists of folders for Default Project and Default Location, with a Default Module in the Default Location folder. The following illustration shows the ProSoft Configuration Builder window with a new project.


Your first task is to add the MVI56-PDPS module to the project.

1. Use the mouse to select "Default Module" in the tree view, and then click the right mouse button to open a shortcut menu.

2. On the shortcut menu, choose "Choose Module Type". This action opens the Choose Module Type dialog box.


3. In the Product Line Filter area of the dialog box, select MVI56. In the Select Module Type dropdown list, select MVI56-PDPS, and then click OK to save your settings and return to the ProSoft Configuration Builder window.


Adding a Project

To add a project to an existing project file:

1. Select the Default Project icon.
2. Choose Project from the Project menu, then choose Add Project. A new project folder appears.

Adding a Module

To add a module to your project:

1. Double-click the Default Module icon to open the Choose Module Type dialog box.
2. On the Choose Module Type dialog box, select the module type.

Or

1. Open the Project menu and choose Location.
2. On the Location menu, choose Add Module.

[MODULE]

The module section contains the data that applies to the whole module and includes the backplane data transfer parameters.

[Module]
Module Name : MVI69-PDPS Communication Module DEFAULT


[BACKPLANE]
The backplane section contains the data that applies to the backplane data transfer parameters.

[Backplane]
Read Register Count : 122
#Number of words to move from MVI to
#Processor (PROFIBUS Output)

Write Register Count : 122
#Number of words to move from Processor to
#MVI (PROFIBUS Input)

Block Transfer Size : 60
#Number of data words for I/O transfer
#(60, 120 or 240)


[PROFIBUS SLAVE]
The PROFIBUS Slave section contains the data that applies to the PROFIBUS Slave parameters.

Slave Address
0 to 125
The parameter specifies the node address on the PROFIBUS network for the slave emulated in the module. Each node on the network must have a unique address.

Swap Input Bytes
Yes or No
This parameter specifies if the data in the input data area of the module is to be byte swapped. If the order of the bytes in the words stored in the database is not correct, use this option. A value of Yes causes the module's program to swap the bytes in each word. A value of No indicates no byte swapping will occur.

Swap Output Bytes
Yes or No
This parameter specifies if the data in the output data area of the module is to be byte swapped. If the order of the bytes in the words stored in the database is not correct, use this option. A value of Yes causes the module's program to swap the bytes in each word. A value of No indicates no byte swapping will occur.

Comm Failure Mode
No xfer on fail
xfer on comm fail
This parameter sets the data transfer mode of the module's PROFIBUS output image to the internal database when a communication failure on the PROFIBUS interface is detected. If the parameter is set to "No xfer on fail", the output image will continue to be transferred. If the parameter is set to "xfer on comm fail", the output image will not be transferred and the last values will be retained.

Comm Timeout Multiplier
1 to 10
This parameter sets the communication timeout value for the module. The value entered is multiplied by 125 milliseconds to determine the actual timeout value. For example, a value of 1 specifies a communication timeout of 125 milliseconds.

Download the Project to the Module

In order for the module to use the settings you configured, you must download (copy) the updated Project file from your PC to the module.

To Download the Project File

1. In the tree view in ProSoft Configuration Builder, click once to select the MVI69-PDPS module.
2. Open the Project menu, and then choose Module / Download. The program will scan your PC for a valid com port (this may take a few seconds). When PCB has found a valid com port, the following dialog box will open.


3. Choose the com port to use from the dropdown list, and then click the Download button.

The module will perform a platform check to read and load its new settings. When the platform check is complete, the status bar in ProSoft Configuration Builder will be updated with the message "Module Running".



0 comments :

Setting up communication between AB & Siemens (Part. 2)

Adding the Module to an Existing Project

1. Add the MVI56-PDPS module to the project. Right-click the mouse button on the I/O Configuration option in the Controller Organization window to display a pop-up menu. Select the New Module option from the I/O Configuration menu.


This action opens the following dialog box:


2. Select the 1756-Module (Generic 1756 Module) from the list and click OK.


3. Enter the Name, Description and Slot options for your application, using the values in the illustration above. You must select the Comm Format as Data - INT in the dialog box, otherwise the module will not communicate over the backplane of the CompactLogix rack.

4. Configure the Connection Parameters to match to the Block Transfer Size parameter in the configuration file. Use the values in the table corresponding with the block transfer size you configured.



5. Click Next to continue.


6. Select the Request Packet Interval value for scanning the I/O on the module.
This value represents the minimum frequency the module will handle scheduled events. This value should not be set to less than 1 millisecond.
Values between 1 and 10 milliseconds should work with most applications.

7. Save the module. Click OK to dismiss the dialog box. The Controller Organization window now displays the module's presence. The following illustration shows the Controller Organization window:


8. Copy the Controller Tags from the sample program.

9. Copy the User Defined Data Types from the sample program.

10. Copy the Ladder Rungs from the sample program.

11. Save and Download the new application to the controller and place the processor in run mode.


0 comments :

Setting up communication between AB & Siemens (Part. 1)

Introduction

The main propose of this is explain how to set up a communication between an AB PLC and a Siemens PLCs using Profibus Protocol.

The equipment required to make the communication are enlisted below.

- CPU Siemens with a DP Port.
- PLC Allen Bradley capable to support a 3dr Party Profibus Module.
- Prosoft Module (Profibus DP Slave Communication Module).

The next image shows the architecture of the network that is suggested.


Set up the module on the Siemens network
To set up the module on the Siemens network we need to follow the steps below.

1.- Open Simatic Manager.


2.- Once opened, we should open the Project on File->Open. Next find and select Hardware like its show below.


3.- Double click on Hardware and it will open the HW Config program. Here is where we need to add a Prosoft Module GSD, the GSD file is named “PSFT0988.gsd”. to add the GSD file in the HW Config program we need go to the main menu and find tools, next we find and select the option Install GSD File as its show in the image below.


4.- Once the GSD file is installed we have to look forward in the explorer tree showed in the right side of the program (Hardware Catalog) to add it into the Hardware Config area as its show below.


5.- Now we need to assign to the module an address node to work in the network and also configure the decentralized periphery adding how many words input/output we are going to need. In the image below are showed an example of the words that we can use.


6.- Once we select the words that we need, we have to drag and drop the words into the decentralized periphery area, as its show below we select 16 words input and 16 words output to share information.


7.- Now we take note of the registers that were assigned to the inputs and outpus words, in the example above the registers assigned were:


Notice that those registers will be different depends on the project IO configuration!!!

8.- Now we have to put the information to share on these registers, input registers are information read it from an AB PLC and the Outpus registers are the information that you will write on the AB PLC.



0 comments :

Updating an Add-On Instruction to a Newer Revision via Import

When you need to update an instruction to a newer revision, you can import it from an .L5X file or copy it from an existing project. You must be offline to update an Add-On Instruction.
Follow these steps to update an Add-On Instruction to a newer revision by importing it.

1. Right-click the Add-On Instruction folder and choose Import Add-On Instruction.

2. Select the file with the Add-On Instruction and click Import.


3. Review the Import Configuration dialog box, and from the Operations menu, choose Overwrite.


4. Click Collision Details to see any differences in the Add-On Instructions and to view where the Add-On Instruction is used.

The Property Compare tab shows the differences between the instructions, in this case, the Revision, Edited Date, and Software Revision.


The Project References tab shows where the existing Add-On Instruction is used.


5. Click Close and then OK to complete the operation.


0 comments :

Importing an Add-On Instruction

You can import an Add-On Instruction that was exported from another RSLogix 5000 project. When importing an Add-On Instruction, the parameters, local tags, and routines are imported as part of the Add-On Instruction. Once the project has the Add-On Instruction, you can use it in your programs.

When importing Add-On Instructions directly or as references, consider these guidelines.

Tag Data:
Imported tags that reference an Add-On Instruction in the import file may be affected if the Add-On Instruction is not imported as well. In this case, the imported tag’s data may be converted if the existing Add-On Instruction’s data structure is different and tag data may be lost.
If an existing Add-On Instruction is overwritten, project tag data may be converted if the Add-On Instruction’s data structure is different and tag data may be lost.

Logic:
Imported logic that references the Add-On Instruction in the import file may be affected if the Add-On Instruction is not imported. If an existing Add-On Instruction is used for the imported logic reference and the parameter list of the Add-On Instruction in the project is different, the project may not verify or it may verify but not work as expected.
If an existing Add-On Instruction is overwritten, logic in the project that references the Add-On Instruction may be affected. The project may not verify or may verify but not work as expected

Add-On Instructions While Online:
An Add-On Instruction cannot be overwritten during import while online with the controller, although a new Add-On Instruction may be created while online.

Final Name Change:
If the Final Name of an Add-On Instruction is modified during import configuration, the edit date of the imported Add-On Instruction will be updated. In addition, all logic, tags, User-Defined Data Types, and other Add-On Instructions in the import file that reference the Add-On
Instruction will be updated to reference the new name. As a result, the edit date of any Add-On Instruction that references the Add-On Instruction will be updated.
Add-On Instructions that have been sealed with an instruction signature cannot be renamed during import.

User-Defined Data Types:
Add-On Instructions cannot overwrite User-Defined Data Types. Add-On Instructions and User-Defined Data Types must have unique names.

Instruction Signature:
If you import an Add-On Instruction with an instruction signature into a project where referenced Add-On Instructions or User-Defined Data Types are not available, you may need to remove the signature.
You can overwrite an Add-On Instruction that has an instruction signature by importing a different Add-On Instruction with the same name into an existing routine. Add-On Instructions that have been sealed with an instruction signature cannot be renamed during import.

Safety Add-On Instructions:
You cannot import a safety Add-On Instruction into a standard task.
You cannot import a safety Add-On Instruction into a safety project that has been safety-locked or one that has a safety task signature.
You cannot import a safety Add-On Instruction while online.
Class, instruction signature, signature history, and safety instruction signature, if it exists, remain intact when an Add-On Instruction with an instruction signature is imported.


Import Configuration

When you select a file to import, the Import Configuration dialog box lets you choose how the Add-On Instruction and referenced components are imported.

If there are no issues, you can simply click OK to complete the import.

If your Add-On Instruction collides with one already in the project, you can:

· Rename it, by typing a new, unique name in the Final Name field.
· Choose Overwrite from the Operation menu.
· Choose Use Existing from the Operation menu.


The Collision Details button lets you view the Property Compare tab, which shows the differences between the two instructions, and the Project References tab, which shows where the existing Add-On Instruction is used.


0 comments :

Creating an Export File

When you choose to export an Add-On Instruction, the exported Add-On Instruction includes all of its parameters, local tags, and routines. These will be imported with the Add-On Instruction automatically.

Optionally, you can include any nested Add-On Instructions or User-Defined Data Types that are referenced by the exported Add-On Instruction. Referenced Add-On Instructions and data types are exported to the .L5X file if you select Include all referenced Add-On Instructions and User-Defined Types during the export.

Add-On Instruction definition references may also be exported when a program, routine, set of rungs, or User-Defined Data Type is exported.

In deciding how to manage your Add-On Instruction definitions in export files, you need to consider your goals in storing the definitionss.



Exporting to Separate Files

If you want to store many Add-On Instructions that share a set of common Add-On Instructions or User-Defined Data Types in a common location, you may want to choose to export each Add-On Instruction and User-Defined Data Types to separate files without including references.

Follow these steps to export to separate files.

1. Right-click the Add-On Instruction in the Controller Organizer, and choose Export Add-On Instruction.

2. Select the common location to store the .L5X file.


3. Type a name for the file.

4. Clear Include referenced Add-On Instructions and User-Defined Types.

5. Click Export.

6. Follow the above steps to individually export the other shared Add-On Instructions and User-Defined Data Types.

Using export in this way lets you manage the shared Add-On Instruction and User-Defined Data Types independently of the Add-On Instructions that reference them. One advantage of this is the ability to update the shared component without having to regenerate all the export files for the instructions that reference it. That is, it is only stored in one file instead of in every file whose instruction references it. This can help with the maintenance of the instructions as you only have to update one export file.

To use Add-On Instructions that have been exported in a separate file, without references, you must first import any User-Defined Data Types of Add-On Instructions that the exported instruction references before the import of the referencing instruction can be successful. To do this, work from the bottom up.

Import the lowest-level User-Defined Data Types and any User-Defined Data Types that reference them.

Then, import the lowest-level Add-On Instructions, followed by any Add-On Instructions that reference those low-level Add-On Instructions. Once all of the items it references are in place, the import of the Add-On Instruction will succeed.


Exporting to a Single File

If you manage each Add-On Instruction as a standalone, you may want to export the instruction and any referenced Add-On Instructions or User-Defined Data Types into one export file. By including any referenced Add-On Instructions or User-Defined Data Types, you also make it easier to preserve the instruction signature of an Add-On Instruction.

Follow these steps to export to a single file and include any referenced items.

1. Right-click Add-On Instruction in Controller Organizer and choose Export Add-On Instruction.

2. Choose the location to store the .L5X file.


3. Type a name for the file.

4. Check Include referenced Add-On Instructions and User-Defined Types.

5. Click Export.

This exports the selected Add-On Instruction and all the referenced instructions into the same export file. This file can be used to distribute an Add-On Instruction. When the exported Add-On Instruction is imported into the project, the referenced instructions are imported as well in one step.


0 comments :

Importing and Exporting Add-On Instructions

Creating an Export File (View)
Importing an Add-On Instruction (View)
Updating an Add-On Instruction to a Newer Revision via Import (View)

0 comments :

Storing Your Add-On Instructions

There are two ways to store a group of Add-On Instructions together. One is to save your Add-On Instructions in a project file. Another is to create an L5X export file.

Follow these steps to store your instructions by saving them in a project file.

1. Identify what instructions you want to store.

2. Place them in a project file called something like MyInstructions.ACD.

3. Open other projects in additional instances of the application and use copy and paste or drag and drop to move a copy of the instruction from MyInstructions.ACD to another project.

If any of these instructions reference the same Add-On Instruction or User-Defined Data Type, there is only one shared copy in the project file. When an Add-On Instruction is copied to another project, it also copies any instruction it references to the target project.


0 comments :

Copying an Add-On Instruction

You can copy an Add-On Instruction into your project when it exists in another Logix Designer project. After you copy the Add-On Instruction, you can use the instruction as is or rename it, modify it, and then use it in your programs.

Follow these steps to copy the Add-On Instruction.

1. Open the Logix Designer project that contains the Add-On Instruction.

2. Find the instruction in the Add-On Instructions folder.


3. Right-click the instruction and choose Copy.

4. Go to the other project where you want to paste the instruction.

5. Right-click the Add-On Instructions folder and choose Paste.



0 comments :

Determining if the Add-On Instruction is Source Protected

An Add-On Instruction may be source protected so you cannot view the logic.
Follow these steps to see if an Add-On Instruction is source protected.

1. Select the Add-On Instruction in the Controller Organizer.

The Add-On Instruction cannot be expanded when fully protected.

2. Look in the Quick View pane for Source Protection.

If the Source Protection attribute is not listed, then the instruction is not protected.



0 comments :

Viewing Logic and Monitor with Data Context

Follow this procedure when you want to view the logic of an Add-On Instruction and monitor data values with the logic.

1. Right-click the instruction call in any routine.


2. Choose Open Instruction Logic.


The Language Editor opens with the Add-On Instruction's logic routine and with data values from the instruction call.

As you view the logic you can:

· Identify the instruction call whose tags are being used for data.
· See the logic as it executes (when online).
· See Parameter and Local Tag values.
· Change local tag and parameter values for the data instance selected.


To edit the logic of the Add-On Instruction, you must select the instruction <definition> in Data Context.


You cannot edit the instruction logic:

· Online.
· When the logic is in the context of an instruction call.
· If the instruction is source-protected.
· If the instruction is sealed with an instruction signature.

0 comments :