program efficiency

2 posts in this topic


Im trying to optimize our inverter block.

Initially the block have local IO variables to handle the inverter IOs (RX,RY,RWr, RWw).

This means i have all the inverter variables both global and local.

This made me think that im using steps to copy the vars to the block itself and im using a lot of vars hence the locals.

So i tried to make a version without the locals. And had the block call the globals inverter IOs directly. Hoping i would save steps and vars.

But when compiling i get the exact same usage result. Does this make any sense? Can someone shed some light on this?

Im using gx works 2 inverters are in cc-link ie.



Share this post

Link to post
Share on other sites

Probably because the compiler generates temp vars to map data. In other words, the compiler makes use of variables to compile the code into IL for execution. The FB can be with, or without macrocode which indicates if it is placed inline or as a "subroutine".

It's hard to explain your exact issue without seeing the code with and without modifications.

1 person likes this

Share this post

Link to post
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