Unity Pro XL Dynamic arrays

Join Date
Jun 2017
Location
TX
Posts
10
I saw that you can set an input/output type on a DFB to "ANY_ARRAY_XXX" where x is the data type. So I'm assuming that lets you pass an array of any size. Great. I can also set this to my output. Also great.

But is there any way to dynamically set the array size at run time? Structured Text normally allows:

VAR
someArray: ARRAY[x..y] OF DINT
END_VAR


but VAR seems to only throw a "syntax error" when I use it.

Is this possible on Modicon/Schinder? Allen Bradley?

Can I just program in C++ or Java and compile it on the PLC somehow? (JK. I know you can't).
 
There is optional (pricy) EFB toolkit which enables C-coding.

For arrays make one big array, and on program side only expand index address to suit you needs. I think that expanding array is not possible without dowwnload.
 
Neat. I didn't know that it was even an option to code in C. I kind of get the feeling they won't buy it for me though. The plant has tons of money, engineering not so much. Unfortunately, Unity is owned by engineering so most things aren't approved unless there's company-wide ROI.

For now, I've been hard-coding arrays for each PLC based on the number of controlled axes. I was mainly hoping to make a DFB I could quickly copy/paste to each PLC. Some hard coding isn't the end of the world.

I spent too long on OOP style programming before jumping to PLCs. Hard coding anything makes my skin itch. Lol.

Thanks for the help, and the tip!
 
EFB tool start price was around 2k (€) without VAT last time when asked (y)

You can build DFB block, but make array something like ANY_ARRAY [0..10]
Then make input (INT) to DFB which limits index for array inside your block.
 

Similar Topics

Hello, I am using Unity pro V15. I have Quantum CPU 671 and Ethernet NOE 77101 configured. I have configured IO scanning on NOE. I have attached...
Replies
5
Views
167
HELLO MY FRİENDS ı have problem. ı tought you can solved thıs problem for me. First of all When I checked all the cable connections of the...
Replies
0
Views
399
Hi All, I haven't installed Unity Pro in years and needed to install it recently. I initially tried installing Version 11.1 and the whole...
Replies
3
Views
691
Hello i want to implement a Read_var / Write_var functions to communicate with a modbus tcp device at the moment i use the unity simulator at the...
Replies
4
Views
1,898
Hi, I've exported a PL7 application to the .FEF file succesfully. Imported the .FEF file in my Unity Pro project, but two of the five sections in...
Replies
0
Views
766
Back
Top Bottom