how to select the type of memory to read ( MEMORY BANK.MEMORY BANK RESERVED) in mc659b

I tried to read the content but selecting the type of memory I get an error code q I use is the following, kick demos Example 6 sdk

private TagAccess.Sequence.Operation _Op;

 

        public void readMemBank(bool access)

        {

            _Op = new TagAccess.Sequence.Operation();

            _Op.AccessOperationCode = ACCESS_OPERATION_CODE.ACCESS_OPERATION_READ;

            _Op.ReadAccessParams.MemoryBank = MEMORY_BANK.MEMORY_BANK_RESERVED;

            _Op.ReadAccessParams.ByteCount = 0;

            _Op.ReadAccessParams.ByteOffset = 0;

            _Op.ReadAccessParams.AccessPassword = 0;

 

 

            m_ReaderAPI.Actions.TagAccess.OperationSequence.DeleteAll();

            if (access)

                m_ReaderAPI.Actions.TagAccess.OperationSequence.Add(_Op); //this is the problem

        }

 

The message says:

InvalidUsageException: PerformSequence Invalid parameter given.

 

and if I do not select the type of memory works perfectly

anyone has any idea how to solve this problem ??

thanks for your help

roberto bonilla
Look my solution  Public Sub

Look my solution

  Public Sub Read_label(ByVal text As String)

        If text = "Read" Then

            Try

                Dim op As TagAccess.Sequence.Operation = New TagAccess.Sequence.Operation()

                op.AccessOperationCode = ACCESS_OPERATION_CODE.ACCESS_OPERATION_READ

                op.ReadAccessParams.MemoryBank = MEMORY_BANK.MEMORY_BANK_USER 

                op.ReadAccessParams.ByteCount = 0

                op.ReadAccessParams.ByteOffset = 0

                op.ReadAccessParams.AccessPassword = 0

                'op.ReadAccessParams.AccessPassword = m_ReadForm.m_ReadParams.AccessPassword

                m_ReaderAPI.Actions.TagAccess.OperationSequence.Add(op)

                'm_TriggerInfo = New TriggerInfo

                'm_TriggerInfo.StartTrigger.Type = START_TRIGGER_TYPE.START_TRIGGER_TYPE_IMMEDIATE

                'm_TriggerInfo.StartTrigger.Handheld.HandheldEvent = HANDHELD_TRIGGER_EVENT_TYPE.HANDHELD_TRIGGER_PRESSED

                'm_TriggerInfo.StopTrigger.Type = STOP_TRIGGER_TYPE.STOP_TRIGGER_TYPE_IMMEDIATE

                'm_TriggerInfo.StopTrigger.Handheld.HandheldEvent = HANDHELD_TRIGGER_EVENT_TYPE.HANDHELD_TRIGGER_RELEASED

                'm_TriggerInfo.StopTrigger.Handheld.Timeout = 0

                ' VALORES ORIGINALES

                m_TriggerInfo = New TriggerInfo

                m_TriggerInfo.StartTrigger.Type = START_TRIGGER_TYPE.START_TRIGGER_TYPE_HANDHELD

                m_TriggerInfo.StartTrigger.Handheld.HandheldEvent = HANDHELD_TRIGGER_EVENT_TYPE.HANDHELD_TRIGGER_PRESSED

                m_TriggerInfo.StopTrigger.Type = STOP_TRIGGER_TYPE.STOP_TRIGGER_TYPE_HANDHELD_WITH_TIMEOUT

                m_TriggerInfo.StopTrigger.Handheld.HandheldEvent = HANDHELD_TRIGGER_EVENT_TYPE.HANDHELD_TRIGGER_RELEASED

                m_TriggerInfo.StopTrigger.Handheld.Timeout = 0

                'UNCOMMENT IF WE NEED TO READ THE TAG JUST ONCE

                'myTriggerInfo.TagEventReportInfo.ReportNewTagEvent = TAG_EVENT_REPORT_TRIGGER.IMMEDIATE;

                'myTriggerInfo.TagEventReportInfo.ReportTagInvisibleEvent = TAG_EVENT_REPORT_TRIGGER.NEVER;

                'myTriggerInfo.TagEventReportInfo.ReportTagBackToVisibilityEvent = TAG_EVENT_REPORT_TRIGGER.NEVER;

                m_AntennaInfo = New AntennaInfo

                Dim antennaId() As System.UInt16 = New System.UInt16((1) - 1) {}

                antennaId(0) = 1

                'antennaId[1] = 2;

                m_AntennaInfo.AntennaID = antennaId

                Dim powerLevels() As Integer = m_ReaderAPI.ReaderCapabilities.TransmitPowerLevelValues

                m_AntennaConfig = New Antennas.Config

                m_AntennaConfig.TransmitPowerIndex = 250

                m_AntennaConfig.ReceiveSensitivityIndex = 0

                m_AntennaConfig.TransmitFrequencyIndex = 1

                m_ReaderAPI.Config.Antennas(1).SetConfig(m_AntennaConfig)

                If m_ReaderAPI.Actions.TagAccess.OperationSequence.Length > 0 Then

                    m_ReaderAPI.Actions.TagAccess.OperationSequence.PerformSequence(Nothing, m_TriggerInfo, m_AntennaInfo)

                Else

                    m_ReaderAPI.Actions.Inventory.Perform(Nothing, m_TriggerInfo, m_AntennaInfo)

                End If

                mconnect.Enabled = False

                mRead.Text = "Stop"

            Catch ofe As OperationFailureException

                MessageBox.Show(ofe.Message)

            Catch iue As InvalidUsageException

                MessageBox.Show((iue.Info + (";" + iue.Message)))

            Catch ex As Exception

                MessageBox.Show(ex.Message)

            End Try

        ElseIf (text = "Stop") Then

            Try

                If m_ReaderAPI.Actions.TagAccess.OperationSequence.Length > 0 Then

                    m_ReaderAPI.Actions.TagAccess.OperationSequence.StopSequence()

                Else

                    m_ReaderAPI.Actions.Inventory.Stop()

                End If

                mconnect.Enabled = True

                mRead.Text = "Read"

            Catch ofe As OperationFailureException

                MessageBox.Show(ofe.Message)

            Catch ex As Exception

                MessageBox.Show(ex.Message)

            End Try

        End If

    End Sub

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments