MC75 条码读取器问题

发布于 2024-09-05 14:48:25 字数 218 浏览 6 评论 0原文

我正在协助开发摩托罗拉 MC75 的定制应用程序。除了条形码阅读器的随机错误之外,它经过了很好的调整。仅当按下右肩按钮时,条形码读取器才会定期激活(开始读取)。中间和左肩按钮不知何故被禁用。这是一个独特的错误,因为它是随机发生的,并且仅影响三个按钮中的两个。 EMDK 同时启用所有按钮,因此我不知道它来自哪里(内部或代码相关)。如果有人有任何意见或建议,请告诉我并提前谢谢。

谢谢,

扎克

I am aiding in the development for a custom made application for the Motorola MC75. It is well tuned except for a random bug with the barcode reader. Periodically, the barcode reader will only activate (start a read) if the right shoulder button is pressed. The middle and left shoulder buttons somehow become disabled. This is a unique bug in that it happens randomly and only effects 2 of the three buttons. The EMDK enables all buttons simultaneously so I am clueless as to where this is coming from (Internal or code related). If anyone has any input or advice please let me know and thank you beforehand.

Thanks,

Zach

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

野侃 2024-09-12 14:48:25

我之前在 MC55 上使用过 Motorola EMDK。我不确定为什么这些按钮被禁用,而且自从您在 6 月份发布此内容后,您可能不再需要答案,但这里有一个可能的解决方法:

您可以捕获而不是让 EMDK 自行处理触发器通过设置事件来触发所有触发器:

// Create a trigger device to handle all trigger events of stage 2 (pressed) or RELEASED
var device = new TriggerDevice(TriggerID.ALL_TRIGGERS, new[] { TriggerState.RELEASED, TriggerState.STAGE2 });
var trigger = new Trigger(device);
trigger.Stage2Notify += OnTrigger;

然后,在 OnTrigger 方法中,您可以处理触发器并执行适当的操作。例如,您可以在按下任何触发器时激活条形码读取器:

private void OnTrigger(object sender, TriggerEventArgs e)
{
    if (e.NewState == e.PreviousState)
        return;

    // Pseudocode
    if (e.NewState == TriggerState.RELEASED)
    {
        myBarcodeReader.Actions.ToggleSoftTrigger();
        myBarcodeReader.Actions.Flush();
        myBarcodeReader.Actions.Disable();
    }
    else if (e.NewState == TriggerState.STAGE2)
    {
        // Prepare the barcode reader for scanning
        // This initializes various objects but does not actually enable the scanner device
        // The scanner device would still need to be triggered either via hardware or software
        myBarcodeReader.Actions.Enable();
        myBarcodeReader.Actions.Read(data);
        // Finally, turn on the scanner via software
        myBarcodeReader.Actions.ToggleSoftTrigger();
    }
}

I've worked with the Motorola EMDK before on the MC55. I'm not sure why the buttons are being disabled, and since you posted this in June you probably don't need the answer anymore, but here's a possible workaround:

Instead of letting the EMDK handle the triggers on its own, you can capture all triggers by setting up an event:

// Create a trigger device to handle all trigger events of stage 2 (pressed) or RELEASED
var device = new TriggerDevice(TriggerID.ALL_TRIGGERS, new[] { TriggerState.RELEASED, TriggerState.STAGE2 });
var trigger = new Trigger(device);
trigger.Stage2Notify += OnTrigger;

Then, in your OnTrigger method, you can handle the trigger and perform the appropriate action. For example, you can activate your barcode reader when any trigger is pressed:

private void OnTrigger(object sender, TriggerEventArgs e)
{
    if (e.NewState == e.PreviousState)
        return;

    // Pseudocode
    if (e.NewState == TriggerState.RELEASED)
    {
        myBarcodeReader.Actions.ToggleSoftTrigger();
        myBarcodeReader.Actions.Flush();
        myBarcodeReader.Actions.Disable();
    }
    else if (e.NewState == TriggerState.STAGE2)
    {
        // Prepare the barcode reader for scanning
        // This initializes various objects but does not actually enable the scanner device
        // The scanner device would still need to be triggered either via hardware or software
        myBarcodeReader.Actions.Enable();
        myBarcodeReader.Actions.Read(data);
        // Finally, turn on the scanner via software
        myBarcodeReader.Actions.ToggleSoftTrigger();
    }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文