News:

  • October 27, 2025, 06:26:12 AM

Login with username, password and session length

Author Topic: 1st project problems  (Read 26667 times)

mhw

  • Hero Member
  • *****
  • Posts: 250
1st project problems
« on: April 09, 2013, 03:24:28 PM »
I need someone to hold my hand as I do my first do-more project.
I am trying to have a tmr reset itself every time it's done bit comes on. I have the following line of code in "$Main": STRN T6.Done TMR T6 DLV10. Currently I have DLV10 set to 500. Viewing the tmr.done bit in trend view shows that it will be on sporadically. I have tried this in both sim and to an actual PLC with the same result. In the past I have done this same thing in DS5 without any problems.

plcnut

  • Hero Member
  • *****
  • Posts: 813
    • premiersi.com
Re: 1st project problems
« Reply #1 on: April 09, 2013, 03:41:07 PM »
Every 500 milliseconds(1/2 second) it is resetting the timer.
Right?
Circumstances don't determine who we are, they only reveal it.

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

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6127
  • Yes Pinky, Do-more will control the world!
Re: 1st project problems
« Reply #2 on: April 09, 2013, 03:43:41 PM »
That should work just fine. The .Done bit will only be on for 1 scan...which in Do-more land is pretty quick. You won't see it in Trend view every time...
"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

mhw

  • Hero Member
  • *****
  • Posts: 250
Re: 1st project problems
« Reply #3 on: April 09, 2013, 03:59:36 PM »
Every 500 milliseconds(1/2 second) it is resetting the timer.
Right?
Yes
You won't see it in Trend view every time...
That's disappointing, but good to know.

plcnut

  • Hero Member
  • *****
  • Posts: 813
    • premiersi.com
Re: 1st project problems
« Reply #4 on: April 09, 2013, 04:01:54 PM »
That's disappointing, but good to know.

What were you wanting it to do?
Circumstances don't determine who we are, they only reveal it.

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

mhw

  • Hero Member
  • *****
  • Posts: 250
Re: 1st project problems
« Reply #5 on: April 09, 2013, 04:24:13 PM »
That's disappointing, but good to know.

What were you wanting it to do?
The disappointing part is that trend view will not capture a one scan event. What I described earlier is a test that I had set up to try and understand why what I am tring to do does not work.

What I am trying to do is to use a counter done bit to trigger a math calculation that uses the accumulated value from a tmr. This same done bit also resets the counter and the timer. Apparently the timer is reset before the math can grab the value. This is all logic that worked great in DS5.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6127
  • Yes Pinky, Do-more will control the world!
Re: 1st project problems
« Reply #6 on: April 09, 2013, 04:31:57 PM »
The disappointing part is that trend view will not capture a one scan event. What I described earlier is a test that I had set up to try and understand why what I am tring to do does not work.

Sorry to disappoint. The Trend view is an async data client that just reads as fast as it can. It is not a scan to scan capture, although that it something that we would like to do in the future.

With typical scan times on the order of a few hundred micro seconds, Do-more is fast enough that gathering and managing scan-to-scan data is not an insignificant task.

What I am trying to do is to use a counter done bit to trigger a math calculation that uses the accumulated value from a tmr. This same done bit also resets the counter and the timer. Apparently the timer is reset before the math can grab the value. This is all logic that worked great in DS5.

Timer and counter logic in Do-more are virtually identical to DL implementations. Post your logic and we are happy to help you.
"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: 813
    • premiersi.com
Re: 1st project problems
« Reply #7 on: April 09, 2013, 04:35:22 PM »
What I am trying to do is to use a counter done bit to trigger a math calculation that uses the accumulated value from a tmr. This same done bit also resets the counter and the timer. Apparently the timer is reset before the math can grab the value. This is all logic that worked great in DS5.

If the reset is before the MATH in the ladder(even if it is in the same rung) then your math will always read a zero.
Try placing the MATH before the timer reset on the rung
Circumstances don't determine who we are, they only reveal it.

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

mhw

  • Hero Member
  • *****
  • Posts: 250
Re: 1st project problems
« Reply #8 on: April 10, 2013, 08:53:22 AM »
My mistake, of course.
In status view I was seeing .125 sec in the timer accumulator. So I thought I was using .125 in my math and assumed that we were doing floating point math. My math was 45/T1.acc=DLV0. This was giving me a result of 0. I started running down the wrong road when I did not see my math trigger showing in trend view. Thanks for the help.

plcnut

  • Hero Member
  • *****
  • Posts: 813
    • premiersi.com
Re: 1st project problems
« Reply #9 on: April 10, 2013, 08:59:20 AM »
Cool.
I think you'll like DMD when you get used to it!
Circumstances don't determine who we are, they only reveal it.

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

mhw

  • Hero Member
  • *****
  • Posts: 250
Re: 1st project problems
« Reply #10 on: April 10, 2013, 01:32:45 PM »
Is there a way to rename a code block?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6127
  • Yes Pinky, Do-more will control the world!
Re: 1st project problems
« Reply #11 on: April 10, 2013, 01:37:14 PM »
Is there a way to rename a code block?

Yes. From the memory config in the system configuration. Select the associated structure from the Heap Items list and edit it.

Because there are lots of possible things that can happen when memory blocks or heap items are updated, we force most of those changes to happen through the system configuration, since it understands all of the rules. It isn't the most obvious, but architecturally it is best.
"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

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3762
    • Host Engineering
Re: 1st project problems
« Reply #12 on: April 10, 2013, 01:53:58 PM »
Is there a way to rename a code block?
You can also do it from the Project Browser.  Make sure you are in Edit mode (Ctrl+E), then right click on the code-block you want to rename and select Configure Code Block.  That lets you rename a user code-block (but not system code-blocks).

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6127
  • Yes Pinky, Do-more will control the world!
Re: 1st project problems
« Reply #13 on: April 10, 2013, 01:55:42 PM »
Is there a way to rename a code block?
You can also do it from the Project Browser.  Make sure you are in Edit mode (Ctrl+E), then right click on the code-block you want to rename and select Configure Code Block.  That lets you rename a user code-block (but not system code-blocks).

Really? I was looking for that just yesterday and didn't see it. <sigh>

Ok...disregard what I said about architecture...
"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

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6127
  • Yes Pinky, Do-more will control the world!
Re: 1st project problems
« Reply #14 on: April 10, 2013, 02:48:12 PM »
Is there a way to rename a code block?
You can also do it from the Project Browser.  Make sure you are in Edit mode (Ctrl+E), then right click on the code-block you want to rename and select Configure Code Block.  That lets you rename a user code-block (but not system code-blocks).

Ah...'Configure Code Block' is the issue. I was looking for 'Rename...'. Not suggesting we change anything, but I suspect most folks will miss that.
"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