Logix 500 Int file overwrites itself

morphesc

Member
Join Date
Mar 2015
Location
Ontario
Posts
4
Hi all,

I am an instrumentation student working on a PLC project and have come across a problem I can find no information on.

I am writing a program and HMI using RS Logix 500 and RS Factorytalk Studio to control the level in a water tank by manipulating a valve on the inflow of the tank. The program is run through a SLC 5/04 processor with one analog input and one analog output communicating with a differential pressure transmitter and an I/P transducer respectively.

I have a section of code in a tank level program that writes a user input set point value to a float memory location (F8:1) from the HMI program (RS Factorytalk Studio). This value is them moved to an integer file (N7:1) to then me read by a PID block. These are the only times the file N7:1 is ever referenced in the program.

The problem is that when I input a set point value the float file holds the value (0 - 100 scaled) and passes it to the integer file, the integer file holds the value for one loop and then rewrites it to -32676. This saturated my PID block and means my valve remains fully open.

The problem persists when directly writing values to both float and integer files in Logix 500, even after bypassing the HMI program.

Both myself and my professor are both at a loss...

Please help...

Thanks
 
Can you post the SLC's .RSS file? Zip it first.

Are you sure nothing else is writing to F8:1?
 
Last edited:
Welcome to the forum!

If you can post your code we can probably be of more help - otherwise we're just speculating. You'll have to zip it first.

But just because who doesn't like a bit of blind speculation:

Check that you don't have a COP instruction or similar writing to multiple registers. E.g. if I insert a COP instruction and copy N20:0 to N7:0 with a length of 10, N20:0 gets copied to N7:0, N20:1 gets copied to N7:1, N20:2 gets copied to N7:2, .... .... .... and N20:9 gets copied to N7:9. So all of N7:0 through N7:9 is affected, but only N7:0 will show up in a search or cross reference because it's the only one being directly referenced.

There could also be indirect addressing somewhere doing the same thing, e.g. MOV -32767 to N7:[N20:0]. If N20:0 = 0, then it will move -32767 to N7:0, but again, as N7:0 is not explicitly referenced it won't show up in a search.

Check also how you're moving your data around in general - in particular when converting Ints (N7) to Floats (F8), as an N register has 16 bits and a F register has 32. A MOV instruction moves the actual value and converts the data type automatically, but a COP (copy) just literally copies the bit structure. So not only will you get scrambled data, but it can also overrun into other registers.

If something else in your code is overwriting it, try replacing N7:1 with a different integer. To play it really safe, create a whole new N register, e.g. N20. Then you know for 100% certain it's not being played with anywhere else.

Good luck!
 
If your control block starts at N7:0 then the setpoint integer is N7:2 not N7:1
N7:1 is the PID Sub Error Code (MSB),so if you are writing to N7:1 then it is getting overwritten by the system.

Steve
 
RSS File Upload

Thanks for the quick replies to my problem. Here is a copy of my program, there is one reset issue I am aware of but needs to be fixed, I am going to take care of that shortly. It only deals with the Binary variables though, so shouldn't be affecting the Int files.

Also I guess I was mistyping, It is N7:01, not N7:10. I left N7:10 alone because I know the PID block uses it.

Again thanks for any help you can offer.
 
Your PID Control block is 23 words starting at N7:1.

That would put N7:2 as the PID Sub Error code just as nehpets said.
Try using a whole new data file for your control block, or expanding the size of the N7 file. You have a 64K SLC, so you could add fifty more integer files of max size (256 words) and not put a dent in the free memory available.
 
Alright, I see what the problem is now.

So if I just changed my addressing to say N7:30 I should be fine?

Thanks again
 
Alright, I see what the problem is now.

So if I just changed my addressing to say N7:30 I should be fine?

Thanks again


If you change the "Control Block" to N7:30 then your setpoint would be N7:32. ( third word of the control block, word 2)
 
Thanks Mickey,

I meant change the addressing of my integer data holding files where I am storing the values for PV, SP, and Co outside of the PhD block. I am leaving the control block as N7:1.

Thus my PID block appears as:

Control Block: N7:1
PV: N7:30
CV: N7:32
Control Block Length: 23

I am working on the program right now but do not have access to the actual equipment or Plc so I will need to test this fix tomorrow (or hopefully later this afternoon)
 
Leave your setpoint integers as they are, change the pid control word to N7:30 then move your setpoint data etc into the appropriate word in your control block (ie if your setpoint is in N7:1 move it into N7:32 when required).

Steve
 
Thanks Mickey,

I meant change the addressing of my integer data holding files where I am storing the values for PV, SP, and Co outside of the PhD block. I am leaving the control block as N7:1.

Thus my PID block appears as:

Control Block: N7:1
PV: N7:30
CV: N7:32
Control Block Length: 23

I am working on the program right now but do not have access to the actual equipment or Plc so I will need to test this fix tomorrow (or hopefully later this afternoon)


If you do the above then your setpoint register is N7:3.
 

Similar Topics

Will someone please convert this logic to pdf?
Replies
2
Views
127
Hi my problem may have a simple solution but i cant work it out. I need to use the Divide function but it wont let me use a decimal point in...
Replies
3
Views
1,738
Can someone give me a printout of this file? Could not find the standing thread for this...
Replies
1
Views
1,402
good morning. I am currently updating a machine that was built a bazillion yrs ago with an SLC 5/04. It wasn't bad enough to find that the company...
Replies
3
Views
2,211
Hello all, I’m writing code in RsLogix 500 for a lift station pump control of two pumps, I will be using a PV + 700 as A HMI interface. I have a...
Replies
3
Views
3,417
Back
Top Bottom