
adccommunitymod (AutomationDirect) asked a question.
Created Date: April 27,2019
Created By: Ryan_Poethke
**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****
Title says it all. How do I use an array to hold a series of target positions for motion control, and allow an operator to select them through an EA9 touchscreen? What I 've done: I 've created a memory block named "Positions " by selecting PLC -- > Memory Configuration -- > Add Memory Block Block created: Name: Positions Data Type: Unsigned Word Block Size: 256 Entire block retentive So... what do I do now? Questions: How do I assign a memory location to the pointer, to allow me to step through the array to get values stored at the various locations? How do I allow an entered value on the touchscreen to be automatically written to a location in the array, based on the pointer value? How do I copy the selected array location out to use in other logic in the PLC? I 've looked at the Help selection on arrays, and it sort of makes sense, but it really seems like there are steps missing in the process or the person who wrote the Help file assumes I have a level of knowledge I apparently don't. Is there any hope of a manual for Do-More Designer, like exists for the DirectLogic series of PLCs? I have learned most of what I know about the DL line simply by reading the manual cover to cover (almost). I was able to do simple motion control years ago with a stepper motor, never having done it before with only the examples in the manual. Is there anything beyond the Help file for the Do-more? I wish the documentation for Do-more was more complete. I know the BRX is a powerful piece of hardware, but I don't want to be calling Tech Support every time I want do to a new thing. A.D.'s tech support is wonderful, by the way. Thanks, Ryan Poethke
Created Date: April 27,2019
Created by: Ryan_Poethke
Title says it all. How do I use an array to hold a series of target positions for motion control, and allow an operator to select them through an EA9 touchscreen?
What I 've done:
I 've created a memory block named "Positions " by selecting PLC --> Memory Configuration --> Add Memory Block
Block created:
Name: Positions
Data Type: Unsigned Word
Block Size: 256
Entire block retentive
So... what do I do now?
Questions:
How do I assign a memory location to the pointer, to allow me to step through the array to get values stored at the various locations?
How do I allow an entered value on the touchscreen to be automatically written to a location in the array, based on the pointer value?
How do I copy the selected array location out to use in other logic in the PLC?
I 've looked at the Help selection on arrays, and it sort of makes sense, but it really seems like there are steps missing in the process or the person who wrote the Help file assumes I have a level of knowledge I apparently don't. Is there any hope of a manual for Do-More Designer, like exists for the DirectLogic series of PLCs? I have learned most of what I know about the DL line simply by reading the manual cover to cover (almost). I was able to do simple motion control years ago with a stepper motor, never having done it before with only the examples in the manual. Is there anything beyond the Help file for the Do-more?
I wish the documentation for Do-more was more complete. I know the BRX is a powerful piece of hardware, but I don't want to be calling Tech Support every time I want do to a new thing. A.D.'s tech support is wonderful, by the way.
Thanks,
Ryan Poethke
Created Date: April 27,2019
Created by: BobO
Title says it all.
From anywhere but a MATH box, arrays are indexed with V locations. If you were using V0 as the index, you would set V0 to the offset you want (0 to 255) and use the syntax Positions . Assuming V0 is set to 3, Positions is the same as Positions3. Array syntax can be used in almost every field in Do-more. Best way to learn is to play with it in a Data View.
Do-more also supports small array displacements. In our previous example Positions would access Positions4. Displacement is limited to +63. Very handy for creating multi field records. Set the V to the start of the record, and access each field in the record with +1, +2, +3, etc.
In a MATH box, array indexes have no practical limit. Positions is legal. Basically any valid expression. That also applies to the output field. Very useful for doing multi dimensional arrays, which Do-more doesn't yet support. Assigning to Positions is functionally identical to Positions .
Questions:
How do I assign a memory location to the pointer, to allow me to step through the array to get values stored at the various locations?
How do I allow an entered value on the touchscreen to be automatically written to a location in the array, based on the pointer value?
How do I copy the selected array location out to use in other logic in the PLC?
Pretty much the same answer for all questions, use Positions exactly like you would use any other parameter. MOVE, MATH, COPY, all allow array references for source or destination parameters. There really isn't any special handling for arrays. Indirect references work exactly like direct references.
Created Date: April 27,2019
Created by: Ryan_Poethke
How/where do I set the Vmemory location for the array pointer? That's what's holding me up right now.
Ryan Poethke
Created Date: April 27,2019
Created by: BobO
How/where do I set the Vmemory location for the array pointer? That's what's holding me up right now.
Ryan Poethke
I think you are overthinking it. Any V can be an array reference, there isn't one assigned to an array. If you want to use V0, set V0 and use Positions . If you want to use V100, it's Positions .
So set V0 to 10, then Positions references Positions10.
Created Date: April 27,2019
Created by: BobO
Play with it in a Data View. When I set V0 to 1, Positions references Position1. When I set V0 to 2, it references Positions2.
{ "data-align ": "none ", "data-size ": "full ", "data-attachmentid ":122331}
{ "data-align ": "none ", "data-size ": "full ", "data-attachmentid ":122332}
Created Date: April 27,2019
Created by: BobO
Maybe a DL example would help...hopefully I remember the way it works. If you set V1400 to 0, and put P1400 in a program, it returns the value contained in V0. The Do-more equivalent of P1400 is V .
Created Date: April 29,2019
Created by: Ryan_Poethke
I think you are overthinking it. Any V can be an array reference, there isn't one assigned to an array. If you want to use V0, set V0 and use Positions . If you want to use V100, it's Positions .
So set V0 to 10, then Positions references Positions10.
Now I get it! I wasn't understanding the ARRAY_NAME naming convention. Thanks!
Ryan Poethke
Created Date: April 29,2019
Created by: BobO
Now I get it! I wasn't understanding the ARRAY_NAME naming convention. Thanks!
Ryan Poethke
Awesome.
Works like that in basically every instruction, but MATH boxes aren't limited to V memory indexing. In a MATH box, you can use any valid expression as an array index for both the input and output parameter. That can be very powerful.
Created Date: April 30,2019
Created by: TheGreatMarklar
Awesome.
Works like that in basically every instruction, but MATH boxes aren't limited to V memory indexing. In a MATH box, you can use any valid expression as an array index for both the input and output parameter. That can be very powerful.
I did not know this, very cool!
Created Date: May 16,2019
Created by: Ryan_Poethke
I now have actual hardware to test on, and my array issues still have me stumped. Here's what I have:
C-more HMI with:
A numeric entry object: Target Position
Data Entry tag: V1003
Data Display tag: V2000
A numeric entry object and an increment/decrement button object: CUE_NUMBER
Data Entry & Display tag: V1007
A BRX PLC with:
An array called TARGETS0-255 with 256 positions.
Line1: Copy V1003 into the CUES array Target Position ---> TARGETS .
Line2: Copy TARGETS ---> V2000
What I want to happen:
When I increment or decrement CUE_NUMBER from the HMI, the target value saved in that spot in the array will be displayed on the touchscreen, and be available for use elsewhere in the program.
What is currently happening:
When I increment or decrement CUE_NUMBER from the HMI, the last target value I entered on the HMI is written to each spot in the array. It will update if I change the value in the HMI. However, every time i increment or decrement CUE_NUMBER, the value currently in V1003 is written to every spot in the array.
What simple thing am I missing here?
Thanks,
Ryan Poethke