看到标签时,LLRP Impinj无法看到天线端口

时间:2013-12-12 10:11:11

标签: rfid

我目前正在连接Impinj Speedway阅读器220,我连接了2个天线。

当我加载Impinj MultiReader应用程序并打开显示天线端口时,它会将RFID标签的哪个天线读回应用程序。

我目前正在使用C#连接到阅读器(尽管我相信所有语言的SDK都相似)。下面是我正在使用的示例代码,但是我不知道哪个配置选项可以启用读取天线端口的功能。

有人可以告诉我哪个配置选项会打开该选项,以便返回带有标签的AntennaID吗?

        MSG_ERROR_MESSAGE msg_err;
        MSG_ADD_ROSPEC msg = new MSG_ADD_ROSPEC();

        // Reader Operation Spec (ROSpec)
        msg.ROSpec = new PARAM_ROSpec();
        // ROSpec must be disabled by default
        msg.ROSpec.CurrentState = ENUM_ROSpecState.Disabled;
        // The ROSpec ID can be set to any number
        // You must use the same ID when enabling this ROSpec
        msg.ROSpec.ROSpecID = 123;

        // ROBoundarySpec
        // Specifies the start and stop triggers for the ROSpec
        msg.ROSpec.ROBoundarySpec = new PARAM_ROBoundarySpec();
        // Immediate start trigger
        // The reader will start reading tags as soon as the ROSpec is enabled
        msg.ROSpec.ROBoundarySpec.ROSpecStartTrigger =
        new PARAM_ROSpecStartTrigger();
        msg.ROSpec.ROBoundarySpec.ROSpecStartTrigger.ROSpecStartTriggerType =
        ENUM_ROSpecStartTriggerType.Immediate;
        // No stop trigger. Keep reading tags until the ROSpec is disabled.
        msg.ROSpec.ROBoundarySpec.ROSpecStopTrigger = new PARAM_ROSpecStopTrigger();
        msg.ROSpec.ROBoundarySpec.ROSpecStopTrigger.ROSpecStopTriggerType =
        ENUM_ROSpecStopTriggerType.Null;

        // Antenna Inventory Spec (AISpec)
        // Specifies which antennas and protocol to use
        msg.ROSpec.SpecParameter = new UNION_SpecParameter();

        PARAM_AISpec aiSpec = new PARAM_AISpec();
        aiSpec.AntennaIDs = new UInt16Array();

        // Enable all antennas
        aiSpec.AntennaIDs.Add(0);
        // No AISpec stop trigger. It stops when the ROSpec stops.
        aiSpec.AISpecStopTrigger = new PARAM_AISpecStopTrigger();
        aiSpec.AISpecStopTrigger.AISpecStopTriggerType = ENUM_AISpecStopTriggerType.Null;
        aiSpec.InventoryParameterSpec = new PARAM_InventoryParameterSpec[1];
        aiSpec.InventoryParameterSpec[0] = new PARAM_InventoryParameterSpec();

        aiSpec.InventoryParameterSpec[0].InventoryParameterSpecID = 1234;
        aiSpec.InventoryParameterSpec[0].ProtocolID = ENUM_AirProtocols.EPCGlobalClass1Gen2;

        aiSpec.InventoryParameterSpec[0].AntennaConfiguration = new PARAM_AntennaConfiguration[1];
        aiSpec.InventoryParameterSpec[0].AntennaConfiguration[0] = new PARAM_AntennaConfiguration();
        aiSpec.InventoryParameterSpec[0].AntennaConfiguration[0].RFTransmitter = new PARAM_RFTransmitter();
        aiSpec.InventoryParameterSpec[0].AntennaConfiguration[0].RFTransmitter.HopTableID = 1;
        aiSpec.InventoryParameterSpec[0].AntennaConfiguration[0].RFTransmitter.ChannelIndex = 1;
        aiSpec.InventoryParameterSpec[0].AntennaConfiguration[0].RFTransmitter.TransmitPower = 91; // Max power of 32.5 dbm
        aiSpec.InventoryParameterSpec[0].AntennaConfiguration[0].RFReceiver = new PARAM_RFReceiver();
        aiSpec.InventoryParameterSpec[0].AntennaConfiguration[0].RFReceiver.ReceiverSensitivity = 1; // 1= -80 (the max), 2 = -70, etc.

        msg.ROSpec.SpecParameter.Add(aiSpec);

        // Report Spec
        msg.ROSpec.ROReportSpec = new PARAM_ROReportSpec();
        // Send a report for every tag read
        msg.ROSpec.ROReportSpec.ROReportTrigger =
        ENUM_ROReportTriggerType.Upon_N_Tags_Or_End_Of_ROSpec;
        msg.ROSpec.ROReportSpec.N = 1;
        msg.ROSpec.ROReportSpec.TagReportContentSelector =  new PARAM_TagReportContentSelector();

        MSG_ADD_ROSPEC_RESPONSE rsp = reader.ADD_ROSPEC(msg, out msg_err, 2000);

1 个答案:

答案 0 :(得分:3)

我最终发现了如何做到这一点。

在上面的示例中,我只需删除

msg.ROSpec.ROReportSpec.TagReportContentSelector =  new PARAM_TagReportContentSelector();

并将其替换为

PARAM_TagReportContentSelector reportContent = new PARAM_TagReportContentSelector();
reportContent.EnableAntennaID = true;

msg.ROSpec.ROReportSpec.TagReportContentSelector = reportContent;