How to populate numbers in GE Machine Edition

Dave85

Member
Join Date
May 2011
Location
Florida
Posts
13
Hi there,

Attached is a program I started to write to populate numbers on a HMI display numeric display when I press a button. Example if the number 9 is press 9 times the results will be "999999999" and if it's press 15 times it will become "999999999999999" Before I move the data I want to verify if it's in the present data block and in the same location I extracted the data from.Lastly I want to move the correct location of data in each results word from (1 to 14). This the part I am stuck on.
 
Last edited:
I don't see the relationship between what you've described and what you've posted.

In your pdf you first populate registers %R03001 through %R03010 with some values. The you populate registers %R04001 through %R04014 with some values.

The Array_Move instructions don't act on any of the registers you populated.

There are easier ways to shift bytes than the Array_move function. The SHL instruction with the value 8 at the "N" node will move the low byte to the high and a SHR instruction with 8 at the "N" node will move the high byte to the low. The ROL or ROR instructions with 8 at the "N" node will swap byte positions in a single word.
 
I am moving numbers in the data array and recipe registers to randomly choose numbers. The array shift bools are used to display the results in the register in the HMI numeric display. Only when the button is press and the number is equal in the data and recipe register, that number will be displayed. I am comparing the data index poiner with the Check data index to determine if the numbers are equal.
 
The array shift bools are used to display the results in the register in the HMI numeric display.
The results of what? There is no logic for what happens when you press a button on the HMI.

In your first post it sounded like you're trying to come up with logic to mimic the action of a calculator keypad. From your second post, I'm not so sure. Exactly what are you trying to accomplish and what is your question?
 
I am not trying to mimic a calculator keypad I am trying to select or choose a random number which must be in both registers by pressing only 1 button which I made on my HMI.How can verify if the number is in both register and how can I move the correct location of the data into each result word (1 to 14)? on rung 23 I used an EQ_IN to compare the numbers with IN1 = data index pointer and IN2 = check index data then Q attaching to a ARRAY MOVE WORD.Would This work? Would I have to this for every result word up 14?

Design2.jpg
 
OK, I'll forget about pressing the "9" button multiple times and having the display show the number of 9's. That's what appears to mimic a calculator keypad.
I am trying to select or choose a random number which must be in both registers by pressing only 1 button
By "both registers", do you mean that when you press the button labeled "9" on the HMI you want to see if the value 9 is in both the 10-element array starting at %R03001 and the 14-element array starting at %R04001? And if so, you need to know the offset from the start of each array where the value "9" is located? Since you've named your program "String Display", should I assume you're working with ASCII codes for the numerals rather than the values?
 
My HMI only has one button which will be used to select any number from 0-9 once the number appears in both register at the same time. Yes the 14 element will be started at %R04001.In this program I'm working with values, string was just the name I used. I confused you the first time by addressing the condition of pushing 9 for example which is not true because I only have 1 button now. Thanks for the effort.
 
When I press the button I want the program to scan and search for a number which is the same in the Array data 10 words( rung 1 to 5) and in the Recipe Array 10 words rung (7 to 11). I want these two area to be compare to each other and if a number is the same I want to display that number on my HMI numeric display. Rung 12 to 17 will move the results and display it on the HMI screen. Rung 20 to 21 will be the initial values of the index, display,result word etc. How can I verify if the number is in both (rung1-5) and (rung 7 -11) and how can I move the correct location of the data into each result word (1 to 14)?
 
Same value in the same position in each array or first instance of a common value in both arrays?

For example:

R3001 = 6 R4001 = 1
R3002 = 8 R4002 = 3
R3003 = 9 R4003 = 7
R3004 = 5 R4004 = 6
R3005 = 2 R4005 = 9
R3006 = 1 R4006 = 2
R3007 = 6 R4007 = 1
R3008 = 7 R4008 = 3
R3009 = 4 R4009 = 4
R3010 = 3 R4010 = 1



Do you want the search to return the fact that the value 6 is the first element of the R3001 array and the fourth element in the R4001 array? Or do you want it to return the fact that the value 4 is the ninth element of both arrays?
 
I want the search to return the fact that the value 6 is the first element of the R3001 array and the fourth element in the R4001 array Or return the fact that the value 4 is the ninth element of both. Where ever the numbers are the same
 
Your answer(s) highlight the reason why you should never give your boss a choice between two options. He'll tell you he wants both.

Your choice will determine your search strategy. If you want to find that the value four is the ninth element in both arrays, you use a Array_Move function over one array to extract the first element. Then use another Array_Move function to extract the first element from the second array followed by an EQ function to check the two extracted elements. If they are the same, stop searching. If they differ, increment the index and repeat the search.

If you want to find the locations of the same value, you can start with the first element of one array and use the Search_EQ funtion to find the same value in the other array. If you use the %R3001 array as the starting point this will return the fact that the value 6 is also located at the fourth element in the %R4001 array. If you start with the %R4001 array it will tell you that the value 1 is located at the sixth element of the %R3001 array.

The Search_EQ function gives power flow at the "FD" node when it succeeds and the corresponding index value at the "NX" node. So for this strategy, use the Array_Move function to extract the first element of one array and use the extracted value at the "IN" node of the Search_EQ function over the second array.

Presumably, pushing the button once generates a single response?
 

Similar Topics

Hello Everyone. I am working on a project where I need to scan in 2 Barcodes to populate 2 different tags. A glue Batch and a product serial...
Replies
12
Views
3,118
Here is what I have done: We have a VersaView on the line and from what I know you cant do transfer utility for IPCs. So I got the MER file...
Replies
0
Views
1,139
I need to have an array tag that contains string data from a csv file. The csv file needs to be imported once per day. Is there any simple way to...
Replies
3
Views
1,817
Is it possible to auto populate descriptors of bits through multiple layers of UDTs? For example, I want the Highlighted bit in the attached pic...
Replies
7
Views
1,904
Is it possible to auto populate descriptors of bits through multiple layers of UDTs? For example, I want the Highlighted bit to be descripted as...
Replies
0
Views
1,001
Back
Top Bottom