You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old May 20th, 2020, 04:32 PM   #46
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,764
Quote:
Originally Posted by lee1968nh View Post
That tool is a piece of junk. Don't waste time.
There speaks someone who has tried it, I don't know, never used it.

But let's face it, if you have to make modifications that will require a download, just "Go Online", "Save" (You will get a prompt that tag values may have changed... say yes to upload and save them), "Go Offline" , do your mods as quickly as possible, then "Go Online" and "Download".

If nothing was running while you did your mods, your "Run-Hours", however you have derived them, will be correct. and if some background process was running motors/fans etc., a few minutes isn't gonna be a deal-breaker in terms of hours run.
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
if you've never made a mistake at work, you've never worked


  Reply With Quote
Old May 20th, 2020, 04:39 PM   #47
lee1968nh
Member
United States

lee1968nh is offline
 
Join Date: Nov 2010
Location: NH
Posts: 49
I preserve an uploaded version and transcribe relevant values to new program. I've never been a fan of AB's all or nothing at all program downloads for this very reason. The preserved data tool looks like it was the semester project of a 10th grade automation programming student. Conceptually useful but practically useless in my experience. Name your variables that need to be preserved so you can find them later is the best suggestion I can give. AB should now and always should have offered the ability to download logic only. They don't and no doubt never will. AD does...no need to worry about changing volatile memory on a DL06.
  Reply With Quote
Old May 21st, 2020, 07:57 PM   #48
5618
Member
United States

5618 is offline
 
5618's Avatar
 
Join Date: Oct 2017
Location: York, PA
Posts: 120
I want to throw out one more idea. We reset when we swap a pump and I like to know when that happens. I like to see hourmeters to .1 hour. If I tried to just add .1, we would get odd decimals. This keeps floating point to a single decimal place. It’s only good for about a million hours though.
Attached Images
File Type: jpeg 8ED6C91B-4D78-4B15-B91A-DBE1B30E467A.jpeg (64.5 KB, 53 views)
  Reply With Quote
Old May 21st, 2020, 08:52 PM   #49
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 849
Quote:
Originally Posted by 5618 View Post
I want to throw out one more idea. ...I like to see hourmeters to .1 hour....

I like to simplify: I think you can eliminate one of the ONe-Shots and change the counter preset from 360 to 180.
  Reply With Quote
Old May 21st, 2020, 09:44 PM   #50
5618
Member
United States

5618 is offline
 
5618's Avatar
 
Join Date: Oct 2017
Location: York, PA
Posts: 120
Quote:
I like to simplify: I think you can eliminate one of the ONe-Shots and change the counter preset from 360 to 180.
You’re right. That could have been simpler. Is a program ever really done? After I posted that I was looking at it wondering “Why didn’t I make a one second pulse in that system?” I already created a pulse and converted all the hour meters. I have a todo for a September shutdown to delete the old ONS bits from the UDT when I can do a download.
  Reply With Quote
Old May 22nd, 2020, 09:34 AM   #51
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,764
Quote:
Originally Posted by drbitboy View Post
I like to simplify: I think you can eliminate one of the ONe-Shots and change the counter preset from 360 to 180.
I like to simplify also, so if you did that, you could get rid of BOTH of the one-shots ....
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
if you've never made a mistake at work, you've never worked


  Reply With Quote
Old May 22nd, 2020, 09:51 AM   #52
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,764
Quote:
Originally Posted by 5618 View Post
I want to throw out one more idea. We reset when we swap a pump and I like to know when that happens. I like to see hourmeters to .1 hour. If I tried to just add .1, we would get odd decimals. This keeps floating point to a single decimal place. It’s only good for about a million hours though.
Here's a little "trick".... You are presumably GSV'ing the LocalDateTime from the WallClock into a DINT[7] array.

If you created a UDT, called something like "DateTime" with 7 DINT members named ...

Year
Month
Day
Hour
Minute
Seconds
uSeconds

... then create your LocalDateTime tag as data-type "DateTime", then you can GSV to LocalDateTime.Year. So long as the UDT matches in SIZE to a DINT[7] array, the GSV is happy with it.

Your LocalDateTime[5] then becomes LocalDateTime.Seconds, which makes it easier, and more immediate, to understand. I had to count through on my fingers to work out what word 5 was of the LocalDateTime data.

I also use this method for Controller Recoverable Fault information, module fault information etc. I build my UDTs exactly to the structures defined in the documentation, and then I don't have to worry about splitting DINTs into two INTs (as you would need to for Fault Type and Code for example), the GSV just overlays the data into the appropriately named members of the destination tags.
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
if you've never made a mistake at work, you've never worked


  Reply With Quote
Old May 22nd, 2020, 10:18 AM   #53
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 849
Quote:
Originally Posted by daba View Post
I like to simplify also, so if you did that, you could get rid of BOTH of the one-shots ....



whoops, missed that, yes, of course.
  Reply With Quote
Old May 23rd, 2020, 12:41 PM   #54
Stuwertz
Member
India

Stuwertz is offline
 
Join Date: Feb 2018
Location: *******
Posts: 44
Quote:
Originally Posted by 5618 View Post
I want to throw out one more idea. We reset when we swap a pump and I like to know when that happens. I like to see hourmeters to .1 hour. If I tried to just add .1, we would get odd decimals. This keeps floating point to a single decimal place. It’s only good for about a million hours though.
Hi

I tried a same program in one of my machine but if we removed one shots timer not working. Then I proceed with same two one shots as same as copy your program and preset as 180, once the timer elapsed his time its done bit not came . Pump running hours not changing. . Could you explain whether I did any mistake .
  Reply With Quote
Old May 23rd, 2020, 01:07 PM   #55
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 849
Quote:
Originally Posted by Stuwertz View Post
Hi

I tried a same program in one of my machine but if we removed one shots timer not working. Then I proceed with same two one shots as same as copy your program and preset as 180, once the timer elapsed his time its done bit not came . Pump running hours not changing. . Could you explain whether I did any mistake .



No explanation is likely without seeing the code.
  Reply With Quote
Old May 23rd, 2020, 01:32 PM   #56
5618
Member
United States

5618 is offline
 
5618's Avatar
 
Join Date: Oct 2017
Location: York, PA
Posts: 120
If you are duplicating the example I posted, use a cleaner version here. Almost immediately after posting that I didn't like it. That was where I left it a couple years ago.


I made a one second pulse in the main routine and cleaned up the hourmeters. Also while editing I used Daba's suggestion for the wallclock UDT. It does make it easier for a UK tech to notice the backwards format. I'm a huge fan of UDTs. I even made a three bit one for the pulse. You will have to rework tags as needed to match your data type usage.

The reset bit is from a password protected SET action button on a HMI.
Attached Images
File Type: jpg WallclockGSV.JPG (24.9 KB, 11 views)
File Type: jpg Hourmeter.JPG (64.4 KB, 8 views)
File Type: jpg DateTime.JPG (43.4 KB, 8 views)

Last edited by 5618; May 23rd, 2020 at 01:55 PM.
  Reply With Quote
Old May 23rd, 2020, 01:56 PM   #57
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 849
Quote:
Originally Posted by drbitboy View Post


Quote:
Originally Posted by daba View Post
I like to simplify also, so if you did that, you could get rid of BOTH of the one-shots ....


whoops, missed that, yes, of course.

heh, we are both wrong: the reset of the 180s counter will reset .CU as well, so that counter will increment to 1 on the next scan, instead of waiting for the next rising edge of the RTC seconds.


See the example below, which demonstrates two minute-meters.


Caveats
  • This is based on 5618's prototype here; he has since provided better examples.
    • @5618: I apologize in advance for giving your previous code an extended life; apparently it is going to hang around (like a stale **** ; we can only hope mine will have similar strength and staying power ).
    • To be clear and explicit to anyone who has not yet fallen asleep:
      • 5618's more recent example is what you should follow;
      • This post is about my OCD-driven need to correct my mistake, which does not matter anymore.
  • This is MicroLogix 1100, and its RTC only updates every 2s
    • so the RTC:0.SEC/0 never changes
    • so I use RTC:9.SEC/1 instead, which changes every 2s
  • To make it run faster for visual observation, I wrote this to update a float, representing minutes instead of hours, by 0.2 i.e by 12 seconds.
    • Rung 0000
      • RTC:0.SEC/1 sends a rising edge to the CTU with C5:0 every 4s,
      • So the counter preset is 3 i.e. 4s/count x 3count => 12s
      • N.B. the Latch of C5:0.CU after the reset of C5:0.CU, to maintain the memory of the rising edge of RTC:0.SEC/1
    • Rung 0001
      • The ORed oneshots on the XIO and XIC send a rising edge to the CTR with C5:1 every 2s
      • So the counter preset is 6 i.e. 2s/count x 6count => 12s
      • N.B. MicroLogix 1100 does not allow an ONS instruction without a following output instruction, so the CTU on C5:1 is on both branches, instead of on the ORed result, as was done in the original example.
Other than those multiple, confusing, silly differences, it's exactly like 5618's original!
Attached Images
File Type: png xxx.png (24.3 KB, 32 views)

Last edited by drbitboy; May 23rd, 2020 at 02:07 PM.
  Reply With Quote
Old May 23rd, 2020, 02:07 PM   #58
Stuwertz
Member
India

Stuwertz is offline
 
Join Date: Feb 2018
Location: *******
Posts: 44
Quote:
Originally Posted by drbitboy View Post
whoops, missed that, yes, of course.
I tried this program without reset only to see the hour meters . Please find my attachment
Attached Images
File Type: jpg 3364AB40-1BBF-43B6-AF92-D3BAC7188505.jpg (296.3 KB, 27 views)
  Reply With Quote
Old May 23rd, 2020, 02:53 PM   #59
5618
Member
United States

5618 is offline
 
5618's Avatar
 
Join Date: Oct 2017
Location: York, PA
Posts: 120
I think your linerErunning_hours is a DINT instead of Real. The code could be simpler to just count hours but I have a compulsion to see tenths of an hour.
  Reply With Quote
Old May 23rd, 2020, 03:16 PM   #60
5618
Member
United States

5618 is offline
 
5618's Avatar
 
Join Date: Oct 2017
Location: York, PA
Posts: 120
I had two reasons for my original post. The example by dirtboy shows the joys of floating point addition. I originally tried that and couldn’t take the .000001 showing up. Muliply by 10, add 1, divide by 10 keeps that away, at least in Logix 5000 platforms. The other reason was to share the idea of recording the date when reset.

For something simple for whole hours, count to 3600 or 1800 if a two second pulse. Then just add 1 to a DINT.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Function Block/ AOI Demonstration ndzied1 LIVE PLC Questions And Answers 11 December 13th, 2018 09:06 AM
KB4093108 causing issues on some Rockwell computers Stonent LIVE PLC Questions And Answers 0 June 12th, 2018 12:09 PM
FYI - Rockwell Software padees LIVE PLC Questions And Answers 8 August 27th, 2017 12:55 PM
Weigh feeder or flow meter .rss programming jitu360 LIVE PLC Questions And Answers 0 July 29th, 2014 06:45 AM


All times are GMT -4. The time now is 05:52 PM.


.