Jump to content

Recommended Posts

Posted

Hi!
I'm programming an UniStream Modular USP-070-B08 + CPU USC-P-B10 with UniLogic v1.25.61.
I want to create an array of INT16, which its length, will be set by the user through the HMI. Is it possible? Because when I create the array in Ladder, I can only set a constant value for the array's length.

I want to try something similar with the number of rows for a table.
Thanks in advance!

Posted

Hi Gonzalo,

that I know is not possible, at run time or in late binding,   decide the length of an array or of a DT...you have to do this at compile time.

What you can do is store (append) in a SD file, or in a SQL table, the DT and recall these.

  • MVP 2023
Posted
13 minutes ago, ORSO2001 said:

that I know is not possible

I'm pretty sure memory must be allocated during compile. @GonzaloRoldan_, why do you need to do this? You have only a finite amount of memory available. Just define your array or table to the maximum size you think you might need and work with that.

Posted

Hi Orso and Flex. First of all, thanks for your answers!
Considering what both are saying, I understand that it's not possible to do it.

The reason why I wanted to do it @Flex727 was that the vector size depends on the result of a mathematical equation, which most of the time is under 100 combinations, but sometimes is over 10000 combination. And I did not want to create a vector which length is 10000 when around 90% of the time, it won't be needed to be more than 100 of length.

But no worries, I'll do what you recommend.

Thanks again!

 

  • MVP 2023
Posted
2 minutes ago, GonzaloRoldan_ said:

And I did not want to create a vector which length is 10000 when around 90% of the time, it won't be needed to be more than 100 of length.

The PLC doesn't care.

Posted

I tryed to create an array with length 1000000, max that I could get was 512  (0-511)

This goes for all types.

the way i did it was: 

- click global in bottom line, 

- add tag

- fillin name, type, array length

length over 512 colored red, not accepted

what do i do wrong?

 

  • MVP 2023
Posted

You haven't done anything wrong.  I fired up UniLogic and played with arrays myself - you've just discovered out the undocumented maximum array size.

There is 1M of total memory of which 256K can be retained.  

Joe T.

Posted

Thank you both for your swift answer.

The reason I tried such large arrays is that I do not understand the way datatables work.

The whole subject of storing and retrieving data is unclear to me, just is importing and exporting data to PC.

I suppose that happens with beginners.

I tryed to follow the video about datatables (and some others) on utube. There I have a problem.

Since my hearing is somewhat impaired, I cannot fully understand what is said.

I followed a number of seminars, there I lost the thread very swiftly also. 

The speed is very high, wich makes it worse. Repeated stop, wind back and replay made things not better, neither did half speed.

There was one video where there was subtitling during a short time. That cleared up things enormously.

I wonder if I am the only half deaf person using utube.

I will contact my contact at Unitronics. They are very helpfull, but I do not want to bother them more than I need to.

 

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.