How to Modify mlp_pdl?

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf How to Modify mlp_pdl?

  • Creator
    Topic
  • #48256
    Antonio Chennawi
    Participant

      Hi,

      I have a situation. I need for the mlp driver not to show no-match: no more phrases to try in the log file when I receive a null value.

      I have modified this pdl, but it did not work. Do you know what I need to do? Thank you.

      proc read.error {info} {

       keylget info type type

       switch -exact — $type {

       input-error {

                     hci_pd_report_exception 1 “device error (remote side probably shut down)”

                     hci_pd_ignore_input -all

       }

       no-match {

                     set bad_data [hci_pd_get_input {0 99999}]

                     if { $bad_data == {} } {

                             hci_pd_ignore_input -all

                     } else {

                     echo “–> Data received does not match MLP phrase ([clength $bad_data] bytes):”

                     dumpData bad_data

                     hci_pd_ignore_input 1

                     hci_pd_ignore_input -until xb

                     }

      }

       default {

                     hci_pd_report_exception 2 “unknown fail: $type”

                     hci_pd_ignore_input -all

       }

       }

      }

    Viewing 7 reply threads
    • Author
      Replies
      • #58176
        Anonymous
        Participant

          Antonio,

          The best way to handle this is to create a new phrase for the null character and add the new phrase to the default read procedure.  Then add a procedure to flush the null character.

          Please understand that I haven’t run this but you should be able to add this code to a standard mlp pdl.  This will at least give you a place to start.

          define phrase null-msg;

             ;

          end phrase;

          ######################################################################

          # hci_pd.read – This function is called when data first becomes

          # available and we were in the idle state.

          # Args:

          # info = currently unused

          # Notes:

          # The basic idea here is to setup the continuations to handle

          # the potential cases during a message read.

          #

          proc hci_pd.read { info } {

             keylset continuations null-msg    read.flushOne

             keylset continuations basic-msg   read.done

             keylset continuations error       read.error

             keylset continuations timeout      

               hci_pd_receive $continuations

            }

            proc read.flushOne { info } {

               hci_pd_ignore_input 1

            }

        • #58177
          Antonio Chennawi
          Participant

            Thank you Greg. I modified my pdl by adding the second phrase and now I am not getting the error.

          • #58178
            Joe Halbrook
            Participant

              I wondered if you might be able to suggest a solution where the vendor is ending an occasional message with:

              0d 1c 0d

            • #58179
              Jim Kosloskey
              Participant

                Joe,

                If it were me, I would point out to the vendor in really strong terms that they are NOT following the standard when they spuriously include an extra CR in the message and thus they have a bug which is unacceptable.

                The vendor needs to be told in no uncertain terms that their product is flawed and a imminent fix is expected.

                Jim Kosloskey

                email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

              • #58180

                Here’s what Joe is getting in the log …

                Code:

                [pdl :PDL :ERR /0:  bn20emag_in] no-match: no more phrases to try
                –> Data received does not match MLP phrase (320 bytes):
                0b 4d 53 48  7c 5e 7e 5c  |.MSH|^~|
                26 7c 45 4d  41 47 45 4f  |&|TEST|
                4e 7c 42 48  43 7c 50 48  |N|TEST|TEST|
                59 44 4f 7c  42 48 43 7c  |TEST|TEST||
                32 30 30 36  30 38 31 36  |20060816|
                30 38 31 30  30 36 7c 7c  |081006|||
                4f 52 4d 5e  4f 30 31 7c  |ORM^O01||
                32 30 30 36  30 38 31 36  |20060816|
                38 36 36 35  34 31 39 7c  |8665419||
                50 7c 32 2e  32 0d 50 49  |P|2.2.PI|
                44 7c 31 7c  7c 39 32 30  |D|1||920|
                32 30 32 31  34 39 33 7c  |2021493||
                3f 3f 3f 14  3f 3f 3f 1c  |???.???.|
                7c 4c 41 43  4b 4c 41 4e  ||TESTL|
                44 5e 4d 41  52 59 5e 5e  |TESTM^TESTF^^|
                5e 7c 7c 31  39 33 31 30  |^||19310|
                33 31 36 30  30 30 30 30  |31600000|
                30 2e 30 30  30 7c 46 7c  |0.000|F||
                7c 7c 7c 7c  7c 7c 7c 7c  ||||||||||
                7c 4e 6f 74  20 61 76 61  ||Not ava|
                69 6c 61 62  6c 65 7c 7c  |ilable|||
                7c 7c 7c 7c  7c 7c 0d 4f  |||||||.O|
                42 52 7c 7c  7c 7c 4e 6f  |BR||||No|
                74 20 61 76  61 69 6c 61  |t availa|
                62 6c 65 5e  53 48 4f 55  |ble^SHOU|
                4c 44 45 52  20 41 50 7c  |LDER AP||
                7c 7c 32 30  30 30 30 32  |||200002|
                30 34 31 35  34 33 30 30  |04154300|
                2e 30 30 30  7c 7c 7c 7c  |.000|||||
                7c 7c 7c 7c  7c 7c 7c 7c  ||||||||||
                7c 7c 7c 7c  7c 43 52 7c  ||||||CR||
                0d 5a 44 53  7c 31 2e 32  |.ZDS|1.2|
                2e 38 34 30  2e 31 31 33  |.840.113|
                35 36 34 2e  32 31 35 36  |564.2156|
                38 31 32 34  35 36 2e 32  |812456.2|
                30 31 30 30  30 31 30 34  |01000104|
                2e 32 35 31  35 33 33 35  |.2515335|
                36 2e 36 30  30 30 35 30  |6.600050|
                7c 43 4d 7c  62 68 63 71  ||CM|bhcq|
                63 77 7c 32  7c 0d 1c 0d  |cw|2|…|
                Engine idle — 08/16/2006 09:16:25

                -- Max Drown (Infor)

              • #58181
                Dennis Pfeifer
                Participant

                  the 0D 1C 0D .. is actually

                  0D (end of segment)

                  1C 0D (End of message)

                  so .. your ending sequence is what I would expect.

                  Dennis

                • #58182
                  Mike Grieger
                  Participant

                    Yes, the MLP is correct.  The issue with your message is that there is a ‘1c’ within the message.  THAT is the illegal character and needs to be addressed.  The mlp.pdl is written to look for that 1c and expects it only at the end of a message.  Anywhere else and you have issues.

                  • #58183
                    Joe Halbrook
                    Participant

                      Gotcha.

                  Viewing 7 reply threads
                  • The forum ‘Cloverleaf’ is closed to new topics and replies.