Announcement

Collapse
No announcement yet.

Numeric Display and Entry: BCD vs. Unsigned Integer

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts


  • Numeric Display and Entry: BCD vs. Unsigned Integer

    Hello All,

    Recently a customer of our company contacted us about an issue they're with a machine we built for them. When they try to set a timer with a numeric entry for 20 minutes, it resets after 7 1/2 minutes.

    I saw that the display format in the C-More program was in Unsigned Integer 16. All the other timers were in binary coded decimal. What would be the differences between BCD and unsigned integer 16? Should I have all of them in BCD or unsigned integer?

    Thanks for your time.


  • #2
    Assuming you are talking about the DL series of PLC (105, 05, 06, 205s, 405s etc) the timer presets need to be BCD.

    This note created by BCarlton may help you as well...
    http://www.theplcguy.com/ABtoAD/AD%2...r%20Issues.pdf
    Last edited by Bob S BN; 10-09-2015, 07:32 AM. Reason: Added note and link to Bernie's number explanation
    Bob

    Comment



    • #3
      We are using the Direct Logic D0-06AA PLC with a 10" C-More HMI. All the numeric entries and numeric displays have been changed to BCD.

      Unfortunately the machine in question is in Oklahoma while I'm in Ohio, so I can't test it right away. Hopefully this will fix the issue.

      Thanks

      Comment



      • #4
        Wait a minute...

        I tried simulating the HMI program and something fishy came up:

        When I input 1 - 999 seconds into the numeric entry, everything's fine. The virtual memory is correct (500 seconds = 5000 because the TMR instruction works in deciseconds)

        HOWEVER, when I input 1000 seconds, the numeric entry displays 0 seconds again. If I input 1100 seconds, it shows 100 seconds. For some reason it ignores the first 1000 seconds. It might have to do with the fact that the TMR instruction only goes up to 999.9 seconds. Any ideas?

        Comment



        • #5
          Exactly which timer are you using (TMR, TMRA, etc..)? The TMR can only accept a 4 digit (1VMEM, single word) value for the setpoint. 9999=999.9 sec, 16.65 minutes.

          Check the manual for the available values for the timer you are using. If you are using one of the doubleword timers, then you can set the HMI to "BCD32" to write up to 8 BCD digits.

          Just remember, if you change the timer from a single word type to a double word type, you'll need to seperate the timer addresses and setpoints leaving a space for the second word.
          Bob

          Comment



          • #6
            AndrewH,
            How many digits are set for the numeric display/entry?
            Does the numeric entry display '0' or '000' ?

            Comment



            • #7
              When I input 999 seconds, that is what is shown on the simulation screen, "999 Seconds." The value of the virtual address is 9990.

              When I input 1000, it shows "0 Seconds." The value of the virtual address shows 0 as well.

              1001 becomes 1 seconds
              1002 becomes 2 seconds
              etc.

              Comment



              • #8
                I presume you have the HMI numeric input scaling active, and are taking an input value of 999, and scaling it to 9999 as it writes to the tag vmemory address.

                When you try to write 1000 as a numeric entry, the HMI scales it to 10000.

                But, if your HMI tag is set for BCD16, that is a single word, and can't be more than 4 digits. The "1" in my example would show up in the other word of a BCD32 tag address.

                For simulation purposes, change the tag data type from BCD16 to BCD32 and see if you now get your expected value.


                And then, back to my previous post, study up on the timer words required.
                Bob

                Comment



                • #9
                  Hey, that worked. It now goes up to my set maximum of 1800 seconds (30 minutes) with no problem. i'll do the same for the rest of the numeric entries.

                  My educated guess is that I will need to change the numeric displays as well to BCD 32. I don't want to set the entry for 1100 seconds and have the display count up to 999 seconds then reset back to zero.

                  While we're here, my customer had another issue besides this. When he sets one timer to run for 90 seconds, it goes for 220 seconds. Another timer is set for 250 seconds and goes for 100 seconds.

                  This one perplexes me because one timer runs long while the other is too short.

                  Thanks for your help so far guys, it's been great to get feedback like this.
                  Last edited by AndrewH; 10-09-2015, 09:34 AM. Reason: Spelling error

                  Comment



                  • #10
                    I just sent you a PM with my phone number to better explain the ramifications of changing your numeric inputs to data type BCD32. But I'll try it here as well, so here goes...

                    If you have a timer that requires a single word to count (up to 4 BCD digits), the addressing can be done one right after the other...
                    TMR 0 will use V0 as it's accumulator
                    TMR 1 will use V1 as it's accumulator
                    TMR 2 will use V2 as it's accumulator and so on...

                    But, if you need to count more than 4 BCD digits, you need to change to a different timer type (probably TMRA (9999999.9 seconds)). Because TMRA needs 2 words of memory (doubleword, BCD32) the addressing needs to be seperated, or else this can happen...
                    TMRA 0 will use V0 and V1 as it's accumulator
                    TMRA 1 will use V1 and V2 as it's accumulator

                    You can see the problem in that 2 different timers are using the same vmem address for some of the information, and this will lead to problems. What you need to do when using bigger timers is to seperate them like this...

                    TMRA 0 will use V0 and V1 as it's accumulator
                    TMRA 2 will use V2 and V3 as it's accumulator
                    TMRA 4 will use V4 and V5 as it's accumulator, and so on...

                    You need to insure you also have double word spacing for your preset values that are coming from the HMI.
                    Bob

                    Comment



                    • #11
                      Thanks Bob, this is a big help. I will look over both the PLV AND HMI programs again to make sure there isn't any overlap with any of the addressing.

                      Comment

                      Working...
                      X