Sunteți pe pagina 1din 16

Microsoft Dynamics AX

Setting up RFID for Microsoft Dynamics AX 2009


DECEMBER, 2008

Table of Contents
Introduction ................................................................................................ 3
Running RFID simulation software........................................................................................... 3

Part I: Manual set up of BizTalk RFID with Microsoft Dynamics AX ............. 3


To start the Contoso Device Simulator .................................................................................. 3 Simulating a single device or multiple Devices ....................................................................... 3 To prepare for multiple device simulation .............................................................................. 3 Adding providers, devices, and processes ................................................................................ 4 To add the Contoso provider ............................................................................................... 4 To add a single device ........................................................................................................ 4 To add multiple devices ...................................................................................................... 6 Creating and setting up a process ........................................................................................ 6 To create and set up a process ............................................................................................ 6 Creating and binding logical devices to a process ................................................................... 7 To create and bind logical devices to a process ...................................................................... 7 Adding SQL Server components ........................................................................................... 9 To bind a component to a process........................................................................................ 9 Using the RFID infrastructure with Microsoft Dynamics AX ..................................................... 10 To start the Contoso device................................................................................................ 10 To create an RFID server in Micosoft Dynamics AX ................................................................ 11

Part II: Automated setup of BizTalk RFID with Microsoft Dynamics AX .... 12 Part III: Known issues and workarounds .................................................. 14
Tag length check causes an error ........................................................................................ 14 To remove the tag length dheck in the Contoso provider source code ...................................... 15 A timeout error occurs when starting the Contoso provider .................................................... 15

2 SETTING UP RFID IN DYNAMICS AX 2009

Introduction
This document describes how to set up Microsoft BizTalk RFID Server for Microsoft Dynamics AX 2009 to run a radio frequency identification (RFID) simulation. The first part of the document provides a detailed overview of the manual setup process and the second part of document provides instructions for applying a script to automate the setup tasks. Part III provides references to known errors and descriptions of solutions to the errors. For an overview of the setup requirements to run Microsoft BizTalk RFID with Microsoft Dynamics AX 2009 or earlier versions, see Setting up Dynamics AX with the Microsoft BizTalk RFID Server.

Running RFID simulation software


The Contoso Device Simulator that is delivered together with BizTalk Server RFID allows you to start working with BizTalk RFID without having a physical device connected to BizTalk RFID. Note: Before you start the Contoso Device Simulator, refer to Part III in this document for a description of how to resolve a known error.

Part I: Manual set up of BizTalk RFID with Microsoft Dynamics AX


Follow the guidelines below to start and manually set up the Contoso Device Simulator or learn more about the steps involved in the automated setup process.

To start the Contoso Device Simulator


1. Open My Computer and select the hard disk drive where BizTalk RFID is installed. 2. Go to Program Files\Microsoft BizTalk RFID\Samples\Device Service Provider\Contoso\ContosoEndToEnd\ContosoDeviceSimulator. 3. Click the runContosoSimulator.cmd file to start the simulator.

Simulating a single device or multiple Devices


The device information is contained in the ContosoSimulatorConfig.xml file. To simulate a single device you do not need to make any changes in the ContosoSimulatorConfig.xml file. This sample file contains a single device called ContosoTestDevice that is configured at IP Address 0.0.0.0 and port 6666, and it uses the Contoso provider that is provided with this sample. To simulate multiple devices using the Contoso Device Simulator you need to modify the file ContosoSimulatorConfig.xml.

To prepare for multiple device simulation


1. Right-click the ContosoSimulatorConfig.xml file in the ContosoDeviceSimulator folder, select Open With, and then select XML Editor or any other editor to edit the file. 2. Specify the number of devices to apply under NumberOfDevices using the following convention:
<section name="NumberOfDevices"> <entry name="DeviceCount">1</entry> </section> <entry name="DeviceCount">2</entry> </section>

3. Add an entry for each additional device to simulate. Note Each section should have a unique name, a unique device name, and a unique port number. You do not need to change the IP address.
3 SETTING UP RFID IN DYNAMICS AX 2009

Example:
<section name="DeviceInformation_2"> <entry name="DeviceName">ContosoTestDevice2</entry> <entry name="ConnectionType">TCPIP</entry> <entry name="IpAddress">0.0.0.0</entry> <entry name="PortNumber">6667</entry> <entry name="ProviderId">Contoso</entry> <entry name="NotificationDataFile">ContosoNotificationConfig.xml</entry> <entry name="DeviceTranslatorAssemblyPath">Microsoft.Rfid.Test.ContosoDeviceTranslator.dll</entry> <entry name="DeviceTranslatorConfigFile"></entry> </section>

Adding providers, devices, and processes


To add the Contoso provider
1. Click Start > Microsoft BizTalk RFID > RFID Manager to open RFID Manager. 2. Right-click the Device Providers node under Device Groups in RFID Manager, and select New Provider.

3. In the File name(s) field in the Add Provider dialog box, type Contoso Provider, and click Browse to locate the file titled Microsoft.Rfid.ContosoDeviceProvider.dll. 4. Click Register to add the provider to BizTalk RFID. 5. Select the Start the Provider check box to start the provider as soon as the Add Provider dialog box closes. 6. Click OK to install the Contoso Device Provider.

To add a single device


1. Right-click the Devices node under Processes in RFID Manager, and select New Device. Tip: You can add devices to the BizTalk RFID server regardless of whether the device status is online or offline.

4 SETTING UP RFID IN DYNAMICS AX 2009

2. Select Add single device, and select a provider in the Add Device Wizard. 3. In the Connect using list, select the connection type that BizTalk RFID should use to connect to the device. 4. Provide the remaining connection information for the connection type. For example, if you specified TCP, you need to specify the IP address and port number information of the device. 5. Optionally, you can change the device group that this device should be added under. The default option is RootDeviceGroup, which is the root of the hierarchy. Note Do not specify anything when asked to enter user name and password for authentication. 6. If you do not succeed in creating a connection, select Add device to the RFID server and enter a name in the Name field to activate the device in offline mode.

5 SETTING UP RFID IN DYNAMICS AX 2009

To add multiple devices


1. Right-click the Devices node under Processes in the RFID Manager form and select New Device. 2. Select Add multiple devices and select a provider in the Add Device Wizard. 3. Specify a range of addresses and provide the remaining connection information. You will be connected to devices in the range that you specified. 4. Optionally, you can change the device group that this device should be added under. The default option is RootDeviceGroup, which is the root of the hierarchy. 5. Optionally, select the Add device automatically check box if devices found in the range that you specified should be added automatically. Note Do not specify anything when asked to enter user name and password for authentication.

Creating and setting up a process


A process brings together logical sources, logical devices, and event handlers to create a task. For example, the task could be set up to process the tags read by the devices that are bound to the process, filter out the relevant tag reads, and store them in a database. As an RFID administrator, you can create RFID processes, define them, and run the processes to obtain intelligent data. You must set up one process in the RFID infrastructure for each business process that is required in Microsoft Dynamics AX, and one business process for devices that will only be used for real time reads.

To create and set up a process


1. Right-click the Processes node in RFID Manager, and then click New Process.

2. In the Process Name field in New Process dialog box, enter the name of the new process. 3. In the Tag processing mode list, select a mode for the process you are creating. 4. Optionally, in the Description field, type a brief note that describes the new process. 5. Clear the Start Bind Wizard check box.

6 SETTING UP RFID IN DYNAMICS AX 2009

6. Click OK to create the new process.

Creating and binding logical devices to a process


A logical device is an entity that contains devices or device groups. An RFID administrator can create a logical device to provide a business context to a set of physical devices. Examples of logical devices are: Shipping device - A logical set that maps to physical devices at the shipping entry/exit point of a warehouse Shelf device - A logical set that maps to physical devices monitoring in-house inventory in a warehouse

To create and bind logical devices to a process


1. Select a process under the Processes node in RFID Manager. Note: Before you create a logical device for a process, you must stop the process. Right-click the process, and select Stop to stop a process. 2. Right-click Device Bindings on the Browse tab in the results pane, and then click New Logical Device.

3. In the Logical Device Name field in the Add Logical Device dialog box, type the name of the new logical device.

7 SETTING UP RFID IN DYNAMICS AX 2009

4. Click OK to create the device and close the Add Logical Device dialog box. 5. On the Browse tab in the results pane, right-click the logical device, and then click Bind.

The Bind Logical Device dialog box appears.

8 SETTING UP RFID IN DYNAMICS AX 2009

6. Select the device groups or devices from Devices and groups to bind to the logical device. 7. Click OK.

Adding SQL Server components


Tag reads from a device must be stored in a SQL database by the RFID infrastructure. A job in Microsoft Dynamics AX gets the tag reads from this database, so a database component must be bound to the process.

To bind a component to a process


1. Select a component under the Processes node in the RFID Manager form. 2. Right-click Component Bindings on the Browse tab in the results pane, and select Add New Component.

9 SETTING UP RFID IN DYNAMICS AX 2009

3. Click Register in the Add Component dialog box and select the file Microsoft.Rfid.OobComponents.dll file. 4. Note: If the file Microsoft.Rfid.OobComponents.dll file is already registered, an error occurs saying that the file is already registered. Ignore this error and close the windows. 5. Select the SqlServerSinkWithChronologicalReads component in the Add Component dialog box and click Add. 6. Name the instance SQLServerSink, and close the Add Component dialog box to add more new components.

Using the RFID infrastructure with Microsoft Dynamics AX To use the RFID infrastructure with Microsoft Dynamics AX you must be sure that the Contoso device is turned on and that an RFID server in Microsoft Dynamics AX is synchronized with the RFID infrastructure. To start the Contoso device
1. Select the Processes node in RFID Manager. 2. In the Processes pane, right-click the process, and click Start.

10 SETTING UP RFID IN DYNAMICS AX 2009

Note: To be sure that the status of the Contoso device is Open, right-click the Devices node.

To create an RFID server in Micosoft Dynamics AX


1. In Microsoft Dynamics AX, click Inventory management > Setup > RFID > RFID Servers. 2. Press Ctrl+N to create a new server record, and type the name localhost in the Host field.

3. If you work in a three-tier architecture, click the General tab, and enter the domain name in the Domain name field. 4. Click Devices and Processes to synchronize with the RFID infrastructure.

11 SETTING UP RFID IN DYNAMICS AX 2009

Part II: Automated setup of BizTalk RFID with Microsoft Dynamics AX


Instead of creating the device provider, device, and process manually as described earlier in this document, the same tasks can be achieved from the command prompt by using the RFID Client Console, a command line utility that ships with BizTalk RFID. 1. Create a new directory and create and add the following three files: Command file titled setup.cmd with the following commands:

"%RFIDINSTALLDIR%\bin\rfidclientconsole.exe" RegisterProvider Contoso Microsoft.Rfid.ContosoDeviceProvider "%RFIDINSTALLDIR%\bin\rfidclientconsole.exe" CopyProviderFile Contoso "%RFIDINSTALLDIR%\bin\Microsoft.Rfid.ContosoDeviceProvider.dll" "%RFIDINSTALLDIR%\bin\rfidclientconsole.exe" StartProvider Contoso "%RFIDINSTALLDIR%\bin\rfidclientconsole.exe" ImportDevices device.xml false true "%RFIDINSTALLDIR%\bin\rfidclientconsole.exe" ImportProcesses processbinding.xml "%RFIDINSTALLDIR%\bin\rfidclientconsole.exe" DeployProcess ContosoTestProcess "%RFIDINSTALLDIR%\bin\rfidclientconsole.exe" StartProcess ContosoTestProcess

An XML file titled device.xml that contains the device information. For example, if the name of the device is ContosoTestDevice, the name of the provider is Contoso, the type of connection is TCP, the IP address is 127.0.0.1, and the port is 6666, the XML file will be as shown below:

<ArrayOfDeviceComplete xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/MS.Internal.Rfid.ClientUtilities"> <DeviceComplete> <m_deviceDefinition xmlns:d3p1="http://schemas.datacontract.org/2004/07/Microsoft.SensorServices.Rfid.Design"> <d3p1:authenticationInfo xmlns:d4p1="http://schemas.datacontract.org/2004/07/Microsoft.SensorServices.Rfid.Dspi" i:nil="true" /> <d3p1:deviceInformation> <connectionInformation xmlns="http://schemas.datacontract.org/2004/07/Microsoft.SensorServices.Rfid.Dspi"> <provider>Contoso</provider> <transportSettings i:type="TcpTransportSettings"> <m_vendorSpecificData xmlns:d7p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" i:nil="true" /> <host>127.0.0.1</host> <port>6666</port> </transportSettings> </connectionInformation> <providerData xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" i:nil="true" xmlns="http://schemas.datacontract.org/2004/07/Microsoft.SensorServices.Rfid.Dspi" /> </d3p1:deviceInformation> <d3p1:name>ContosoTestDevice</d3p1:name> </m_deviceDefinition>

12 SETTING UP RFID IN DYNAMICS AX 2009

<m_propertyProfile xmlns:d3p1="http://schemas.datacontract.org/2004/07/System.IO.SensorServices.Rfid.Client" i:nil="true" /> <m_sourcePropertyProfile xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" i:nil="true" /> </DeviceComplete> </ArrayOfDeviceComplete>

An XML file called ProcessBinding.xml that contains information about the process and binding. For example, if the name of the device is ContosoTestDevice, the name of the process is ContosoTestProcess, the name of the logical device is mylogicaldevice, and the name of the component instance is SQLServerSink, the XML file will be as shown below:

<ArrayOfProcessComplete xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/MS.Internal.Rfid.ClientUtilities"> <ProcessComplete> <m_processBinding xmlns:d3p1="http://schemas.datacontract.org/2004/07/Microsoft.SensorServices.Rfid.Design"> <d3p1:ComponentBindingsForXml xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" /> <d3p1:ErrorPercentageThreshold>0</d3p1:ErrorPercentageThreshold> <d3p1:MaxComponentInitializationTime>600000</d3p1:MaxComponentInitializationTime> <d3p1:MaxHungEvents>0</d3p1:MaxHungEvents> <d3p1:SingleEventProcessingTimeout>60000</d3p1:SingleEventProcessingTimeout> <d3p1:deviceBindings xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d4p1:KeyValueOfstringDeviceBinding_Pyox4B_P_S> <d4p1:Key>mylogicaldevice</d4p1:Key> <d4p1:Value> <d3p1:RegexCollectionForXml /> <d3p1:deviceGroupList /> <d3p1:deviceList> <d4p1:anyType xmlns:d8p1="http://www.w3.org/2001/XMLSchema" i:type="d8p1:string">ContosoTestDevice</d4p1:anyType> </d3p1:deviceList> <d3p1:sourceBindingList /> </d4p1:Value> </d4p1:KeyValueOfstringDeviceBinding_Pyox4B_P_S> </d3p1:deviceBindings> </m_processBinding> <m_rfidProcess xmlns:d3p1="http://schemas.datacontract.org/2004/07/Microsoft.SensorServices.Rfid.Design"> <d3p1:description i:nil="true" /> <d3p1:logicalSource> <d3p1:componentList> <d3p1:EventHandlerDefinition> <d3p1:componentName>SqlServerSink</d3p1:componentName> <d3p1:eventHandlerInfo> <d3p1:assembly>Microsoft.Rfid.OobComponents, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</d3p1:assembly> <d3p1:className>Microsoft.SensorServices.Rfid.ProcessComponents.SqlServerSink</d3p1:class Name> <d3p1:description i:nil="true" /> </d3p1:eventHandlerInfo> </d3p1:EventHandlerDefinition> </d3p1:componentList> 13 SETTING UP RFID IN DYNAMICS AX 2009

<d3p1:logicalDeviceList> <d3p1:LogicalDevice> <d3p1:description>all the devices that I am interested in</d3p1:description> <d3p1:name>mylogicaldevice</d3p1:name> </d3p1:LogicalDevice> </d3p1:logicalDeviceList> <d3p1:logicalSourceList /> </d3p1:logicalSource> <d3p1:messageHandlingReliability>Transactional</d3p1:messageHandlingReliability> <d3p1:name>ContosoTestProcess</d3p1:name> </m_rfidProcess> </ProcessComplete> </ArrayOfProcessComplete>

2. Click Start and then Run and type cmd to open the Command Prompt window. 3. Go to the directory where you saved the three files, setup.cmd, device.xml, and processbinding.xml. 4. Type setup.cmd and press ENTER. The following activities take place: Loads the provider, ContosoProvider, by using RFID Client Console from the following location: C:\Program Files\Microsoft BizTalk RFID \bin\ Microsoft.Rfid.ContosoDeviceProvider.dll file. Imports a device to the root device group from the device.xml file by using RFID Client Console. Imports a process from the processbinding.xml file by using RFID Client Console. Imports binding information from the processbinding.xml to the process by using RFID Client Console. Starts the process by using RFID Client Console.

5. Click Start > Programs > Microsoft BizTalk RFID > RFID Manager to open RFID Manager. The following information is displayed. Tip: If RFID Manager is already running, refresh the RFID Manager Console. A new process, ContosoTestProcess, under the Processes node with the status appearing as Started. A new device, ContosoTestDevice, under the Devices node and under the All Devices Group node. A new provider, Contoso, under the Device Providers node.

Part III: Known issues and workarounds


Tag length check causes an error
Problem: The Contoso provider source code contains a check for tag length of or above eight characters, and this check causes an error when running the Contoso device simulator. Resolution: Remove the check for the tag length in the ContosoReaderLayer.cs file using the following instructions, and redeploy the file.

14 SETTING UP RFID IN DYNAMICS AX 2009

To remove the tag length dheck in the Contoso provider source code
1. Open the file ContosoReaderLayer.cs under %RFIDINSTALLDIR%Samples\Device Service Provider\Contoso\Contoso Provider Source Code. 2. Comment out the tag length section of the code as follows:
private void handleAsynchronousReadDetect(TagReadEvent tagReadEvent) { //if (tagReadEvent.GetId().Length <= 8) //{ Notification notification = new Notification(tagReadEvent); m_ContosoReader.raiseNotificationEvent(new NotificationEventArgs(notification)); //} //else //{ // //} } logger.Info("invalid tag id " + tagReadEvent.ToString());

3. Recompile the project ContosoDeviceProvider.csproj.

A timeout error occurs when starting the Contoso provider


Problem: When you try to start the Contoso provider, a timeout error might occur. Resolution: If SharePoint is currently installed on the machine that hosts the RFID server, it can result in SharePoint taking over port 80. This can be verified in Internet Information Services (ISS). If this turns out to be case, assign SharePoint a port number other than 80 and restart the default Web site.

15 SETTING UP RFID IN DYNAMICS AX 2009

Microsoft Dynamics is a line of integrated, adaptable business management solutions that enables you and your people to make business decisions with greater confidence. Microsoft Dynamics works like and with familiar Microsoft software, automating and streamlining financial, customer relationship and supply chain processes in a way that helps you drive business success. U.S. and Canada Toll Free 1-888-477-7989 Worldwide +1-701-281-6500 www.microsoft.com/dynamics

The information contained in this document represents the current view of Microsoft Corporation on the issues discussed as of the date of publication. Because Microsoft must respond to changing market conditions, this document should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information presented after the date of publication. This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, AS TO THE INFORMATION IN THIS DOCUMENT. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation. Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property. 2008 Microsoft Corporation. All rights reserved. Microsoft, the Microsoft Dynamics Logo, Microsoft BizTalk Server, and Windows are either registered trademarks or trademarks of Microsoft Corporation.

16 SETTING UP RFID IN DYNAMICS AX 2009

S-ar putea să vă placă și