A-B SLC Nested File Ref -- getting 'Invalid Direct File Offset'

RobYager

Member
Join Date
Jun 2007
Location
Bristol TN
Posts
2
Hey all, I'm trying to re-write a program and would like to nest my source file:
((N18:99 * 10)+4).....word location
Need to have N18:((N18:99 * 10)+4) to reference the specific location of information, but I'm getting an 'ERROR: Invalid Direct File Offset'.

Can anyone lend a hand?

Thanks in advance for the help.
:oops:
 
Hey all, I'm trying to re-write a program and would like to nest my source file:
((N18:99 * 10)+4).....word location
Need to have N18: ((N18:99 * 10)+4) to reference the specific location of information, but I'm getting an 'ERROR: Invalid Direct File Offset'.

Can anyone lend a hand?

Thanks in advance for the help.
:oops:


Do you mean that you want N18:[ (N18:99*10)+4)] ?


First off, use brackets to indicate indirect addessng.
Second, the control logix can resolve an expression for an address at run time, but the SLC cannot. Use either MUL and ADD instrucitons or a CPT instruction ahead of the indirect addressing.

eg
MUL N18:99 10 N7:XX
ADD N7:XX 4 N7:XX
Then use N18:[N7:xx] as your indirect address.
 
I was just pondering going down that road. I was just trying to NOT do 36 rungs, but I should be able to do this in 4 rungs. Thanks.

NOTE: N18:[(N18:99 * 10) + 4)] still gives an ERROR CODE.
 
Re-read the response above.

SLC-500 controllers cannot resolve expressions in between the square brackets. (N18:99 -10) * 4 is an expression.

You only need to add two rungs:

SUB N18:99 10 N18:100
MUL N18:100 4 N18:101

Then you can reference [N18:101] and it will point to the value of "N18:99 - 10 * 4".
 
If you are moving four consecutive words you can do it in even less. This rung will verify. It shows how one might have ten sets or ten recipes of four parameters. Notice that the indirect address is first computed and then saved in an integer location. Then that location is used for the indirect address.


If recipe #3 were chosen, ie N18:99 = 3, then the value of 31 is stored at N18:101. N18:[N18:101] then resolves to N18:31. When the COP instruction is executed N18:31 is copied to N10:1, N18:32 is copied to N10:2, N18:33 is copied to N 10:3 and N18:34 is copied to N10:4

Note that N18:99 is range checked before the rung can be executed - indexing past the end of a file can cause a fault.

One last thing for your consideration: If Bubba on the night shift does not understand indirect addressing, and this is a part of the program that he in any conceivable way might want to access or understand, then expect a 3:00 am phone call. At 3:00 AM that few minutes of programming saved by doing 4 rungs instead of 36 will seem very unimportant (not to mention that resolving this problem has already squandered any time savings). Even though I would personally still use indirect addressing (our Bubba is smart) you should consider the future audience. Either way, be sure to document it very well.


BTW Rob, welcome to the forum.

A080309a.JPG
 
Last edited:

Similar Topics

I’m attempting to send a temperature from a SLC-5/02 to an EZiMarquee display. The vendor said to use a MSG instruction to send the data to the...
Replies
1
Views
81
Hello all. I have a few SLCs in my plant and of late we've seen a weird issue: The system will be running normally and then randomly the outputs...
Replies
2
Views
92
I am working on setting up a Prosoft Datalogger model PLX51-DLplus-232. This unit will be collecting data from a SLC 5/05 on the DB9 port set to...
Replies
3
Views
97
I have a redundant ControlLogix being set up. This program reads a value from a remote site which happens to be SLC PLC. Rockwell mentions SLC...
Replies
2
Views
94
Hello, I have a ControlLogix redundant controller being set up. The program reads a value from a remote site which hosts a SLC PLC. Rockwell...
Replies
0
Views
76
Back
Top Bottom