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

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old July 15th, 2018, 10:04 PM   #1
blackhd1
Member
United States

blackhd1 is offline
 
Join Date: Jul 2018
Location: Vancouver, Wa
Posts: 5
Same output adderess

I have a ladder with a mov and sub function block paralleled (see attached) with the same output address. Conflict?
Attached Images
File Type: png same addresses.PNG (41.5 KB, 78 views)
  Reply With Quote
Old July 15th, 2018, 10:08 PM   #2
rdrast
Lifetime Supporting Member
United States

rdrast is offline
 
rdrast's Avatar
 
Join Date: Apr 2003
Location: South Carolina Lowcountry
Posts: 5,200
The first move is only clearing it, so has essentially no effect. The subtraction is dominant, and will always be executed with it's operands.
__________________
------------------------------------
How to ask questions the SMART Way!

Look First, Ask Second!

  Reply With Quote
Old July 15th, 2018, 10:16 PM   #3
Bullzi
Lifetime Supporting Member
United States

Bullzi is offline
 
Join Date: Jun 2012
Location: Colorado
Posts: 1,264
Depends on what you are trying to do. When SM0.0 is true the MOV will move a 0 into the VD264 register essentially clearing it. Then the next line will do the subtraction and store it into VD264. So depending on how you need this to work it may be the same as hitting CLEAR on the calculator before doing any math.
__________________
There is never enough money to do it right but there is always enough money to do it again.
  Reply With Quote
Old July 15th, 2018, 10:36 PM   #4
blackhd1
Member
United States

blackhd1 is offline
 
Join Date: Jul 2018
Location: Vancouver, Wa
Posts: 5
But doesn't both Function blocks operate simultaneously? both come of SM0.0 together.
  Reply With Quote
Old July 15th, 2018, 10:45 PM   #5
Bullzi
Lifetime Supporting Member
United States

Bullzi is offline
 
Join Date: Jun 2012
Location: Colorado
Posts: 1,264
No the order of operation is left to right and up to down. So the mov happens first then the next line down executes and so on.
__________________
There is never enough money to do it right but there is always enough money to do it again.
  Reply With Quote
Old July 15th, 2018, 11:11 PM   #6
blackhd1
Member
United States

blackhd1 is offline
 
Join Date: Jul 2018
Location: Vancouver, Wa
Posts: 5
Ok thank you
  Reply With Quote
Old Yesterday, 08:04 AM   #7
boneless
Lifetime Supporting Member + Moderator
United States

boneless is offline
 
Join Date: Feb 2008
Location: OKC
Posts: 1,429
No conflict, but bad practice.



And as mentioned, the first network will have absolutely no influence.
  Reply With Quote
Old Yesterday, 08:42 AM   #8
BryanG
Member
United Kingdom

BryanG is offline
 
Join Date: Feb 2005
Location: Manchester
Posts: 1,235
This is Siemens MicroWin by the looks of it. SM0.0 is an 'Always On' bit so the rungs will always run, in MicroWin you always have to have contact between the main rung and functions which is why the SM0.0 is there. As has been said it is always the last write to a variable that will carry over to the next scan. The only way that the SUB_DI would fail to write to the variable is if the INC_DW failed for some reason, though I don't know of any reason that it could. At the moment the routine won't compile because the INC_DW has no references on its In and Out.

Not sure why referencing a variable more than once is thought to be bad practice, though I never claim to be an expert programmer. I often use one temporary variable to store intermediate values, it saves on memory but admittedly makes diagnostics harder. Perhaps now we have a lot of memory to play with it makes more sense to use separate locations.
__________________
Knowledge is power, share the knowledge.
  Reply With Quote
Old Yesterday, 08:50 AM   #9
Bullzi
Lifetime Supporting Member
United States

Bullzi is offline
 
Join Date: Jun 2012
Location: Colorado
Posts: 1,264
Quote:
This is Siemens MicroWin by the looks of it. SM0.0 is an 'Always On' bit so the rungs will always run
Yea that could cause you a problem unless you want to do the subtraction every scan. IF that is so then why have SM0.0 in the rung at all?
__________________
There is never enough money to do it right but there is always enough money to do it again.
  Reply With Quote
Old Yesterday, 08:58 AM   #10
boneless
Lifetime Supporting Member + Moderator
United States

boneless is offline
 
Join Date: Feb 2008
Location: OKC
Posts: 1,429
Quote:
Originally Posted by BryanG View Post
...

Not sure why referencing a variable more than once is thought to be bad practice, though I never claim to be an expert programmer. I often use one temporary variable to store intermediate values, it saves on memory but admittedly makes diagnostics harder. Perhaps now we have a lot of memory to play with it makes more sense to use separate locations.

Not familiar with the software package here, but I assumed from the title that this was an output tag .
  Reply With Quote
Old Yesterday, 09:07 AM   #11
BryanG
Member
United Kingdom

BryanG is offline
 
Join Date: Feb 2005
Location: Manchester
Posts: 1,235
Quote:
IF that is so then why have SM0.0 in the rung at all?
It is a Microwin thing that you can't have some things direct connected to the left hand side common, so if you always want the following code to run you use an SM0.0 contact.

Did check why INC_DW might fail to set ENO and from the manual:

Error conditions that set ENO = 0:
SM1.1 (overflow)
0006 (indirect address)
__________________
Knowledge is power, share the knowledge.
  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
Mitsubishi Q68DAIN Analog output mystery, Help! sugarcane LIVE PLC Questions And Answers 2 January 21st, 2013 08:03 AM
Connecting Tone Selector to 24VDC source output module ndecks LIVE PLC Questions And Answers 1 April 28th, 2009 10:34 AM
how can i solve this analg output problem ?? magdyfayad LIVE PLC Questions And Answers 31 August 10th, 2008 08:46 AM
Relay Output Module vs. AC Output Module smohamed LIVE PLC Questions And Answers 10 March 18th, 2008 11:52 PM
Encoder output types Orn Jonsson LIVE PLC Questions And Answers 10 May 9th, 2007 04:25 PM


All times are GMT -5. The time now is 02:15 PM.


.