Sign in to follow this  
Followers 0
dougm52

Micrologix 1000 STI questions

8 posts in this topic

Micrologix 1000 fixes STI_INT at program file 5.  I have a a rung that simply does "INT SUS 5".  I have tried other instructions in place of the SUS like toggling an I/O or incrementing a work in N memory.  I call in MAIN_PROG " XIC B3:0/1 STS 5 50 ".  B3:0/1 is set to a 1.  Before the program runs I clear the STI enable, file and interval in S2, S30, S31.  When I run the program in the emulator and view the STI settings they seem OK, ie: the STS call seems to have worked.  Yet I never seem to get the STI interrupt to fire and call STI_INT service routine.

Interestingly enough if I set the STI file to -1, as soon as I run the program it faults with an invalid call on the first rung of MAIN_PROG.  It makes me think that the problem is simply that I am not putting the proper file number in the STI S31 file, ie: it expects something other than the program file number there.

The emulator help docs seems to imply STI is supported.

I must be missing something simple.  Any ideas?

Share this post


Link to post
Share on other sites
4 hours ago, dougm52 said:

It makes me think that the problem is simply that I am not putting the proper file number in the STI S31 file, ie: it expects something other than the program file number there.

If you want ladder 5 to be your "STI" file then S:31 needs to have a value of 5 in it. It defaults to this.

Curious, where(how) did you come up with -1??

Edited by Mickey

Share this post


Link to post
Share on other sites

I tried -1 because it seemed it would be a truly bogus value.  Sure enough the emulator didn't know how to handle it and it crashed.  That told me that at least something looks at the program file number for the RTI.  But what that magic mystery number is at this point is elusive.

I'll retry program 5, but I didn't get 5 to work last time.  It seems like if my RTI_INT program 5 rung has a SUS in it, and it runs 5, I should see an obvious program break there.  How would you test entry to 5?  I've tried incrementing an integer or toggling a bit and nothing happens.

BTW, have you run an STI on the emulator sans hardware?

Edited by dougm52
Add a question.

Share this post


Link to post
Share on other sites
Quote

BTW, have you run an STI on the emulator sans hardware?

No I have not.. see pdf.

You might try running ladder 5 with a "JSR" and see if the program in ladder 5 works,

emulateexception.pdf

Share this post


Link to post
Share on other sites

I JSR to file 5, the STI_INT routine and it works OK.  Using file 5 in the STS command or merely initing the STI to use file 5 in the IDE does not work.  So unless one of the PLC experts on here has used STI from the emulator with success, I'll have to assume STI doesn't work and that fact was not clearly indicated in the docs.

Is there a way to determine if the program is running in the emulator?  A status bit I can read or something?

Share this post


Link to post
Share on other sites
Quote

Is there a way to determine if the program is running in the emulator?  A status bit I can read or something?

The fact that the "JSR" works in the emulator tells you the emulator is running the program.

Share this post


Link to post
Share on other sites

Perhaps the question wasn't clear.  Let's say I find STI isn't supported in the emulator but is in hardware.  Then I could call STI_INT program 5 as a subroutine with JSR in the emulator, but when hardware is present, let the STI call it as an interrupt.   There should be something in the PLC I can query that will be different between emulation and hardware.  I'll study the docs more to see what I can find.

Share this post


Link to post
Share on other sites

Actually, the question is quite clear. See the MicroLogix Instruction RSLogix help -> MicroLogix Instruction Set -> Selectable Timed Interrupts [STI].

It tells us that STI we can use with MicroLogix 1500 processor only. 5 is the number of STI_IN subroutine that S:31 register contains.

BTW  "When you are using the MicroLogix Controller the Selectable Timed Interrupt can only be File #5."

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0