RSLOGIX 500 using SBR for calclualtions

Tformhal

Member
Join Date
Sep 2006
Location
IL
Posts
7
I am wanting to use a subroutine to do data calculations to separate and combine 32bit and 16 bit words. I am doing this to move data to and from an HMI. The calculations I got from AMCI. then I use a label and jump instructions to move each data set in and out. Is there a better way to do this? I am sure that there is. I have attached the calculation subroutine below.
 
unless you made a typo in your title, the bad news is that you can't get there from here ...

in other words, the RSLogix 500 software can NOT use the SBR instruction for "passing parameters" ... the RSLogix 5 and the RSLogix 5000 software CAN do this type of operation - but they are used with bigger processor systems ...

it sounds like you're wanting use a JSR (Jump to Subroutine) instruction - along with the SBR (Subroutine) and the RET (Return) instructions to "pass parameters" to and from a subroutine (ladder) file ... you can't do that with RSLogix 500 software ... in simpler terms, the SBR instruction is just basically for "window dressing" ... it performs no useful function ...

I didn't take a look at the code that you posted ... try zipping and posting the .RSS file next time ... that makes it a lot easier for the forum to help you ...

good luck with your project ...
 
Last edited:
unless you made a typo in your title, the bad news is that you can't get there from here ...

in other words, the RSLogix 500 software can NOT use the SBR instruction for "passing parameters" ... the RSLogix 5 and the RSLogix 5000 software CAN do this type of operation - but they are used with bigger processor systems ...

it sounds like you're wanting use a JSR (Jump to Subroutine) instruction - along with the SBR (Subroutine) and the RET (Return) instructions to "pass parameters" to and from a subroutine (ladder) file ... you can't do that with RSLogix 500 software ... in simpler terms, the SBR instruction is just basically for "window dressing" ... it performs no useful function ...

I didn't take a look at the code that you posted ... try zipping and posting the .RSS file next time ... that makes it a lot easier for the forum to help you ...

good luck with your project ...

I wanted to export just the single ladder file that contains the math instructions. I can copy and paste it into a new rss file tomorrow. I don't have the software at home to do it. Basically what it consists of is 6 rungs of math instructions followed by MOV and COP instructions then a JMP instruction that jumps to the top of the math instructions does the math adds 1 to the step count copies the computed data to another location and then does the next set of data until the routine is finished. It is easier to show you in the logic than it is for me to explain it. My question is will it work the way I have it programmed. (I think that it will). Secondly is there a better way to do the same thing without being able to pass parameters.
 
When I need a subroutine that needs parameters I just set some variables (that are set aside for the subroutine) then execute the JSR that will perform the calculation. Then the subroutine would set some other variable as the output. Then copy that output to where you need to use it.
 
When I need a subroutine that needs parameters I just set some variables (that are set aside for the subroutine) then execute the JSR that will perform the calculation. Then the subroutine would set some other variable as the output. Then copy that output to where you need to use it.

I think this is similar to what my file should do. I haven't been able to test it yet. Hopefully by the end of the week I can test it.
 
I am wanting to use a subroutine to do data calculations to separate and combine 32bit and 16 bit words. I am doing this to move data to and from an HMI. The calculations I got from AMCI. then I use a label and jump instructions to move each data set in and out. Is there a better way to do this? I am sure that there is. I have attached the calculation subroutine below.

Just a thought, instead of trying to control what the HMI sees, why not just let the HMI read the tag data and massage the data in the HMI?
 
Just a thought, instead of trying to control what the HMI sees, why not just let the HMI read the tag data and massage the data in the HMI?

I'm not sure I understand what you are saying. Some of the data coming from the HMI is 32 bit and has to be split into two 16 bit words to be used by and AMCI 3102 stepper module.
 
I'm not sure I understand what you are saying. Some of the data coming from the HMI is 32 bit and has to be split into two 16 bit words to be used by and AMCI 3102 stepper module.

From the way your original thread is phrased, I understood you were wanting to use a subroutine in the PLC program to specifically manipulate tag data before moving it to an HMI. I was merely suggesting to manipulate the data in the HMI program.
 

Similar Topics

Hey everyone, i have a very very stupid stupid question. How do i change the IP address on Micrologix 1400 using Rslogix 500. i know how to do...
Replies
2
Views
3,868
1.the black switch is master start/stop switch 2. When red pushbutton is pressed once, both motor 1 and 2 should run continuously 3.if you close...
Replies
3
Views
1,755
Hello My name is Harry and i am fixing some program for a client. He has Micrologix 1100 controller and i am using RSLogix 500. I do not have...
Replies
5
Views
2,375
Hello, I am having some problems and I am wondering if I can get some guidance. I will explain the process I am trying to achieve. I am trying to...
Replies
4
Views
4,107
Please can anyone help me out?I have a mocrologix 1200 1762-L24BXB,a RS232(1761-CBL-PM02)cable and just installed RS Logix 500 on my pc.Please how...
Replies
25
Views
12,587
Back
Top Bottom