You are on page 1of 40

RSTechED 2009

DM02 – FactoryTalk Transaction Manager Extras

Presenter: Christopher Di Biase


Rockwell Software
2 of 40
DM02 — FactoryTalk Transaction Manager Extras

Contents

Before you begin......................................................................................................................................... 4


About this lab ................................................................................................................................................ 4

Tools & prerequisites .................................................................................................................................... 4

Mass Edits ................................................................................................................................................... 4


Start the software and build a transaction using the GUI ............................................................................. 5

Using EXCEL to build your data points list instead of browsing. ................................................................ 12

Using the Transaction Import/Export Wizard and Excel to build additional transactions. .......................... 16

Using the XML Import/Export Wizard to duplicate the existing transactions and data points under a
second area. ............................................................................................................................................... 22

Auto starting FactoryTalk Transaction Manager (FTTM) services....................................................... 30

Auto starting FTTM services from another application. ....................................................................... 33

Using the External Application Trigger to cause a transaction to fire. ............................................... 36

Application Notes outlining how to move Data Blocks with FTTM...................................................... 39


Send data blocks from FTTM to a Stored Procedure ................................................................................. 39

Send data blocks from a Stored Procedure to FTTM using integer data from one row in a table.............. 39

Send data blocks from a Stored Procedure to FTTM using integer data from multiple rows in a table ..... 39

3 of 40
Before you begin

This lab uses a preconfigured FactoryTalk Application called my_demo. My_demo contains a
FactoryTalk View SE HMI project and an Area51 containing RSLinx Enterprise communicating to the
RSLogix Emulate5000 processor.

About this lab


This lab assumes you have completed the Beginners and Advanced lab and understand its basic
concepts. This lab will introduce you to multiple application level features to help you maximize efficiency
with the product.

• Three tools for editing and managing large configurations.

• Overview on how to auto start your configuration

• Using the External trigger functionality to fire transactions

• Application notes on how to move data blocks

Tools & prerequisites


Hardware devices required
PC with VMWare v6.0
Software programs required
The FactoryTalk Transaction Manager VMWare Image DM02 consisting of:
Windows Server 2003 R2 SP2
SQL Server 2005 SP2
FactoryTalk Transaction Manager v9.0 (CPR9)
RSLinx Enterprise v5.00 (CPR9)
RSLinx Classic v2.52 (CPR9)
RSLogix 5000 v16.0
RSLogix Emulate 5000 v16.0

Mass Edits

This is the FactoryTalk Transaction Manager Mass Edits portion of the lab, and we will focus on different
tools that can be used to mass produce data points and transactions to speed up the development time of
building a FactoryTalk Transaction Manager configuration.

4 of 40
Start the software and build a transaction using the GUI

1. Launch the RSLogix Emulate 5000 Chassis Monitor by double clicking on the desktop shortcut.

2. Start the FactoryTalk Transaction Manger program.


From the Start menu, select Programs > Rockwell Software > FactoryTalk Transaction
Manager > FactoryTalk Transaction Manager
We will restore an existing FactoryTalk Transaction Manager configuration. On the menu,
Configuration > Restore. Browse to C:\DM02_DataFiles\ConfigurationFiles\MassEdits.rsq
and press OK.

3. Manually modify the Path to read as shown and select OK and select Ok to the pop up diaglog.

5 of 40
3. On the menu, select the configuration called MassEdits from the pane of the GUI. Expand the
configuration as shown below.

4. Double click on the FT connector. Select the my_demo Application and select OK.

6 of 40
5. Expand the folders under Area51 until you’ve browsed into the my_array tag. Select the
my_array[0] data point in the right pane and press the Add Selected Tag(s) button to add into the
table below.

7 of 40
6. The Data Point Name column gets auto-named when the Item String is browsed. You can
modify the tag name within the Data Point Name column, by selecting it and hitting the F2 key.
For this example, we are going to just remove the last underscore(_) from the tag name. Select
the End key to get to the end of the string and delete the trailing underscore.

7. Select the Apply button to save the changes. If a warning message displays then select the OK
button to acknowledge the Warning message about the name change.

8. Select the Close button to close the FactoryTalk Data Point screen and return to the main GUI.

9. From the main GUI, under the Define menu heading, select Transaction …

10. We will build a transaction using the data point we previously browsed in from the Emulate
processor. The Data Object (which points to the local SQLServer 2005 Database table) has been
preconfigured for you. Type Area51_TR0 for the Transaction Name and select MyLogTable for
the Data Object Name. Also remember to Enable the transaction.

8 of 40
11. We now will configure the bindings for the transaction. Select the MyDate row, right click and
select Bind Expression.

12. We will use the built in Time Function called TransTimestamp() to bind to the MyDate row. In
this example, remove the “local” text from within this function. It will still default to using the local
time stamp when the transaction executes. Press the Validate button to validate the syntax.
Select the OK button to complete the binding configuration for MyDate and return back to the
Transaction Definition screen.

9 of 40
13. Select the MyID row, right click and select Bind Expression. Type in 1000 and select the OK
button.

14. Select the MyValue row, right click and select Bind Data point. Select the only data point that
exists in the list.

15. Select the MyString row, right click and select Bind Expression. Select the NameOf() expression
function, then select the pull down at the bottom of the screen under Data Points and select the
one data point. This will build the expression
NameOf(FT.my_demo._Area51::_RSEmulate5000_my_array_0) for its binding.

16. Select the MyQuality row, right click and select Bind Expression. Select the QualityOf()
expression function, then select the pull down at the bottom of the screen under Data Points and
select the one point point. This will build the expression
QualityOf(FT.my_demo._Area51::_RSEmulate5000_my_array_0) for the last binding.

17. The completed transaction should look like this. Select the Apply button to save the transaction
configuration and the Close button to return to the main GUI.

10 of 40
11 of 40
Using EXCEL to build your data points list instead of browsing.
Instead of manually browsing data points in through the FactoryTalk Transaction Manger FactoryTalk
Data Point GUI, we will use EXCEL to build the list and then paste them back into the GUI. We will use
an EXCEL spreadsheet as our template; this spreadsheet is also available in the Rockwell Automation
Knowledgebase. For the lab example, we will create a total of 10 tags, my_array[0] – my_array[9]. You
can use this concept to create hundreds or thousands of data points.

1. Double click the FT connector to open the FactoryTalk Data Point screen. Click on 1 to highlight
the first row and press Ctrl C to copy the row of data into the clipboard.

12 of 40
2. Double click the Duplicate Data Points.xls icon on the desktop to launch Excel.

3. This template has 3 example tags and the syntax that is needed for the different columns. Place
the cursor in cell A10 and press Ctrl V to paste our copied data. Also, place the cursor in cell
A11 and press Ctrl V to perform another paste of the copied data.

4. We will use Excel’s ability to fill in series of numbers (like an auto increment feature) to create our
additional data points. First we need to remove the trailing bracket ( ] ) from the Item String in
column A, we will use a predefined macro to do this. Highlight cells A10 and A11 only, then
select under Tools > Macro >Macros…

13 of 40
5. Highlight the macro called TrimRightBracket and select the Run button.

6. Edit cell A11 and change the trailing 0 to a 1. Edit cell B11 and also change the trailing 0 to a 1.
Now we have created our pattern, which is to increment by 1.

14 of 40
7. Shrink the individual columns down so that columns A through N can be viewed. Click on cell
A10, press and hold the Shift key down, click on cell M11 and let go of the shift key. Now rows
10 and 11, columns A through M should be highlighted. Select the handle in cell M11 and pull
down to row 19

8. We now need to append the trailing bracket ( ] ) back on the Item Strings in Column A. Select
cell A10, press the Shift key and select cell A19 to highlight the 10 Item Strings. Under Tools >
Macro > Macros > select UnTrimRightBracket and press the Run button. The last character of
each Item String should now be a bracket.

9. Click on 10 to highlight row 10, press and hold the Shift key, click on 19 to highlight all rows 10
through 19. Press Ctrl C to copy these rows of data. We will take this data and paste it into
FactoryTalk Transaction Manager FactoryTalk Data Point screen.

10. In the FactoryTalk Data Point GUI, click on row 2 (the first blank row) and press Ctrl V to paste
our newly created data points. Click on the Modify Existing button since we pasted a data point
that already existed in the configuration.

15 of 40
11. Hit the Apply button and then the Close button to close the FactoryTalk Data Point screen.

Using the Transaction Import/Export Wizard and Excel to build


additional transactions.
Instead of manually building the transactions as we previously did, we will export the one transaction and
use Excel to build the additional transactions and then import back into our existing configuration. The
Transaction Import/Export Wizard has existed within the product for many years.

1. Using the FactoryTalk Transaction Manager GUI, select Tools > Wizards. Select the radio button
for the Transaction Import/Export Wizard and select the OK button.

16 of 40
2. Select the Next button, select the Export Transactions radio button, type c:\export.tsv for the
File Name and select the Next button.

3. Select the Area51_TR0 transaction and press the Finish button.

17 of 40
4. You receive a message stating the Operation has completed successfully, press the OK button
and then press the cancel button to close the Transaction Import/Export Wizard.

5. Using Windows Explorer, browse into the root directory of the C drive and double click on the
export.tsv file. The system has been configured to use Excel by default for .tsv files.

18 of 40
6. Click on row 2 to highlight the row and then press Ctrl C to copy it. Click on cell A3 and press
Ctrl V to paste it. We need to tweak some settings to make use of the auto increment feature of
Excel like we did with the data points previously. The export wizard exported all the attributes of
the transaction. For this example, we will need to modify the transaction name, MyID, MyValue,
MyString and MyQuality columns to mass produce the transactions.

7. Lets first trim the trailing characters so we can use the auto increment feature. The MyString
and MyQuality columns (E and F) have a parenthesis that needs trimmed. Another possible
trailing character could be the underscore, yet since we modified the auto generated data point
name after browsing the tag in early in the lab (step 6 on page 7), it doesn’t affect us now. We
could have created a custom macro to trim the character; but in this case, we will manually delete
it. Delete the closing parenthesis in from cell E2, E3, F2 and F3.

8. In row 3, manually edit columns A, C, D, E and F by incrementing the trailing 0 to 1.

9. Now we need to highlight rows 2 and 3 and cause Excel to auto increment to build our 10
transactions. Click on cell A2, press and hold the Shift key, click on cell AC3 (must scroll to the
right, beyond column Z) and release the Shift key to highlight. Grab the handle on AC3 and drag
down to row 11 to create the 10 transactions.

19 of 40
10. We need to append the trailing parenthesis on columns E and F. You could manually append a
parenthesis to each of the cells or you could write a custom macro to do it. In this case, we will
use the custom macro from the Duplicate Data Points.xls to append a bracket. Then we will do a
search and replace to modify the bracket to a parenthesis. Highlight cells E2 through F11 (total
of 20 cells) and bring up the macros screen.

11. Select the UnTrimRightBracket Macro and press the Run button to execute it. Notice that this
macro is not part of this specific spread sheet, it is being used from our Duplicate Data Points.xls
spreadsheet. So, if the macro is not listed, then open the Duplicate Data Points.xls so we can
access the macro.

20 of 40
12. The above macro appended a bracket to our cells, we need to do a quick search and replace to
change to a parenthesis. With the block of cells still highlighted, under Edit > Replace, have it
find ‘]’ and replace with ‘)’. Press the Replace All button and confirm that it made 20 changes.

13. Now we need to save the file. Under File > Save. Select the YES button to the following
message.

14. Under File > Close. Select the No button to the following message.

21 of 40
15. From the FactoryTalk Transaction Manager GUI, Tools > Wizards > Select the Transaction
Import/Export Wizard radio button and select ok. Within the Wizard, select the Next button.
Under the File Name, browse and select the c:\export.tsv file and press the Next button.

16. The wizard reports 10 transactions worth of data from the file, select Next button and select OK
button for the completion of the import. Select the Cancel button to close the Import/Export
Wizard.

17. In the main GUI, select your configuration MassEdits and press the transaction definition icon.
You will see the newly imported transactions listed. (Sometimes you need to force a refresh by
clicking on a different branch within the tree on the left)

Using the XML Import/Export Wizard to duplicate the existing


transactions and data points under a second area.
The XML Import/Export Wizard was introduced in CPR8 (October 2005) as an add-on utility and is
available through the Rockwell Automation Knowledgebase. In CPR9 (the software you are working with
today), it is standard functionality of the product.

The configuration we have consists of 10 transactions collecting data from Area51 through RSLinx
Enterprise. We are going to pretend that Area52 represents a second line being added on the
manufacturing floor, identical to the first line that we collected data from Area51. We need to create
these new data points and transactions and add them to our existing configuration. If you want, you can
define Area52 as a second area that collects data through RSLinx Classic through the FactoryTalk
Administration Console (you only would need to do this if you intended to run the completed
configuration).

22 of 40
1. From the main GUI, Tools > Wizards > Select the radio button for XML Import/Export Wizard
and select the OK button.

2. From the FactoryTalk Transaction Manager XML Import/Export Wizard, select the Export radio
button and select the Next button. Under the Select Classes to export, unselect both the
Configuration Data and Connectors and Data Objects, so only Data Points and Transactions
get exported. Select the Next button and then select Finish.

23 of 40
3. Select the Ok button to close the status message.

24 of 40
4. Using Windows Explorer, browse into C:\DM02\MassEdits directory, right click on the
MassEdits.xml file and select Edit.

25 of 40
5. We now want to search and replace Area51 for Area52 to create the new data points and
transactions for Area2. Edit > Replace and select Replace All.

6. Hit cancel to close the Replace window. File > Save As and save the file as MassEdits2.xml.

7. Within the main GUI, launch the XML wizard so we can import the new data points and
transactions for Area2. Tools > Wizards > XML Import/Export Wizard > OK

8. From the XML Import/Export Wizard, select the Import radio button and select the Next button.

9. From the pull down under Configuration select MassEdits. For the XML File, browse into the
configuration subdirectory located at C:\DM02\MassEdits and select the MassEdits2.xml file.
Select the Next button.

26 of 40
10. Press the Finish button to import. We receive the following status message upon completion.
The one failed record would be expected since the FT Application already exists. Click OK to
close the window.

27 of 40
11. Selecting the transaction definition icon shows the successfully imported transactions. The
Area51 transactions are being polled through RSLinx Enterprise and the Area52 transactions
would be polled through RSLinx Classic (if you added it in the FactoryTalk Administration
Console).

We’ve used FactoryTalk Transaction Manager to browse data points and build transactions. We also
used Excel to help mass produce data points and transactions. We’ve introduced you to both
Import/Export wizards and depending on your specific task, giving you insight on how to be more efficient
creating configurations.

As you’ve seen, the XML Import/Export wizard can be used to manually export and import a complete

28 of 40
configuration or a subset of a configuration. In addition, it can also be used to programmatically build
and/or import a configuration. Use Visual Basic to access the four exposed API calls (Import, Export,
AssembleAll and CancelAll) and validate that configuration against the XML schema (rssql_xml.xsd).
Additional details are available through the help button on the XML import/export wizard.

29 of 40
Auto starting FactoryTalk Transaction Manager (FTTM) services

In the Beginners and Advanced labs, we started FTTM through its GUI by pressing the VCR like start
button. This in turn, started the FTTM services which run the configuration. Yet to do this, a user must be
logged in the computer to initiate the start . In many applications, you would want the configuration to
automatically start when the computer is started. This can be easily accomplished by configuring the
FTTM services to Automatic in the service control panel.

Similar information to this can be found in the Rockwell Automation Knowledgebase, reference ID
A159031631, Procedure to auto start services.

Using your FTTM configuration from the MassEdits portion of the lab:

1. Stop your completed FTTM configuration through its GUI, if it is running. Disable all 20 of the
transactions by performing a multi-select, right click> Disable Transaction. Now, pick one
transaction from within Area51 and enable that one transaction

2. Right click on My Computer and select Computer Management.

3. Under Services, verify that the Startup Type is set to Manual for ALL FactoryTalk Transaction
Manager services EXCEPT FactoryTalk Transaction Manager Compression Server and
FactoryTalk Transaction Manager Configuration Server, which need to be set to Automatic
(These two services are set to Automatic by default)

30 of 40
4. Manually start your FTTM configuration through its GUI. Notice that the FactoryTalk Transaction
Manager ODBC Enterprise Connector and FactoryTalk Transaction Manager Transaction and
Control connector has started.

5. Modify the Startup Type from Manual to Automatic for both of these services.

31 of 40
That’s all that is needed for the FTTM configuration to automatically start each time the computer is
started. Keep in mind, that the previously run FTTM configuration will be the one that gets auto
started. So if your FTTM GUI contains multiple configurations (only one configuration can run at any
one time on any given computer), the last run configuration will be the one that gets auto started
when the computer is restarted.

32 of 40
Auto starting FTTM services from another application.

Sometimes you only want FTTM to start if another application has started and fully initialized. In this
example, we want FTTM to start once the HMI (FactoryTalk View SE, RSView32, etc) has successfully
initialized. This is accomplished by creating a batch file that uses the NET START command to start the
specific FTTM services that your configuration uses.

FTTM (previously known as RSSql) service names that need to be started through the batch file can be
found in the computer’s registry under HKLM\System\CurrentControlSet\Services\. Some of the service
names are different than the program executable names or the displayed names in Windows service
control panel. The service names are used in NET START and NET STOP commands.

RSSql service name Displayed name


rssql_cfg_server FTTM Configuration Server
rssql_comp_storer FTTM Compression Server
rssql_ddecoll FTTM DDE Connector
rssql_lnxcoll FTTM RSLinx Connector
rssql_mts_storer FTTM COM+ Connector
rssql_oci_storer FTTM OCI Enterprise Connector
rssql_oledb_storer FTTM OLE-DB Enterprise Connector
rssql_opccoll FTTM OPC Connector
rssql_pm_storer FTTM PlantMetrics Enterprise Connector
rssql_rnacoll FTTM FactoryTalk Connector
rssql_rsvcoll FTTM RSView Connector
rssql_storer FTTM ODBC Enterprise Connector
rssql_tb FTTM Transaction Manager
rssql_tmctrl FTTM Transaction and Control Manager

This is an example batch file that could be modified by removing the comment symbol (#) from the
specific service that your FTTM configuration uses.

#####
# StartFTTM.bat
#
# This batch file will start the specified RSSql services on this
# computer using the "NET START" command. Uncomment (remove the #
# character in front of) each line required by the RSSql configuration
# that you wish to this batch file to start.
#
# NOTE: The RSSql configuration must be started by the RSSql GUI at
# least once in order for this batch file to work properly.
#

33 of 40
# rssql_tmctrl - Transaction and Control Manager, the transaction
# manager and control connector for a configuration
# with online edits enabled.
# rssql_tb - Transaction manager, the transaction manager for a
# configuration without online edits enabled.
# rssql_ddecoll - DDE control connector service
# rssql_lnxcoll - RSLinx control connector service
# rssql_rsvcoll - RSView32 control connector service
# rssql_opccoll - Generic OPC control connector service
# rssql_rnacoll - FactoryTalk Live Data control connector service
# rssql_storer - ODBC enterprise connector service
# rssql_oledb_storer - OLE-DB enterprise connector service
# rssql_oci_storer - Oracle OCI enterprise connector service
# rssql_pm_storer - PlantMetrics enterprise connector service
# rssql_mts_storer - COM+ enterprise connector service
#

echo off
# Select your transaction manager. Uncomment only one of these lines.
# net start rssql_tmctrl
# net start rssql_tb

# Select your control connector(s). Do not uncomment any of these lines


# if using the Transaction and Control Manager.
# net start rssql_ddecoll
# net start rssql_lnxcoll
# net start rssql_rsvcoll
# net start rssql_opccoll
# net start rssql_rnacoll

# Select your enterprise connector(s).


# net start rssql_storer
# net start rssql_oledb_storer
# net start rssql_oci_storer
# net start rssql_pm_storer
# net start rssql_mts_storer
#
#####

34 of 40
1. Right click on the StartFTTM.bat file on the desktop and select Edit.

2. To support the MassEdits FTTM configuration, you would remove the comment symbol ‘#’ from
the net start rssql_tmctrl and net start rssql_storer lines.

3. Save these changes.

4. With the FTTM configuration not currently running, execute this batch file manually to start the
FTTM configuration. The FTTM GUI stop lights might continue to show red until you select
something on the left configuration tree to force the lights to update to green. From a HMI, the
startup macro would be configured to automatically execute this batch file.

Additional details specific to auto starting can be found in the Rockwell Automation Knowledgebase,
referencing ID 28049 and P35043051.

35 of 40
Using the External Application Trigger to cause a transaction to fire.

In the previous labs, we created transactions that fire on Scheduled Events (every 10 seconds) and On
Unscheduled Events (when value changes). An example of a Scheduled Event is to fire on some time
based event. Either every x seconds, minutes, hours or at a specific time of day (4:00pm). An
Unscheduled Event would fire when a data point (either from an HMI or from the processor (PLC/CLX))
changes value.

There is a third type of trigger available to fire a transaction, called On External Application Trigger.
This allows a third party application to fire a FTTM transaction. Typical examples would be a VB, Visual
C++ application or Extended Stored procedure from a Database.

Application Trigger Examples can be found on the FTTM installation CD by browsing into
\documentation\extras subdirectory. A copy of the installation CD can be found in this VMWare Image at
C:\Tools\Installs\FT Trans Mgr\9.00.00\documentation\extras\. We are not going to run through all these
examples, you can read about them in the extras_help.htm in that same directory.

In this lab, we will use an example Visual Basic Application that allows you to fire a FTTM transaction.

36 of 40
1. Stop your FTTM configuration if it is currently running.

2. Edit the Area51_TR1 transaction to fire using the On External Application Trigger and save the
transaction.

3. Start the FTTM configuration through the GUI. You’ll notice that the Area51_TR1 has not fired
yet.

4. On the desktop, double-click the shortcut called VB_Example. This VB application uses the VB
code that was described above in the documentation examples.

37 of 40
5. Type in the name of the transaction that we edited to use the External Trigger and push the
Trigger button.

6. Notice that the VB application receives the return code from the transaction, so it knows whether
the transaction passed or failed. In this case, you probably received a return code of 0 showing
successful execution of this transaction. Just like the GUI displays passed and failed
transactions, your external application can receive those same return codes.

Additional details specific to External Triggers can be found in the Rockwell Automation
Knowledgebase, referencing ID 23346 (How to call the external trigger API from a remote
computer)

38 of 40
Application Notes outlining how to move Data Blocks with FTTM

These Application notes are available in the FTTM Release Notes section. They are found under
Help>Release notes>Application notes>Data block support. This section will contain just an overview of
the application note to let you become familiar with its functionality.

Send data blocks from FTTM to a Stored Procedure


The stored procedure reads a data block, separates the integer values, and inserts them into a
table. This stored procedure is used to bind a data block item from a FTTM control connector.

In certain situations, it is more efficient to send a data block of integers than to use the
Parse()expression. To send data blocks to a stored procedure and then separate them, set up a
data block in a FTTM control connector, such as N7:0,L100 (a block of 100 integers from N7:0 to
N7:99) and pass this value to the stored procedure as outlined below. This stored procedure uses
a table created with the CREATE TABLE testerout(runINT,my_val INT) command.

Send data blocks from a Stored Procedure to FTTM using integer data
from one row in a table
FTTM can write a data block consisting of multiple integers selected from one row of a table to a
controller. The stored procedure combines columns of a database table into a binary string, which
is then bound to a FTTM data block item.

The stored procedure finds the row in "my_int_table" that matches the input parameter (where the
column record_row is equal to the input variable @in_number), and returns the four integers
combined in a varbinary field. In FTTM, bind the "in_number" to an integer register in the
controller such as n227:0. The register can contain values 1 through 10. Then bind the varbinary
field @out_binary to a 4-element data block, such as N7:0,L4.

Send data blocks from a Stored Procedure to FTTM using integer data
from multiple rows in a table
FTTM can write a data block consisting of integers selected from multiple rows of a table to a
controller. The stored procedure reads four integers (ints) from a database table and
concatenates them in a binary (varbinary) stream, which is then bound to a data block in FTTM.

39 of 40
40 of 40

You might also like