Announcement

Collapse
No announcement yet.

click BCD

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


  • click BCD

    I am new to using the click plc (C0-00D2-D) I could use a little help with using BCD. I have a 2-digit thumbwheel I would like to use for picking recipes. I used the FRD instruction when using AB software but I am not sure how to go about it using the click software a little help with what instructions needed would be appreciated thanks


  • #2
    In the help "Data types", it states that the Click does not support BCD. If necessary, I am sure you could write a math function combined with logic to do a conversion.
    ADEN ENGINEERING
    Automation & Electronic Controls

    Design, Build, Repair, Training

    Comment



    • #3
      What is the make and part number of the thumbwheel?
      If you've done the very best you can, worrying won't make it any better - Walt Disney

      Comment



      • #4
        I'm curious, are you using 8 inputs, or 4 inputs and an output to scan the switch sections?
        If a straight 8 bit input of consecutive inputs, one could "pack copy" to a DH register (the CLICK only allows "pack (or unpack) to (or from) a "hex" register) then "single copy" said register to a DS register to use as a regular integer. Now one potential issue of that very basic method is that the numeric value won't match what the switch is showing (e.g. 4A is not a valid decimal number, but each switch setting will have a unique value , e.g. 74 for 4A, also what looks like a normal decimal number won't be what one might expect for example switch setting 22 = 34. Copy between integer types does, I think, a straight bitwise copy without considering types. But an additional line or two of code could fix that easily enough. While I didn't load it into an actual PLC and try it, the math dialog did not give an error with:
        Code:
         DH1 AND F0h * 10h + DH1 AND Fh
        with a destination of DH2, Note that when in hex mode everything has to be hex, I can imagine some parentheses could be needed, I think AND should have higher precedence than arithmetic operators, but I'm not certain.

        I wish the CLICK had a simulator (or better a BRX the same price as a CLICK in which case I'd just not bother with the CLICK at all)

        Comment



        • #5
          Thanks for the help. The thumb wheel P/N (642-SMCD131AK2). I will be using 8 inputs

          Comment



          • #6
            Try this out
            Attached Files
            If you've done the very best you can, worrying won't make it any better - Walt Disney

            Comment

            Working...
            X