Jump to content

Array instuctions


olc90b

Recommended Posts

I am looking for help with array instruction set.  I need build an array with 500 columns and 10 rows.  I need to make it so the operator can search by info in the array.  is there a manual on the instructions on the different array instructions.

Hi,

First of all, two dimensional arrays are not available for Unitronics products. There are one dimensional array's available, usually referred to as Vectors.

Second, in the M90/91 PLC's there is a small database for storing integer values, but it will not suit your needs because you need 5000 cells for your application.

Finally, there is a very useful solution in the Vision series: the Data Tables feature enables you to store all values up to 192KB (depends on the model) locally, including easy store and retrieval of data. You can store any data type you like, export/import to Excel files and much more.

For your convenience I attached the relevant topic from Visilogic (the Vision PLC's development environment) help file.

data tables.pdf

Link to comment
Share on other sites

You can use an offset multiplier to simulate a 2 dimensional array with a vector.  It's really how 2d arrays work anyway, just takes a bit more coding effort.

Array2d[width][Length] = Vector[(width*rownumber)+column number]

 

So using an array of 4x4"

(*Note this math assumes 0 as vector/array as array first element.  Also, based off C notation)

Position[4][2] is the same thing as position [4*(4)+(2)]

Element[4][2] = vector[18]

Element[3][3] = vector[15]

 

An array of 50x30:

Element[45][10] = vector[45*50+10] = Vector[2260]

 

An array of 27x13:

Element[14][26] = vector[14*27+26] = Vector[404] 
 

Link to comment
Share on other sites

You can use an offset multiplier to simulate a 2 dimensional array with a vector.  It's really how 2d arrays work anyway, just takes a bit more coding effort.

Array2d[width][Length] = Vector[(width*rownumber)+column number]

 

So using an array of 4x4"

(*Note this math assumes 0 as vector/array as array first element.  Also, based off C notation)

Position[4][2] is the same thing as position [4*(4)+(2)]

Element[4][2] = vector[18]

Element[3][3] = vector[15]

 

An array of 50x30:

Element[45][10] = vector[45*50+10] = Vector[2260]

 

An array of 27x13:

Element[14][26] = vector[14*27+26] = Vector[404] 

 

Hi Cantcliff,

That's quite clever. I didn't know that's how 2d arrays work.

Anyway, it is much more simple to use data tables.

Link to comment
Share on other sites

Hey Eyal,

 

   Thanks for the quick response.  I am using a UniStream 10 with unilogics.  Does this still have the same limitations?  Is there a manual for the array instructions. 

 

Thanks

Paul    

Unistream works in the same way. You will find explanations regarding data tables in the Unilogic help file.

If you still need assistance, I will be happy to help.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.