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 November 13th, 2018, 05:21 PM   #1
rscott9399
Member
Norfolk Island

rscott9399 is offline
 
Join Date: Aug 2017
Location: in space
Posts: 86
Trigger a osr or a move from a change of a bit in an int

studio 5000 and compact

i have an int that is a 1 second increment for something

when a change in the int happens regardless of up or down i want a move to take place

any ideas how to do this?

i wanna trigger the rising edge of a bit change to trigger a an osr to a move

any ideas?

Thanks
  Reply With Quote
Old November 13th, 2018, 05:53 PM   #2
A_G
Member
United States

A_G is offline
 
Join Date: Jul 2014
Location: MA
Posts: 132
I've never used the OSR instruction. I usually use the ONS. This triggers when the rung conditions before it are true. Check out the instruction help for the ONS, they should have examples.

If you are trying to detect a change in the Int, you probably need to create two "temporary" Int tags, one for the current value of the Int and one for the previous value of the Int. Then check if they are equal (EQU instruction). If not equal, then trigger your move.

Hope this helps.
  Reply With Quote
Old November 13th, 2018, 08:18 PM   #3
thingstodo
Member
Canada

thingstodo is offline
 
Join Date: Feb 2012
Location: Saskatoon
Posts: 248
Quote:
Originally Posted by rscott9399 View Post
studio 5000 and compact

i have an int that is a 1 second increment for something

when a change in the int happens regardless of up or down i want a move to take place

any ideas how to do this?

i wanna trigger the rising edge of a bit change to trigger a an osr to a move

any ideas?

Thanks
No big deal. I do stuff like this ... a lot.

Type in the rung this way, use your own names for the integers and bits..

INT_CHANGING is your integer that changes each second
INT_LAST is the value of INT_CHANGING last PLC scan
BOOL_TRIGGER is the output of the OSR that you examine in the rest of your program
BOOL_STORAGE is the internal storage for the OSR
INT_STORAGE is where you move INT_CHANGING to when it changes

Sorry for old school, but I'm not near my programming machine so I can't type it in and do a screen capture.

Code:
NEQ INT_CHANGING INT_LAST OSR BOOL_TRIGGER BOOL_STORAGE

XIC BOOL_TRIGGER MOV INT_CHANGING INT_STORAGE

MOV INT_CHANGING INT_LAST
You can also do this with an ONS and all on one rung. If you just want to do the MOV and don't need the bit to trigger anything else in the program

Code:
BST NEQ INT_CHANGING INT_LAST ONS BOOL_STORAGE MOV INT_CHANGING  INT_STORAGE NXB MOV INT_CHANGING INT_LAST BND
  Reply With Quote
Old November 13th, 2018, 08:23 PM   #4
OkiePC
Lifetime Supporting Member
United States

OkiePC is offline
 
OkiePC's Avatar
 
Join Date: Mar 2005
Location: ENE of Nowhere Oklahoma
Posts: 9,983
I can't remember if the DTR instruction exists in Logix 5000, but if not, then follow the advice of A_G and use NEQ followed by MOV where the source B in both instructions is your "last scan copy" of the data you want to detect a change in. The DTR (Data Transition) instruction does the same thing, but packs the NEQ and MOV into the same instruction. It is the only instruction I know of that is destructive but also has a rung out condition so that it must precede other instructions on a rung. I recall the DTR instruction in the PLC-5 so it may or may not have been included with RSLogix 5k.
__________________
It's not all the variables I am most concerned with, it's the undiscovered constants.
  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
PanelView Plus 7 Screen Change = Bit change? _Dock_ LIVE PLC Questions And Answers 3 October 13th, 2015 05:55 PM
Fanuc 90/30 HMI programming CalG LIVE PLC Questions And Answers 128 February 27th, 2013 01:11 AM
Siemens Addressing Fun james-0000 LIVE PLC Questions And Answers 4 August 9th, 2008 12:58 AM
Ideas needed for Siemens S7 program tesalmin LIVE PLC Questions And Answers 12 March 4th, 2004 01:40 PM
Alarm Code mwatkins LIVE PLC Questions And Answers 25 January 15th, 2003 04:43 PM


All times are GMT -5. The time now is 10:25 AM.


.