Indirect Addressing Issue

monet man

Member
Join Date
Sep 2011
Location
Michigan
Posts
20
Hi all, I'm having an issue with indirect addressing. I haven't used indirect addressing all too extensively, or with this level of complexity.

I have attached a rung of code which gives a good indicator of the issue that I'm having. In short, from a PanelView, I want to select recipe(1-12), loop (1-12), and segment (1-10) using pushbuttons. After selecting recipe and loop, I want to be able to enter integers corresponding to hi/low/and setpoint data. After selecting recipe, loop, and segment, I want to enter other integer data, such as time and setpoint. Once the data for one of the above scenarios is entered, a momentary "Save" pushbutton is supposed to MOV this data from temporary registers to the correctly indexed registers of the recipe data structure. I have included a rung of logic, and screenshots of my custom data types. Any help is VASTLY appreciated!

My_Logic.jpg data_types.jpg tags.jpg
 
Well, thanks for the quick reply, but what other info do you need? I have the processor in run mode, and I can see integers going into the top of the MOV instruction, they just wont copy into the address that I am trying to send them to.

i.e. I enter 180 (minutes) via panelview, hit save, and see 180 appear into the top of my MOV instruction. The 180 just isn't making it into RECIPE_EDIT_TEMP[1].LOOPS[3].SEGMENT[3].SEG_TIME
 
I havent openned you program - busy at he moment
- You may need to have a ONS or conditional MOV or COP statement.
As once you have finished it may be clearing the value.
 
There's nothing obvious wrong with the code.

One thing that comes to mind - are you actually calling the routine ... ?

Another that comes to mind is that you should use DINTs whenever possible, and especially for your "xxx_SELECTED" tags. Performance is increased because the processor is a 32-bit machine, and converts SINTs and INTs to DINTs to use the value, which of course slows things down.
 
Last edited:
Ok, my head is hanging in shame, and the best quote that can summarize my thoughts right about now come from the great Homer Simpson.."DOH!"

Indeed it is true that if you construct a subroutine, you must CALL the subroutine or it will not execute. The sad thing is that this HAS gotten me before...maybe getting burned twice has some benefit?? It answer can be elusive though, because your routine will reflect updated data table/tag values, its just your logic within the subroutine that doesn't execute. Anyhow, it still feels good to be moving on with the program, and even more to see that the routine functions perfectly as intended.

Thanks Bernie, Daba, and all others for all of your help.
 
:beerchug:this happens - It takes a bigger man to admit it
Well done you solved your problem..
 
monet man, don't beat yourself up over this - I once did it for real in front of a class of 12 students!!

On that occasion, I made out I'd done it deliberately, rather than admitting I'd goofed.

Nowadays, I reverse it - I do it deliberately, and hope that someone spots it, then make out I'd goofed. I think it sticks in their minds better.....

And it's nice to know the routine does it's job. Don't forget what I said about using DINT types all the time unless you have to use others (eg comms to another machine).
 
I had an interesting experience during the xmas break.
I am upgrading an existing r5000 program - many networked PLC's
Needed to talk from one to another.
Everything looked OK - subroutine was already there.
When it wouldnt work - there was an [AFI] instruction in the JSR rung
 
You have my full attention Daba (HA!) Wow this code is so much easier to work with in an array. I just finished rewriting a large chunk of this program, and in the process eliminated 5 routines, AND gained additional functionality like F to C to F.. all by effectively utilizing this array. Also, thanks for the tip on the DINTs Daba. I used INTs thinking that they would speed things up even more..thanks for the reminder. Iant..did you hunt down the JSR AFI culprit, and give his nose hairs a trim with a blowtorch?
 

Similar Topics

Good Morning: Using a 1756-L61 running version 17.2, I FAULTED the processor with the attached logic. Fault was not immediate, but didn't take...
Replies
3
Views
3,277
wildcatherder arrived at a satisfactory resolution to his question in this thread. I'm just not sure how since nothing was ever really resolved...
Replies
1
Views
2,289
Howdy folks, I am an Allen Bradley guy currently living in an Emerson world. Working with Rx3i on PacSystems Machine Edition v. 9.6? i think...
Replies
3
Views
620
Hello, I'm very new to programming with absolutely zero schooling in this field and pretty hands off training in my new role, it's been fun...
Replies
4
Views
667
Hello Friends, I am trying to index M Bits, however GX Works2 is not allowing it with following message. https://ibb.co/zPcqj6M...
Replies
3
Views
1,378
Back
Top Bottom