Esempio n. 1
0
 /// <summary>
 /// Basic constructor.
 /// </summary>
 /// <param name="tag">"this" i.e RT0005Tag given as a parameter; uses the register reads and writes.</param>
 public BINARRAY(RT0005Tag tag)
 {
     mTag = tag;
 }
Esempio n. 2
0
 /// <summary>
 /// Constructor that uses the RT0005Tag.
 /// </summary>
 /// <param name="tag">RT0005 tag being used.</param>
 /// <remarks>This constructor is used within the RT0005Tag class. There should not be a need to use this elsewhere.</remarks>
 public BINHLIMIT(RT0005Tag tag)
     : base(tag)
 {
     mBaseAddress  = RTRegs.BIN_HLIMIT_BASE;
     mExceptionMsg = "BIN: invalid high level index.";
 }
Esempio n. 3
0
 /// <summary>
 /// Constructor that uses the RT0005Tag.
 /// </summary>
 /// <param name="tag">RT0005 tag being used.</param>
 /// <remarks>This constructor is used within the RT0005Tag class. There should not be a need to use this elsewhere.</remarks>
 public BINSAMPLETIME(RT0005Tag tag)
     : base(tag)
 {
     mBaseAddress  = RTRegs.BIN_SAMPLETIME_BASE;
     mExceptionMsg = "BIN: invalid sample time index.";
 }
Esempio n. 4
0
 /// <summary>
 /// Constructor that uses the RT0005Tag.
 /// </summary>
 /// <param name="tag">RT0005 tag being used.</param>
 /// <remarks>This constructor is used within the RT0005Tag class. There should not be a need to use this elsewhere.</remarks>
 public BINCOUNTER(RT0005Tag tag)
     : base(tag)
 {
     mBaseAddress  = RTRegs.BIN_COUNTER_BASE;
     mExceptionMsg = "BIN: invalid counter index.";
 }
Esempio n. 5
0
 /// <summary>
 /// Constructor that uses the RT0005Tag.
 /// </summary>
 /// <param name="tag">RT0005 tag being used.</param>
 /// <remarks>This constructor is used within the RT0005Tag class. There should not be a need to use this elsewhere.</remarks>
 public BINTHRESHOLD(RT0005Tag tag)
     : base(tag)
 {
     mBaseAddress  = RTRegs.BIN_THRESHOLD_BASE;
     mExceptionMsg = "BIN: invalid threshold index.";
 }
Esempio n. 6
0
        private void ScanTagThread()
        {
            int i;

            NurApi.TriggerReadData trg;
            bool tagFound = false;

            byte[]     testData;
            NurApi.Tag tag;
            int        epcLength = 0;

            byte[] epc = null;

            mTag = null;

            for (i = 0; i < SCAN_ROUNDS && !mInterrupted && !tagFound; i++)
            {
                tagFound = false;
                ControlText(StatusText, "Scan: " + (i + 1).ToString() + " / " + SCAN_ROUNDS);
                try
                {
                    trg       = hNur.ScanSingle(SCANTIME);
                    epcLength = trg.epcLen;
                    epc       = new byte[epcLength];
                    System.Array.Copy(trg.epc, epc, epcLength);
                    tagFound = true;
                }
                catch (NurApiException e)
                {
                    if (e.error == NurApiErrors.NUR_ERROR_TR_NOT_CONNECTED)
                    {
                        mBusy = false;
                        return;
                    }
                }

                if (tagFound)
                {
                    try
                    {
                        tag     = new NurApi.Tag(hNur);
                        tag.epc = new byte[epcLength];
                        System.Array.Copy(epc, tag.epc, epcLength);

                        testData = hNur.ReadTag(mPassword, mSecured, NurApi.BANK_PASSWD, RTConst.PASSWD_EXTRA_ADDR, RTConst.NR_PASSWD_EXTRA_BYTES);

                        mTag         = new RT0005Tag(hNur, tag);
                        mBusy        = false;
                        mInterrupted = false;
                        ControlText(StatusText, "Tag found, ready.");
                        mBusy = false;
                        BeginInvoke(mTagFoundDelegate);
                    }
                    catch
                    {
                        tagFound = false;
                    }
                }
            }

            if (!tagFound)
            {
                ControlText(StatusText, "No tag found.");
            }

            mBusy        = false;
            mInterrupted = false;
        }