Siemens SIMATIC RF310M Function Manual page 37

Mobile readers
Hide thumbs Also See for SIMATIC RF310M:
Table of Contents

Advertisement

Initially, all of the special keys produce the same keycode 0xEF or 239 decimal. So,
whenever such a code arrives with a key down event, we set our trigger to active. And if the
key is released again, we reset the trigger. That way we implemented a simple 'scan as long
as key is pressed' behavior.
protected void KeyDownHandler(object sender, KeyEventArgs e)
{
if (e.KeyValue == 0xEF)
{
}
}protected void KeyUpHandler(object sender, KeyEventArgs e)
{
if (e.KeyValue == 0xEF)
{
}
}
That is all you need to attach keys to function. Piece of cake, isn't it?
Let's add some cream on top of it. What if you do want to distinguish among all of those scan
keys. It is not always desireable using the same function for all keys. But if they all send the
same keycode it is impossible.
Luckily, PSION provides a way to change this. There is an interface assembly
PsionTeklogixNet.dll that offers you a PsionTeklogix.Keyboard namespace containing a
KeyRemapper class. This class allows redefining the keycodes. So we add some
initialization code in our main form's constructor as shown below
...
// Initialize key mapping
PsionTeklogix.Keyboard.KeyRemapper Rf610MKeyRemapper =
// left scan key
Rf610MKeyRemapper.Add(0x38, null,
// right scan key
Rf610MKeyRemapper.Add(0x39, null,
// Pistol Grip
Rf610MKeyRemapper.Add(0x3A, null,
// top scan key
Rf610MKeyRemapper.Add(0x01, null,
...
Mobile Readers
Function Manual, 12/2010, J31069-D0198-U001-A2-7618
...
// (Error handling code omitted for the sake of clarity
RfReaderApi.Current.SetTrigger(RfTriggerType.Application,
...
...
// (Error handling code omitted for the sake of clarity
RfReaderApi.Current.SetTrigger(RfTriggerType.Application,
...
new KeyRemapper();
PsionTeklogix.Keyboard.Function.SendCode,
(int)PsionTeklogix.Keyboard.VirtualKey.VK_F27);
PsionTeklogix.Keyboard.Function.SendCode,
(int)PsionTeklogix.Keyboard.VirtualKey.VK_F25);
PsionTeklogix.Keyboard.Function.SendCode,
(int)PsionTeklogix.Keyboard.VirtualKey.VK_F26);
PsionTeklogix.Keyboard.Function.SendCode,
(int)PsionTeklogix.Keyboard.VirtualKey.VK_F28);
RFID Reader Interface User's Guide
2.3 Extending the Reach
RfTriggerState.On);
RfTriggerState.Off);
37

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic rf610mSimatic rf680m

Table of Contents