News:

  • August 28, 2026, 10:14:50 PM

Login with username, password and session length

Author Topic: Designer Software problems?  (Read 18541 times)

ERokc

  • Hero Member
  • *****
  • Posts: 118
Designer Software problems?
« on: March 10, 2013, 11:35:27 PM »
I'm still a novice but I think I discovered some problems.  Let me know if it's me, please.

One status value for an = contact is showing a real value for positive values and "NotANum" for negative values.
On the left is $CTRIO_000_C1F1.iReg1 and the right is constant 0 (zero).
I set up CTRIO Quad counter with RATE scale, integer.
In the Monitor CTRIO Module window the velocity (.iReg1) indicates correctly with + & - values and goes to zero when stopped.
For my application the contact works because it switches on when zero but what might happen if looking for a number other than zero.

Next observed problem, first rung of a program, not in a stage I have a TMRDOWN connected directly to power. I need to precede it with a contact to EXIT if true, ie. don't do anything if true.  I insert a new rung above and put in the contact & EXIT, then select Accept, it moves the TMRDOWN up and joins with EXIT at the output location and the rung is gone that the timer was on. What's up with that?

Last observance, on a rung that exits I have MOVE, EXIT, and RST at the output.  RST does not execute.  I move EXIT below RST and it now executes.  Is EXIT required to be on the bottom?  Seems like every output should execute if the rung is true.

plcnut

  • Hero Member
  • *****
  • Posts: 815
    • premiersi.com
Re: Designer Software problems?
« Reply #1 on: March 11, 2013, 05:19:37 AM »
I'm still a novice but I think I discovered some problems.  Let me know if it's me, please.

One status value for an = contact is showing a real value for positive values and "NotANum" for negative values.
On the left is $CTRIO_000_C1F1.iReg1 and the right is constant 0 (zero).
I set up CTRIO Quad counter with RATE scale, integer.
In the Monitor CTRIO Module window the velocity (.iReg1) indicates correctly with + & - values and goes to zero when stopped.
For my application the contact works because it switches on when zero but what might happen if looking for a number other than zero.

I don't know...

Next observed problem, first rung of a program, not in a stage I have a TMRDOWN connected directly to power. I need to precede it with a contact to EXIT if true, ie. don't do anything if true.  I insert a new rung above and put in the contact & EXIT, then select Accept, it moves the TMRDOWN up and joins with EXIT at the output location and the rung is gone that the timer was on. What's up with that?

That is because the Do-More is stack based, it must have a contact to compare with. The first rung of every block, stage, or task has already been evaluated as true so you can have one rung at the top with no input logic. If you attempt to add another rung below with no input logic the compiler will tie it to the previous rung because that is how the PLC will scan it. If you need another rung below the first that is always true, then use ST1 (always on). If you go back and look at the traditional PLC with RLL in the days of hand held programers I think it would make a lot more sense.

Last observance, on a rung that exits I have MOVE, EXIT, and RST at the output.  RST does not execute.  I move EXIT below RST and it now executes.  Is EXIT required to be on the bottom?  Seems like every output should execute if the rung is true.

EXIT is executed as soon as it is examined on a true rung, So the program will not execute any code past the exit, even if it is on the same rung. (there are a few other instructions that act the same way, like BREAK and CONTINUE)
Circumstances don't determine who we are, they only reveal it.

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

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6174
  • Yes Pinky, Do-more will control the world!
Re: Designer Software problems?
« Reply #2 on: March 11, 2013, 05:56:50 PM »
One status value for an = contact is showing a real value for positive values and "NotANum" for negative values.
On the left is $CTRIO_000_C1F1.iReg1 and the right is constant 0 (zero).
I set up CTRIO Quad counter with RATE scale, integer.
In the Monitor CTRIO Module window the velocity (.iReg1) indicates correctly with + & - values and goes to zero when stopped.
For my application the contact works because it switches on when zero but what might happen if looking for a number other than zero.

Unlike integers where every value is valid, a 32 bit float can contain a bit pattern that is not a valid number. NotANum is displayed for floating point values that are invalid. This is generally the result of you interpreting an integer as a float. If you were to use fReg1 or fReg2 when you should be using iReg1 or iReg2, that would be the result.

Next observed problem, first rung of a program, not in a stage I have a TMRDOWN connected directly to power. I need to precede it with a contact to EXIT if true, ie. don't do anything if true.  I insert a new rung above and put in the contact & EXIT, then select Accept, it moves the TMRDOWN up and joins with EXIT at the output location and the rung is gone that the timer was on. What's up with that?

Like plcnut said, Do-more (and all DL ontrollers) are stack based...an efficient form of PLC execution. Rungs are used to describe stack-based instructions...which is what we really execute, which are in turn used to regenerate the rung for display. When we redraw, we are showing you what really happens in execution.

Last observance, on a rung that exits I have MOVE, EXIT, and RST at the output.  RST does not execute.  I move EXIT below RST and it now executes.  Is EXIT required to be on the bottom?  Seems like every output should execute if the rung is true.

EXIT immediately bails...much like a return. Don't invoke until you really mean that your done.

"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

ERokc

  • Hero Member
  • *****
  • Posts: 118
Re: Designer Software problems?
« Reply #3 on: March 11, 2013, 07:50:20 PM »
BobO, I did what you said, used fReg1 not iReg1.  fReg1 must come first in the drop down list so I need to pay more attention. Works correctly now.

EXIT goes at the bottom of the output stack, I can remember that.  Is there a way to insert an output between two existing outputs on a rung?  I know I added the RST after the EXIT.  To fix it I had to delete the EXIT and enter it again at the bottom.  Not a big deal but would be nice to insert above an EXIT if possible.

This one I don't understand.  The change that occurs after Accept. I understand showing the execution as it's done by redrawing.  That's good and necessary but why does it change to different logic than what I entered?  Again using $On to fix it is easy if I can remember to watch for it.

My conveyor HOME program works great.  Feels good to get physical parts moving.

I can't figure out how to use the posting "Insert Quote". I fills the reply window with everything posted and is hard to read, delete and segment it.  Maybe I should read the HELP for the FORUM software.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3843
    • Host Engineering
Re: Designer Software problems?
« Reply #4 on: March 11, 2013, 08:44:44 PM »
Is there a way to insert an output between two existing outputs on a rung?  I know I added the RST after the EXIT.  To fix it I had to delete the EXIT and enter it again at the bottom.  Not a big deal but would be nice to insert above an EXIT if possible.
Two ways.  Before that, though, make sure you are in Edit mode (Ctrl+E) or press in the big Edit button on the first toolbar.  Then put the cursor over the EXIT instruction.  Then either:

1. right-click to bring up the context menu for THAT cursor position.  Select the Insert->Row->Above (or Below), and viola!
2. Or, hit the Insert key which brings up a dialog that lets you insert MULTIPLE RUNGS, MULTIPLE COLUMNS, or MULTIPLE ROWS, BEFORE or AFTER the block cursor (or the rung that includes the block cursor)
« Last Edit: March 11, 2013, 08:46:58 PM by franji1 »

plcnut

  • Hero Member
  • *****
  • Posts: 815
    • premiersi.com
Re: Designer Software problems?
« Reply #5 on: March 11, 2013, 09:30:03 PM »
Or go to the instruction above where you want to insert the row, and press the enter key.
Circumstances don't determine who we are, they only reveal it.

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

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6174
  • Yes Pinky, Do-more will control the world!
Re: Designer Software problems?
« Reply #6 on: March 11, 2013, 09:49:59 PM »
This one I don't understand.  The change that occurs after Accept. I understand showing the execution as it's done by redrawing.  That's good and necessary but why does it change to different logic than what I entered?  Again using $On to fix it is easy if I can remember to watch for it.

Let's say you have a rung consisting of a single out coil driving C0. That rung evaluates to a single 'OUT C0' instruction, with no driving logic. An OUT literally means: C0 = current value of the boolean stack. We only allow that at the top of a scope, specifically because at the top of the scope, we set the boolean stack to 'TRUE'. So in the case of the OUT C0, it literally evaluates to:

STR TRUE (implied)
OUT C0

Let's say you then insert a new rung above that is a single contact (X0) driving a single coil (Y0). That generates 'STR X0, OUT Y0'. STR X0 means 'push the value of X0 onto the boolean stack', and OUT Y0 means 'set Y0 to value of the boolean stack'. In practice it means Y0 = X0. But here's the issue: the top of the stack is now not TRUE, it's whatever X0 is.

So, your program with both rungs is now:
STR TRUE (implied)
STR X0
OUT Y0
OUT C0

Which is what we redraw. The logic didn't actually change...but the result did. The simple answer would be to eliminate the implied 'STR TRUE' at the top of scope and force contacts into every rung. The thing is that it is an extremely handy construct, especially in stages, so we really want to keep that. It does cause the issue you've observed, and this is only about the 25th time we've heard this...wish we had a better way of dealing with it. Maybe someday we can consider adding the implied 'STR TRUE' (which would actually be STR $On) any time something is inserted in front of a rung with no contact logic. I'm sure it could be done, just not easily.

Does that help, or have I made it worse? ;)
"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