micro 800 array variable subscript

nmk34

Member
Join Date
Apr 2019
Location
texas
Posts
80
icon5.gif
micro 800 array variable subscript micro 800 PLC array subscript:
the ladder code when it runs the array does update.
first, i created an variable array of 20 elements of DINT
Second, defind a variable of DINT called it "i", my index variable
third: used cop function to move a value from counter to variable, but when it runs it display "wait" next to variable. even initialized the index variable i with a 0 value.
what is wrong?
this plc is micro 820 and i am using CCW ver 12.
 
I am not sure about MicroLogix8xx, but on other A-B PLCs the COP instruction copies the bits, so if the CTU.CV and PartCounter[index] are different sizes, it may not work. Maybe the MOV instruction would work better.



Also, I see three Man_* booleans: Man_pulse1; Man_increment_Pulse; Man_Move_Pulse; but I don't see anything that changes them from 0 to 1 and back again.


1) The [CTU] instruction counts on a rising edge of its incoming rung, so I suggest a branch with an [OTU] (unlatch) instruction on [Man_pulse1] in parallel with the CTU so it [Man_pulse1] never 1 for more than one scan.



2) If the user assigns those BOOLs manually e.g. [Toggle bit] or similar, then [index1] at least will very quickly move, at an increment rate of around 1kHz, out of range of the 20 elements of the PartCounter DINT array, and cause a fault if the Man_Move_Pulse bit is ever assigned a 1, so I would do the same unlatch trick there.


3) The last rung input to the COP (MOV?) should only be allowed to be true if [index1] is greater than -1 and less than 20.
 
It looks like to me that you are just testing the theory of how to copy a value into a location pointed to with the index, I's been some time since I did AB but it looks like there may be a couple of problems in your code. Assuming you are incrementing a counter manually by pulsing a bit, then incrementing the pointer and then using the pointer to copy the counter value into a variable in the array pointed to by the index.
As I say, not too familiar with AB but I would assume you need to fill in some of the other values in the copy block, it appears you have no offset for source or destination & length set up (I suppose this could be default values). I also suggest you use the move function i.e. Move Source, Destination[index] and do all this on one shot logic.
Also I do not see the logic in using a pointer that is incremented to populate an array, I assume that the idea would be to have a FIFO so that at a given time or event the parts produced counter will move the value into a FIFO and shift the previous ones down the stack. More information on what the intention is would be helpful.
 
Last edited:

Similar Topics

Good morning! I'm trying to communicate a Micro 850 (2080-LC50-AWB) with a Danfoss FC202 by VLT 121 MCA Ehternet ip card. I can read the value...
Replies
0
Views
444
Hello everyone! I was wondering if anyone here has any experience setting up a RS PRO HMI to connect to a Micro800 plc? The available drivers...
Replies
2
Views
1,181
I am trying to communicate to a Powerflex 525 using a Micro 820 using a MSG instruction over Ethernet. I am using the position UDFB from the AB...
Replies
2
Views
1,146
Has anyone been able to read the flow pulses from a Signet 515 paddle wheel on an Allen Bradley Micro 800 PLC with a high-speed counter input? I...
Replies
0
Views
849
I am working on a Micro 820 with a 2080-MOT-HSC high speed counter module. I am trying to read the pulses from a Signet 515 paddle wheel flow...
Replies
0
Views
709
Back
Top Bottom