Announcement

Collapse
No announcement yet.

'Filter over time - BCD' iBox, results truncated

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


  • 'Filter over time - BCD' iBox, results truncated

    The following program is causing me some problems. When the PLC is running on the machine, all I/O act as expected. I wish to filter the analogue voltage input values.

    Hardware ... DL06, F08-ADH-2, & F0-08SIM,
    CPU Ver 2.3
    Gate Arrary Ver. 1.0

    Software ... Directsoft 5.3 programming version

    I see the raw analogue input values (V400, 2, 4, 6, 10, 12) range from about 5000 to 60000 (BCD/HEX & DWORD) in the DATA window

    BUT...

    Monitoring the filtered values (V1210, 12, 14, 16 & 20) as BCD/HEX & DWORD shows that only the lower word is put in these locations - the upper word of the DWORD is blank/zero.

    Is it a bug or something I haven't read yet?

    PLC 06

    // Rung 1
    // Address 0
    ANLGIN K0 K1 K8 K0 V400

    // Rung 2
    // Address 38
    FILTER T370 K1 V400 K10 V1210
    FILTER T371 K1 V402 K10 V1212
    FILTER T372 K1 V404 K10 V1214
    FILTER T373 K1 V406 K10 V1216
    FILTER T374 K1 V410 K10 V1220

    // Rung 3
    // Address 373
    STR X120
    ANDN T1
    TMR T0 K100

    // Rung 4
    // Address 378
    STR X120
    AND T0
    TMR T1 K100

    // Rung 5
    // Address 383
    STR X120
    AND T0
    OUT Y16

    // Rung 6
    // Address 386
    STR X120
    ANDN T0
    OUT Y17

    // Rung 7
    // Address 389
    END

    // Rung 8
    // Address 390
    NOP


    #BEGIN ELEMENT_DOC
    "X120","Sim Switch 0","",""
    "X121","Sim Switch 1","",""
    "X122","Sim Switch 2","",""
    "X123","Sim Switch 3","",""
    "X124","Sim Switch 4","",""
    "X125","Sim Switch 5","",""
    "X126","Sim Switch 6","",""
    "X127","Sim Switch 7","",""
    "Y0","Cyl 0 Move","",""
    "Y1","Cyl 1 Move","",""
    "Y2","Cyl 2 Move","",""
    "Y3","Cyl 3 Move","",""
    "Y4","Cyl 4 Move","",""
    "Y16","Move IN","",""
    "Y17","Move OUT","",""
    "T0","tmr_OUT_CYL","",""
    "T1","V","",""
    "T370","tmr_AlgFilter_0","",""
    "T371","tmr_AlgFilter_1","",""
    "T372","tmr_AlgFilter_2","",""
    "T373","tmr_AlgFilter_3","",""
    "T374","tmr_AlgFilter_4","",""
    "T375","tmr_AlgFilter_5","",""
    "T376","tmr_AlgFilter_6","",""
    "T377","tmr_AlgFilter_7","",""
    "V400","alg_Raw_CYL_0","CH1 Analogue IP","Red wire"
    "V402","alg_Raw_CYL_1","CH2 Analogue IP","Orange wire"
    "V404","alg_Raw_CYL_2","CH3 Analogue IP","Yellow wire"
    "V406","alg_Raw_CYL_3","CH4 Analogue IP","Green wire"
    "V410","alg_Raw_CYL_4","CH5 Analogue IP","Blue wire"
    "V412","alg_Raw_CYL_EXC","CH6 Analogue IP","Brown wire"
    "V1200","scr_Current","","1-999"
    "V1201","scr_Func_Butt","","Bit = button down"
    "V1202","scr_Numb_Butt","","Bit = button down"
    "V1203","scr_Goto_Scr_#","","1-999"
    "V1204","scr_Beep","","Bit 0:On/Off Bit 15: En/Disable"
    "V1205","scr_Light_Clr","","0=Current, 1=GRN, 2=Lime, 3=YLW, 4=AMB, 5=RED, 6=Off"

    #END
    Last edited by Black Magic; 09-29-2009, 12:15 PM. Reason: Added CPU version etc


  • #2
    I had thought the analog in helper, and filter Iboxes only worked in single word; although I can't find any documentation on that now.

    Anyhow, perhaps you can change your "Analogin" set up to "bin" instead of "BCD". That will keep it in single word and then use the "filterb".

    Might work, but I don't have anything here to test with.

    Good Luck,
    Bob

    Comment



    • #3
      Try using FILTERB, using binary (deciaml) format numbers. This will allow your values to fit into a single word.

      Comment



      • #4
        Thanks guys - that was part of the solution (In fact as far as the PLC is concerned it's the entire solution.)

        I already had a binary program done - I loaded it up, without closing directsoft 5.

        The data window would still show 0000 0011 XXXX XXXX from the raw analogue memory location (V400 - XX being real data)

        Apparently it was an artefact from the previously opened program, and was not cleared/rewritten when monitoring using the new PLC program. We changed the data view binary/BCD/octal and word/dword a few times and it cleared itself on one of these changes.

        Comment



        • #5
          Did you do a power cycle to the PLC after you changed the analog set up logic??

          That Ibox should have a conditional first scan bit ahead of it. You need to cycle power or take out of "RUN" mode and put back in through DS5 to get the logic to change the setup to store the values in binary.
          Bob

          Comment



          • #6
            Glad to hear you got it working.

            Comment



            • #7
              Bob S BN, it sounds like Black Magic did a program-to-run mode change to get the analog working because the "xx" was real data. It sounds like the bits in the second word were left over from some previous instructions.

              Comment

              Working...
              X