adccommunitymod (AutomationDirect) asked a question.

Number Format

Created Date: September 28,2004

Created By: robertkeenan

**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****

I have written a program on a DL105 which receives data from an EasyView MT-Series touch screen. A quantity is entered and the PLC is meant to count down to zero. With the trigger signal I had tried to load the quantity (V2000) and take one away from this but the DirectSOFT32 program does not appear to allow the use of SUB K1. Is this correct, my soulution was to use SUBD K1. It appears to be the same problem on all the other PLC's. This is not my main problem. What I now want to do is use the Infilink HMI software to try and learn how to use the PC. When I enter a value of 10 on the PC the PLC shows this as A. Run my program and the V2000 will not count down. If the program is simply LD V2000, SUBD K1, OUT V2000 then why when V2000 goes above 9 it will not count down. Type 16 on the PC and the PLC shows a value of 10. Counting now starts and goes from 10 to 9 all the way down to zero. However on the PC this shows as going from 16 straight to 9 then as normal. Would anyone know what I could be doing wrong. I have tried going through all the number formats available on the PC software but can not create a situation where I can enter 10 and allow it to count down.


  • adccommunitymod (AutomationDirect)

    Created Date: September 28,2004

    Created by: robertkeenan

    I have written a program on a DL105 which receives data from an EasyView MT-Series touch screen. A quantity is entered and the PLC is meant to count down to zero. With the trigger signal I had tried to load the quantity (V2000) and take one away from this but the DirectSOFT32 program does not appear to allow the use of SUB K1. Is this correct, my soulution was to use SUBD K1. It appears to be the same problem on all the other PLC's. This is not my main problem. What I now want to do is use the Infilink HMI software to try and learn how to use the PC. When I enter a value of 10 on the PC the PLC shows this as A. Run my program and the V2000 will not count down. If the program is simply LD V2000, SUBD K1, OUT V2000 then why when V2000 goes above 9 it will not count down. Type 16 on the PC and the PLC shows a value of 10. Counting now starts and goes from 10 to 9 all the way down to zero. However on the PC this shows as going from 16 straight to 9 then as normal. Would anyone know what I could be doing wrong. I have tried going through all the number formats available on the PC software but can not create a situation where I can enter 10 and allow it to count down.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: September 28,2004

    Created by: bcarlton

    The native numbering system in the AD line is BCD. This is what the timers and counters use for their presets. They freak if they see a non BCD number. The standard math operations also die if an operand isn't BCD. It is apparent that your HMI software is writing a straight decimal number. See if you can set the references in the HMI software to BCD. If you can't then you will have to make the HMI software write to a seperate location and let the PLC do the decimal->BCD conversion using the BCD command.

    Another solution is to do the internal math using the SUBB command. Make sure you view the register's contents in a dataview with the mode set to 'decimal '.

    (Note that while the instructions refer to this non-BCD format as 'binary ' the display formats let you view the full values in 'binary ', 'decimal ' or 'BCD/HEX - this being the format which is normally shown in the ladder ')

    And yes you can't subtract a constant with SUB but you can with SUBD. Interesting, isn't it? It's just one of those things you'll have to remember.

    Expand Post