adccommunitymod (AutomationDirect) asked a question.

Input value scaling for use in PID feedback

Created Date: August 03,2008

Created By: Rick951

**** 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 DL-06 with a 16 bit analog input module. The input is scalled as a double word. This is all working fine. When I try to set up the PID I find that the PV input is only a single word binary. How do I conver from a double to single word binary? Thanks in advance! Rick


  • adccommunitymod (AutomationDirect)

    Created Date: August 03,2008

    Created by: bcarlton

    Don't try to convert from your 'double word scaled ' value. Why double word anyway? You can't derive any more accuracy than exists in the raw data.

    The input from the analog module is either binary - in which case the use of it directly is appropriate. Else it is BCD in which case the BIN command will convert it nicely.

  • adccommunitymod (AutomationDirect)

    Created Date: August 03,2008

    Created by: Rick951

    Thanks for the responce!

    I have not done much PLC programing recently, I have done more "C " programiing. In the example for the module I have, the raw output is a double BCD I.E V500,501. I understand your example of using the raw value directly as an input to the PID loop and convert the analog input elsewhere for the user interface. I guess I am sill a bit confused.

    Rick

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: August 03,2008

    Created by: bcarlton

    Can the analog input module be set to provide its value as a binary value in a single register? What is the module number?

    Sometimes the PID can be set up to get its input value (PV) directly from the input module. You may want to investigate that.

  • adccommunitymod (AutomationDirect)

    Created Date: August 03,2008

    Created by: franji1

    I believe that there are some new analog modules that use DWORDs for their data.

    I'm not sure of how PID works if you use PID's pointer method vs. the standard pointer method.

    I would recommend using the standard pointer method, then manually moving the data into the PID PV register (which I think is what your original question is asking). I'm not an analog guru, especially with these new modules, but the typical way the endian-ness works, the 16 bits of data that you care about is in the LOWORD, i.e. if it is a double word in V2000/V2001, the significant digits are in V2000. I'm assuming this is a 16 bit unipolar module with a range of 0..65535???

    Oh! This may be why it is DWORD, in case the encoding format of the module is BCD, and 6-5-5-3-5 cannot fit in a single word! If THAT is the case, PID only works with binary, so you will need to convert BCD to Binary using the BIN instruction. Just do the following IF it is BCD:

    LDD V2000 // load all 32 bits, or all 8 BCD digits into the accumulator

    BIN convert it to BINARY

    OUT V3003 // wherever your PID loop's PV register is - NOTE this is NOT an OUTD instruction, but an OUT box (single word)

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: August 03,2008

    Created by: Rick951

    I have DL-06 with a 16 bit analog input module. The input is scalled as a double word. This is all working fine. When I try to set up the PID I find that the PV input is only a single word binary. How do I conver from a double to single word binary?

    Thanks in advance!

    Rick