RS-Logix 20.01 - Indirect parameter copy

Jeebs

Member
Join Date
Feb 2007
Location
Leuven
Posts
1,059
Hi,

Got an interesting one.
Have an array of parameter UDT's for different products. Product change is done on PV. New product is selected, writes value between 1 and 9 in variable, changeover button starts procedure. At certain point, right between old and new product, parameter change is done. Current parameters are stored and new parameters are loaded. Check if new product selection is between 1 and 9 before copying. Happened a few times now that the old values are stored and the working table is cleared (zeroed) without loading new values.
There is no clear/reset/delete programmed for the table, it just copies the new values into the table. None of the UDT's have zero values. So I'm wondering how the working table can get zeroed out?
 
You probably have an COP overlap somewhere, and the bits get written over by some overflow. Can happen with incorrect lengths in a COP instruction.
 
You didn't mention if "Working Table" UDTag is embedded within another UDTag.


If they are, it is entirely possible for another COP, CPS, or FLL to trample over your UDTags if their length specification is wrong.


For all of the COP, CPS, and FLL instructions, the Length should be programmed as the number of elements of the destination tag. The instructions look up the data-types of the destinations, and calculate the number of bytes to copy (or fill).


The Copy (or Fill) starts, and copies that number of bytes from source to destination.


Now if the end of the destination Tag is reached, the Copy or Fill will terminate with no errors.



But : if the embedded UDTag you are copying into is not the end of the destination Tag (i.e. it is a nested UDTag), the copy or fill will continue copying bytes into uncharted territory, until either the number of bytes is copied, or the end of the destination Tag is reached.
 

Similar Topics

Hello, I'm very new to programming with absolutely zero schooling in this field and pretty hands off training in my new role, it's been fun...
Replies
4
Views
662
Hey everyone, Just used the PLC5/Logix migration utility to convert a program, and while addressing the PCEs, I noticed a lot of errors for "XIC...
Replies
12
Views
1,943
Hi there I'm currently converting an RSLogix500 program that I wrote 20 years ago into RSLogix5000 for an SLC to CompactLogix upgrade. The...
Replies
3
Views
2,181
I’m working with indirect addressing and trying to make an HMI where each Rectangle Object has a tag of “A[0-127]” with a correlating Push Button...
Replies
15
Views
4,185
I am confused. I am using indirect addressing to copy from one point to another based on an integer file but I got one Copy instruction that...
Replies
4
Views
2,179
Back
Top Bottom