COP Function not copying the data RSLogix 5000

dbanks

Member
Join Date
Nov 2017
Location
Tucson
Posts
9
A rung is set up that goes something like this:
If sysMessage > 46 ONS---> Cop SysDisp_message
Destination: DatabaseMessageHold
Watching it in real time, whenever the read number is above 46, everything works around it, but it doesn't update databasemessagehold to show the value.
What am I doing wrong here?
 
Welcome to the PLCTalk Forum community !

The one-shot (ONS) instruction means that the preceding conditional instructions must go from FALSE to TRUE.

Because the preceding instructin is a GRT, the value of sysMessage must go from [45 or lower] to [46 or greater] every time you want the COP instruction to execute.

So if it changes from 45 to 47 to 50 to 55, it will only execute once.

What is the ONS intended to do ?
 
Welcome to the PLCTalk Forum community !

The one-shot (ONS) instruction means that the preceding conditional instructions must go from FALSE to TRUE.

Because the preceding instructin is a GRT, the value of sysMessage must go from [45 or lower] to [46 or greater] every time you want the COP instruction to execute.

So if it changes from 45 to 47 to 50 to 55, it will only execute once.

What is the ONS intended to do ?

I took out the oneshot, to see how it reacted, and I'll get back to you on that.
The oneshot is supposed to take an error message on a screen in a warehouse, and put it somewhere that can then be submitted into a database. That has to happen before the error message turns into a "door open" when someone intends to fix the machine.

Based on your definition, it should work though. Without the ONS in there, The destination was receiving the error messages it is supposed to.
Thanks for the response!
 
I would do something like:

IF ( sysMessage > 46 AND sysMessage != sysMessageLast ) -->
ONS -->
( COP SysDisp_message Destination: DatabaseMessageHold )
+
( MOV sysMessage TO sysMessageLast)

Not exact syntax mind you. This way anytime the number changes and is above 46 you send a copy. You could also just clear sysMessage depending on if that will keep being set for the same error.
 
I would do something like:

IF ( sysMessage > 46 AND sysMessage != sysMessageLast ) -->
ONS -->
( COP SysDisp_message Destination: DatabaseMessageHold )
+
( MOV sysMessage TO sysMessageLast)

Not exact syntax mind you. This way anytime the number changes and is above 46 you send a copy. You could also just clear sysMessage depending on if that will keep being set for the same error.

That's a killer route to take. I'll follow that if what I'm working with currently ceases to perform well.
I simply just deleted the ONS. haha So far I haven't had a door interference, and it's caught every error, and it's length thoroughly.

Thank you for your answer! I'll definitely keep this option in mind.
 

Similar Topics

Am I losing it? Is it not possible to COP a UDT to another UDT in a function block routine? PLEASE HELP!
Replies
4
Views
1,514
Hello all. I have been working with an SLC 5/04 system, which houses various Digital and Analog INs and OUTs, up to Slot 29. I am currently...
Replies
3
Views
2,477
Hello, I need to copy values from one location to another. example N10:0 (N10:1, N10:2...etc) to N10:10 COPY to N11:0 (N11:1, N11:2...etc) to...
Replies
6
Views
4,654
Hello, I need to copy values from one location to another. example N10:0 (N10:1, N10:2...etc) to N10:10 COPY to N11:0 (N11:1, N11:2...etc) to...
Replies
0
Views
2,572
Hello all. I have a Danfoss VLT feeding an INT into my CpLX program. I need to concatenate the MSB and LSB for position. I used a COP, making sure...
Replies
10
Views
567
Back
Top Bottom