JSRs from main routine

unsaint32

Member
Join Date
Oct 2012
Location
minneapolis
Posts
365
I looked every manual on JSR. I know what it does, but I don't know why a subroutine is created and not being called by JSR. Doesn't that mean the subroutine is never scanned? If I have a input mapping subroutine and my main routine never calls for it, does the mapped tags still update the inputs?
 
If there is no JSR, then you're correct - the logic in that subroutine will never be executed.

If it's an input mapping subroutine that your question relates to, it might be possible that the JSR was temporarily removed so that you could run the system in a "simulation" type mode, where you could simulate process conditions by toggling bits, without having your input mapping routine overwrite them with the actual process conditions.

But of course, a system can't actually run like that...
 
subroutine is created and not being called by JSR. Doesn't that mean the subroutine is never scanned?

that's PROBABLY correct – but in the RSLogix5000/Studio5000 systems, the subroutine can also be called/executed by using an FOR instruction ... those aren't very commonly used but they ARE available ...

TIP: it's pretty easy to see whether or not a particular subroutine is being executed or not ... put the following unconditional "trap" rung in as a temporary test ...

ADD New_Test_DINT 1 New_Test_DINT ...

if the value of New_Test_DINT stays stuck at the default of 0, then the rung is not being scanned or executed ...

NOTE that if this is not an RSLogix5000/Studio5000 system, then let us know ... there are some other ways available which can be used to scan a subroutine in the RSLogix5 and the RSLogix500 systems ...
 
Last edited:
In Logix 5000 you can right-click on a subroutine and select Cross Reference and it will show where it is being called. Won't help with a Main or Fault routine.

OG
 
Ron Beaufort said:
that's PROBABLY correct – but in the RSLogix5000/Studio5000 systems, the subroutine can also be called/executed by using an FOR instruction ... those aren't very commonly used but they ARE available ...

I should have known there'd be an exception. I can always count on Ron to teach me today's new trick :)
 
Yes, I was using RSLogix5000 for 1756-L63.

After cross-referencing the subroutine (following Operaghost's tip), I saw that the subroutine was being called not by a main routine but another routine that was JSR'd by the main routine. I forgot about the nesting JSRs.

Thank you so much for the education.
 

Similar Topics

I am trying to figure out how ladder programs in the compactlogix/controllogix platforms handle JSRs and general flow, etc. :banghead: If I have...
Replies
20
Views
5,115
The past week we received a new piece of equipment from Germany which utilizes siemens controls. Typically in our company we use A.B. controls for...
Replies
4
Views
40
Hello Everyone- I'm working on a new network deployment of AssetCentre and I am not able to authenticate with the application using our...
Replies
1
Views
400
TLDR: I try to establish the OPC communication between Kepware OPC DA Client to ABB 800xA OPC DA Server. In the Kepware OPC quick client of poll...
Replies
0
Views
851
Main rack contained power supply 140cps52400 and 140cpu43412A and RIO HEAD 140CRP93100 in addition to another I/o cards . Another remote rack...
Replies
8
Views
1,861
Back
Top Bottom