News:

  • July 03, 2026, 08:40:46 AM

Login with username, password and session length

Author Topic: Writing a report in PLC  (Read 13509 times)

Garyhlucas

  • Hero Member
  • *****
  • Posts: 421
Writing a report in PLC
« on: July 27, 2015, 03:44:46 PM »
I am trying to put together a page in a Cmore HMI to show data total for each of the past 6 months with a start and end date for each month.  I also have another screen with the date and daily totals for 31 days.  Confused on how to do this. It appears Cmore supports SDT UDT data types. I need to change the date at midnight each night and shift the daily totals and dates down one letting it scroll off at 31 days.  Then each month I need to change the start date, and move the all the monthly totals down letting the last one scroll off.  I've done this before in other PLCs but it appears that Do-More and C-More can do this in a lot more elegant way.  Hints?

The program I am working on consumes about 100,000 bytes at the moment, looks like it'll fit.

Thanks,

Garyhlucas

  • Hero Member
  • *****
  • Posts: 421
Re: Writing a report in PLC
« Reply #1 on: July 29, 2015, 11:12:39 AM »
Been holding off working on this code hoping someone would suggest how to do it in DoMore.  No suggestions?

mhw

  • Hero Member
  • *****
  • Posts: 250
Re: Writing a report in PLC
« Reply #2 on: July 29, 2015, 11:47:42 AM »
I'll take a stab at part of this.

Quote
It appears Cmore supports SDT UDT data types.
Yes it does. But for whatever reason the Cmore will not import these tag names from DMD. They must be manually created in Cmore. Maybe hosties can look in to this and determine why.

Quote
I need to change the date at midnight each night and shift the daily totals and dates down one letting it scroll off at 31 days.
Create a contiguous block of 32 memory locations. For example D0-D31. Put a 0 in D0. Put todays data in D1. At midnight do "MOVER" with the start being D0, length 31, destination D1.

I know this does not answer all of your questions, but maybe it will get you started or at least motivate one the smarter guys to respond.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6164
  • Yes Pinky, Do-more will control the world!
Re: Writing a report in PLC
« Reply #3 on: July 29, 2015, 12:01:05 PM »
C-more isn't a Host product. Not a great answer, I know, but there is really nothing else we can do.

I know that some folks have used STRPRINT to format time and date information in the PLC, rather than do so in C-more.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Garyhlucas

  • Hero Member
  • *****
  • Posts: 421
Re: Writing a report in PLC
« Reply #4 on: July 29, 2015, 08:08:04 PM »
Okay,
I knew how to shift the data, I've done that in AB, and on a DL205 where my data tables actually used up the entire memory of a 260 processor.  It is the UDT stuff I don't understand.  I was hoping maybe the C-more uses it and can display a date that is in that format.  I live in NJ and work for a company 160 miles away, where to PLC is located. So I work from home as much as possible. I guess I need to set up the spare PLC and take it home to test this kind of stuff.  When I get it working I'll post about what I did.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6164
  • Yes Pinky, Do-more will control the world!
Re: Writing a report in PLC
« Reply #5 on: July 29, 2015, 08:11:03 PM »
The Sim is great for developing and testing stuff that doesn't require I/O.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: Writing a report in PLC
« Reply #6 on: August 11, 2015, 10:55:56 AM »
You will need to store and shift your data as has already been stated. You can then set up a block of 10 (or whatever the quantity you want on one screen) of SS or SL memory locations. Now set up a task in your Do-more. At the top of your task set up some MATH boxes to calculate your starting and ending display pointers. Now insert a FOR with the starting and ending addresses that you just calculated. Inside the FOR loop, you can place a STRPRINT that can format each of the indexed values from your table. Now on your C-more, you only need to place 10 text displays on the screen, with an increment/decrement object with an offset of 10.
Use the increment/decrement value in your PLC program with a Delta contact to trigger the task, and then use this same value for all of your MATH box calculations at the top of the Task.

I think I probably made this about as clear as mud... Please post back with screenshots of what you have so far.

I can try to throw a sample together for you if you can post some of what you have so far.
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

Garyhlucas

  • Hero Member
  • *****
  • Posts: 421
Re: Writing a report in PLC
« Reply #7 on: August 15, 2015, 03:38:06 PM »
Nut,
No, you did good, it makes sense to me.  The concept I was missing was making this a Task.  I used them for I/O and I've I used stages a lot but I kind of overlooked the Task function.

Thanks,