How to Make an Integer File Non Retentive In Plc 5

The Plc Kid

Member
Join Date
Feb 2009
Location
Macon, Georgia
Posts
3,233
I have a few calcs where we are taking F70:35 MUL by source of 10.0 then destination of N300:3 and N300:3 is displayed on the hmi. When we have a zero value in F70:35 then N300:3 remains at its last number. I can change the number in N300:3 and it will retain it soit seems to be retentive somehow. But it should be going back to zero because the instruction to mul F7:35 which has a zero in it times 10 the destination to N300:3 shoulb be zero but it remains at the last number that i punched into N300:3 ?
 
Post your code, it should not retain its value. Zero is a valid number.

Edit: Take note peoplehouse, I just ask for a .RSP file.
 
Last edited:
As far as I know, if the instruction is executing than 0 should be moving into N300:3.

If there anything that is preventing / enabling the MUL instruction? DO you have anything indirectly addressed?

If the program is small enough and you feel like posting it, I can take a quick look.
 
Management will not let us post code but nothing is writing to it because i cn type a value into n300:3 and my value stays. All the r/w boxes are checked in each class in the data file properties.
 
What I was wondering if there are any conditions that must be fulfilled in order for the MUL instructions to execute (rung condition to be true)?

When you get a 0, is that particular LAD file still being called and executing?
 
Also look in the HMI. Not sure what HMI you have, but there might be a condition on that display block.

Sorry, I just reread the original question and this is not what is being asked. It isn't the display, but the integer not changing. please ignore my comments.
 
Last edited:
I know this does not fix or address your problem in any way, but....

At the beginning of the ladder you could MOV a 0 into the integer every scan.

Each time the MUL executes further down in the logic, it will re-populate the correct value.

But if the MUL fails to execute or it just doesn't like the 0, at least it is displaying correctly.

Kind of like re-declaring a variable everytime a loop runs.
 
Could it be an issue with doing a floating point multiplication with an integer as the destination?

Try doing all the math in floating point and move the result to the integer register for screen display.
 
I'm wondering if it is a quirk of the instruction--does the PLC5 allow a zero as source A? The fact that it doesn't update the destination when Source A is zero seems to indicate something along those lines...
 
Management will not let us post code but nothing is writing to it because i cn type a value into n300:3 and my value stays. All the r/w boxes are checked in each class in the data file properties.

Then generate an example, that does the same thing, but cut out all the other code. Or do it from a PC that 'management' does not regulate.

Posting code here will not 'steal' any company secrets.
 
What you are describing is not a case of retentive data. It is a case of an instruction not executing. Is there anything leading the instruction that would be preventing the instruction from operating?
 
I totally concur with everyone who has said that the rung with the MUL on it is not getting executed, or there is a condition on the rung which makes it false.

You say that when your F70:35 is zero, and you type a number into the destination address N300:3, it stays there.

That tells me that the MUL is not writing to it, so the rung is either false, or it is not being scanned.

If we assume that the MUL rung has Logic Continuity (i.e. it evaluates as true), then here's some other things to look for.....

Is it in a subroutine that stops being called when your F70:35 is zero? (the subroutine code will not be scanned)

Is it in a subroutine that has (above it) a RET instruction that gets enabled when your F70:35 is zero? (anything after a true RET will not get scanned)

Is it in a subroutine that has (above it) a TND instruction that gets enabled when your F70:35 is zero? (anything after a true TND will not get scanned)

Is the rung skipped by a JMP instruction when your F70:35 is zero?

Is the rung inside an MCR zone that is activated when your F70:35 is zero?


In PLC5 there are no restrictions on data-types in the math instructions.

Yes, you can have 0 as Source A (either an address or a literal).
Yes, you can have 0 as Source B (either an address or a literal).
Yes, you can mix data-types (eg. float and integer) in any of the Source or Destination fields. The processor performs the maths at the highest level of the data-types, then (if it needs to) converts the result for storage into the destination.
 

Similar Topics

Ex If I Read from Integer file N7:0 N7:0 is an 8 point input card , input 0 and 2 are on , rest off When I look at : N7:0 -7 6 5 4 3 2 1 0 I...
Replies
5
Views
745
I'm in the process upgrading and rss project and going through the program adding descriptions to the operation I've come across an integer file...
Replies
7
Views
2,609
Hey guys, I have to get my Compact Logix L32E to message between a ScadaFlex module via SLC 500 peer to peer protocol. Since the SLC 500 is using...
Replies
2
Views
1,373
I am trying to understand this MOV instruction address. N[N7:29]:19. In N7:29 mapped to 19 or vise versa?
Replies
3
Views
1,795
Hi all, I have an application where the plant PLC is communicating via Ethernet/IP to 3 different field PLC's. The Field PLC's are all Micrologix...
Replies
6
Views
3,415
Back
Top Bottom