Trigger a osr or a move from a change of a bit in an int

rscott9399

Member
Join Date
Aug 2017
Location
in space
Posts
114
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
 
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.
 
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
 
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.
 

Similar Topics

Hi i would like to ask! Im using Omron CP1E PLC May i know how to use one input to trigger two outputs alternatively? Meaning press X0 on, Y0...
Replies
11
Views
355
Hi all, I use e won for my OPCUA to back up my PLC (B&R X20 system) data. Whenever e won does maintenance updates, I need to reboot the e won in...
Replies
2
Views
455
Hello ladies and gents I’ve hit a road block on a project, it’s AB for preface this is a converting line including Winder tailsealer and...
Replies
4
Views
744
Hi, I'm using CX Programmer and just seeing what the best way to trigger an output from the plc clock time would be. I need this to come on at 9am...
Replies
4
Views
1,699
I am trying to have my Alarm Summary page open when an alarm goes active (I am using ALMD blocks) this is the expression I am trying to use...
Replies
5
Views
1,187
Back
Top Bottom