RFID Reader Interface User's Guide
2.2 How Do I Use the Reader Interface?
Mobile Readers
Function Manual, 12/2010, J31069-D0198-U001-A2-7618
13
Another look at our code shows that only four lines of code are needed to start up the reader
service. The code for starting the RFID Reader Interface:
private void menuReaderStart_Click(object sender, EventArgs e)
{
try
{
// We want to create and start an instance of the RFID
// reader interface for a handheld device with a default name.
RfReaderInitData initData = new RfReaderInitData();
// Initialize the appropriate reader type (RF680M,RF610M,
RF310M)
// and reader mode
initData.Type = „RF680M“;
initData.Mode = RfReaderInitData.ReaderMode.Standalone;
// With RfReaderApi.Current we address the current
// RFID reader interface instance
// or initiate the creation of a new instance.
// StartReader connects to an existing reader service
// or creates a new reader service.
RfReaderApi.Current.StartReader(initData);
}
catch (RfReaderApiException rfidException)
{
// Something went wrong while starting the reader.
// More information is available by inspecting the
// RfReaderApiException's members ResultCode, Error,
// Cause and Description.
...
}
}
Stopping a running reader only requires a single call that terminates the connection to the
underlying reader service and shuts it down; The code for stopping the RFID Reader
Interface:
private void menuReaderStop_Click(object sender, EventArgs e)
{
try
{
// Use the current reader interface instance and tell
// it to shut down.
RfReaderApi.Current.StopReader();
}
catch (RfReaderApiException rfidException)
{
// Something went wrong while stopping the reader.
// More information is available by inspecting the
// RfReaderApiException's members ResultCode, Error,
// Cause and Description.
...
}
}
Summary of Contents for SIMATIC RF610M
Page 2: ......
Page 8: ...Introduction Mobile Readers 8 Function Manual 12 2010 J31069 D0198 U001 A2 7618 ...
Page 79: ......