Kpotmake Posted October 16, 2021 Report Share Posted October 16, 2021 Hello all, I was asked to write some software for a machine using a Unitronics PLC, programming in Unilogic is new to me but I've got the machine up and running quite easily, the software is verry intuitive. However it does lack structured text programming... for the more complex tasks I was told I could write my own C functions. This does however bring some limitations with it, the worst one being not being able to acces the global tags and being limited to 256 bytes of data within the functions. Is there a way to call other functions within the C function? This would be a workaround for these limitation. For example: I need to loop through an array that has 100 items, and then perform a calculation on these items. The looping part would fit in a C function but the calculation combined with the array size would require more then 256 bytes. If I could call another function when looping through the for loop this would solve my problem. Quote Link to comment Share on other sites More sharing options...
Rivka Posted October 20, 2021 Report Share Posted October 20, 2021 Hello, Well... calling ladder functions from C functions is possible, as you can see below, but although calling C functions from within C functions is also possible, it is not sure it'll help you regarding local variables limitation as I can see in Help the following line Quote Link to comment Share on other sites More sharing options...
Rivka Posted October 20, 2021 Report Share Posted October 20, 2021 @Saragani, do you know if the 256 bytes limitation is only on local variables or include in/out variables as well? If it is only on local variables, Kpotmake can get along by creating ladder function that declares all local variables and passes them as Function inputs to the C function. Do I make sense? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.