adccommunitymod (AutomationDirect) asked a question.

LCD Display logged time stamped fault.

Created Date: June 26,2008

Created By: elevmike

**** 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'm trying to make our fault logging a little more user friendly. V10000+ is used to record and store ~10 different typ faults. Each fault is 8 words. The first 7 words are the Date & time of the fault occurance. The 8th word is the fault code to indicate the fault. We can store 500+ time stamped fault events. Currently, to read the fault log, the tech has to bring up each vmem and manually decode it to get the date time and fault. The goal here is to simply activate an input (a button on the control panel) that would activate code to display date & time on line 1, then the fault code on line 2. If the tech holds down the button, the code will scroll the log, displaying each logged fault for 2 seconds. The resulting display would be like so: 02:25:08 1310:45 (feb 2, 2008 @ 1310:45) Fault Code 05 My problem is displaying the month, day & time on one line. Question: How do I format & display, the stord date & time on line 1? Thanks, Mike


  • adccommunitymod (AutomationDirect)

    Created Date: June 27,2008

    Created by: AZRoger

    Mike,

    I have a couple questions to clarify what you'd like to do. I'll number them just to make it easier to refer to latter. They are not in any particular order.

    1) You mentioned 8 words for the log entries. I only counted 7 (mon,day,year,hrs,mins,secs,fault-code). Is there a serial number or something in addition?

    2) Are you trying to format 8 words (16 bytes) into some sort of shorter string with punctuation added?

    3) What display are you using?

    4) What CPU? (Important for knowing what instructions are available.)

    5) Is just building a BCD string in memory enough?

    I'll be glad to help but I'd like more guidance before I go off in the wrong direction.

    Roger

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: June 27,2008

    Created by: elevmike

    It's the DL06 LCD display. Authough the display is limited, it works very well for our purposes.

    The 7 words are, copied from V7766 - V7774 (Date & time) to V10000 - V10006. The 8th word is the fault code and would be placed in v10007.

    The next fault would be logged into V10010-v10017, and so on...

    The idea is to provide a momentary button that would activate an input on the plc. That input would then activate the scrolling display of the logged faults.

    On the display line 1 would be the date & time. Line 2 would be the fault code.

    I have everything worked out but displaing the full date & time on line 1. The problem seems to be that you can only display one Vmem value on each line?? I need to know if what I'm trying to do is actually impossable, or if there's a workaround.

    Thanks, Mike

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: June 27,2008

    Created by: milldrone

    Mike,

    Check out "Vprint " in the ascii instructions.

    // Rung 29

    // Address 288

    #BEGIN COMMENT

    "upon loss of phase the time will be written to v2000= number of vmem should be " "8 " " "

    " v2001 thru v2010=rest of time data "

    " "

    " "

    " "

    " "

    " "

    #END

    STRND X12

    VPRINT K0 V2000 "_time:24 "

    // Rung 29

    // Address 288

    #BEGIN COMMENT

    "upon loss of phase the time will be written to v2000= number of vmem should be " "8 " " "

    " v2001 thru v2010=rest of time data "

    " "

    " "

    " "

    " "

    " "

    #END

    STRND X12

    VPRINT K0 V2000 "_time:24

    Vaughn

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: June 27,2008

    Created by: franji1

    I once wrote a subroutine that converts a BCD number from 1-12 into a 3 character month, with a trailing space, into 2 V memory locations, but I don't have that program any more.

    Basically, the subroutine compared the month value to K1, then did a LDD K206E614A OUTD V2000. That value in the LDD is the ASCII characters in Hexadecimal (space)naJ. I think it needs to be backwards due to the Endinness of the processor, but you can play around with it in the LCD display (it may need to be K6E204A61 n(space)Ja). Do NOT just use DirectSOFT Data View, but use the actual LCD instruction to play with the character ordering.

    The code would look like

    SBR K100

    STRE V1400 K1

    LDD K2063614A // Jan

    OUTD V2000

    STRE V1400 K2

    LDD K20(beF in hex) // Feb

    OUTD V2000

    STRE V1400 K3

    LDD K20 (raM in hex) // Mar

    OUTD V2000

    // and so on

    RET

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: June 27,2008

    Created by: AZRoger

    Elevmike,

    I agree with Milldrone that VPRINT is the key to a solution.

    On page 10â€"30 of the DL06 Micro PLC User Manual, 3rd Edition Rev. A (the online version) there's an example which shows VPRINT used to construct two 16 byte strings of ASCII characters. It then shows each on its own line on the display.

    It doesn't say explicitely that VPRINT will accept Pointer references to VMEM. If it doesn't, then it would be easiest to copy your 8-word fault record to a fixed place to work from. That may be easier than updating a bunch of pointers anyway.

    I'd bet dollars to donuts that the built in Date and Time functions ONLY work against V7766 - V7774. These addresses are protected from changed via Dataview. They are probably protected from changes by ladder programs too. So you'll have to use VPRINT with lots of parameters to pick up each part of the date and time separately. And you'll have to put in your own punctuation. But it's doable.

    Roger

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: June 27,2008

    Created by: elevmike

    Apparently this is going to be more complicated then I thought...

    Thanks for the suggestions. I'll try playing around with these ideas.

    Mike

  • adccommunitymod (AutomationDirect)

    Created Date: June 27,2008

    Created by: milldrone

    I think the part Mike will not like is that where the result is stored it occupies 8 Vmems

    Vaughn

  • adccommunitymod (AutomationDirect)

    Created Date: June 27,2008

    Created by: franji1

    Originally posted by AZRoger:

    I'd bet dollars to donuts that the built in Date and Time functions ONLY work against V7766 - V7774.

    I think it's worse than that - I bet it works against the internal real time chip that gets posted to V7766-V7774 (this is why there are DATE and TIME instructions, not just the ability to write to these V locations, which does not work).

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: June 28,2008

    Created by: elevmike

    This is terrible...

    To format the month takes 12 lines of code

    To format the day takes 31 lines of code.

    To format the year takes 99 lines of code, (I guess I could skip 00-07)

    To format the hours takes 24 lines of code.

    To format the minutes takes 60 lines of code.

    To format the seconds takes 60 lines of code.

    Total = 286 lines of code for formatting the date & time.

    062608 23:10:58

    (June 26, 2008 at 11:10:58 pm.)

    It works, but there has to be a better way??

    Mike.

    Expand Post
10 of 17