aliazzz / Blog: Recent posts

Alternative programming font suggestions for CODESYS IDE

Hi!

If you code very frequently you'll start to wonder if there is any other good programming font available like Consolas.

A small google along the interwebs will show you there are some really many and great alternatives available. I can recommend you at least give these two Fonts types a try;

Hack Font: https://sourcefoundry.org/hack/
Hack Font Examples:  https://sourcefoundry.org/hack/playground.html ... [read more](/u/aliazzz/blog/2020/08/good-font-suggestions-for-codesys-ide/)
Posted by aliazzz 2020-08-23

Pragma's

Message Pragma's

Message pragmas output a message during compilation process.

Four categories of message ara available
Text, Info, Warning and Error

{text 'This is a Text message'}
{info 'This is an Info message'}
{warning 'This is a Warning message'}
{error 'This is an Error message'}

Instead of comment, which is ignored by the compiler, pragma's are not ignored and can be used to output various types of messages during compilation as a Text, Info, Warning or Error.... read more

Posted by aliazzz 2020-08-17

Prefer a REFERENCE over a POINTER

REFERENCE

A REFERENCE is also a pointer but has several advantages over pointers.

  1. Assigning a value to a reference variable can just be done without dereferencing the value like so in the declaration;
   myByte1 : BYTE;
   refBYTE1 : REFERENCE TO BYTE REF= myByte;

Or somewhere in the code;

   refBYTE1 REF= myByte;
  1. Functions with a Reference Input can just be assigned to the value direct. No ADR() operation is necessary.... read more
Posted by aliazzz 2020-08-05

The secrets of __VARINFO

__VARINFO

The operator

__VARINFO

returns a structure containing more information about the variable.

The information can be stored in a structure of type;

__SYSTEM.VAR_INFO

Posted by aliazzz 2020-08-05