Omron CX-Programmer Call Ladder Instructions from Structured Text


Join Date
Nov 2022
New Zealand
Is there a way in CX-Programmer to call Ladder Instructions from a structured text program?

I can see several functions in the autocomplete

However, I also see many missing functions that are available in Ladder. e.g. BSET


Is there a syntax I am missing to call these Instructions?

Possible solutions:
- Wrap the Instruction in a function block then call the function block once an instance has been made
There are a number of instructions that are not availlable in ST on many platforms, normally the help file will show both FDB/LAD & if the function (instruction) is availlable in ST. something like setting a bank of registers/bits can easily be done in a for next loop that is probably what the function does anyway when compiled. I think as ST is supposed to be transportable code between different brands functions that are sort of unique to a particular brand are not supported, although that particular instruction is common among brands it is probably just the naming & operational convention that differs.
In other words, a function called Block_Set in one IDE (move a value from source to a range of destinations) might be called BFILL in another, this makes ST a problem for compatability so perhaps that is why the instruction set (functions ) are limited but PLC manufacturers for compatibility with existing systems have their own way or convention.
I think it would depend on the platform.
No idea about CX but in ones I use, when you create a function block say in FBD or LAD, it becomes one of the function blocks in the tree, Then in your ST program click on the FB, drag it to the ST & it gives you the structure then you replace the text in black.

Calling FB in ST.png
That makes sense. I suppose at this stage I was just wanting to see what was possible in ST. I have not yet been able to find a list of all the available functions, unless the screen sot that I showed is all that is available. For the sake of simplicity, I have used a for loop as you suggested.
Yes there are some oddities, In my IDE when I press the first letter of a function I want i.e. A, then it only shows a list of operands with A, I would have thought that the list would carry on to B, C etc. but it does not, also in my IDE, on LAD/FBD the function For Next is diffetent i.e. if I'm on an ST block it does not show the For/Next, ST is FOR, DO END_FOR so it does appear that the FOR NEXT function in my IDE is not supported in ST only in ladder/FBD, whereas the FOR/DO END_FOR is.

For Next.png

Similar Topics

Is there a way in CX-Programmer to call functions from a structured text program? I have found this manual that seems to describe the process...
I am using a function block that has a in/out parameter that is a structure. The structure has an array as one of the elements. I can index the...
Is there a way in CX-Programmer to initialise an array? Set all values to zero or false depending on the data type Solutions in Ladder and...
Is there a way in CX-Programmer to ad UINTs together with an instruction without a compiler warning. Ladder Rung: Warning: Instructions...
I would like to compile a list of all the CX-Programmer PID Best Practices If there is some clever way you have figured out to do something and...
Top Bottom