How do I use a FB in Structured Text on Omron

theColonel26

Lifetime Supporting Member
Join Date
Feb 2014
Location
West Michigan
Posts
785
I've wrapped a Function Block around a OneShot/R_TRIG and I want to use it in structured text.

I have an Input bool called In and a Output called Out. My FB instance is called OneShot1.

However I am getting these errors
  • unexpected syntax for the '.'
  • Undefined identifier 'Out'

Code:
OneShot1(In:=Running);
If OneShot1.Out = true Then

END_IF;

The FB Logic
attachment.php


ST using the FB
attachment.php


SB-BEN 2016-12-15 - 09-04-54-001.png SB-BEN 2016-12-15 - 09-06-51-001.png
 
https://echannel.omron247.com/marcom%5Cpdfcatal.nsf/PDFLookupByUniqueID/AE0D88A3A45ED8DE862575A700707901/$File/CX_programmer_V8.1_manual_en_200902.pdf?OpenElement

Check out the following SECTION 3 - Creating Function Blocks
You should have a variable table as well.

Hope this helps you out.
Regards,

Yes I have already declare an instance of FB OneShot as OneShot1.

It appear after deciphering this terrible documentation that you have to put an output variable in your call. You can't access the instances output varaible directly.

Way to follow standards omron.

Code:
OneShot1(In:= Running, Out=> OS_Out);
 

Similar Topics

Is there a way in CX-Programmer to call Ladder Instructions from a structured text program? I can see several functions in the autocomplete...
Replies
3
Views
1,951
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...
Replies
1
Views
1,053
I have an expression in a structured text routine of a Logix controller that looks more or less like the following: ResultInteger := Integer1 *...
Replies
13
Views
388
Good evening. I display the step number of a SFC on a display. Sometimes, on a trip, it goes quickly through many steps and I need to prove to...
Replies
1
Views
127
I am trying to set up a piece of equipment with a Horner HE-X4R. I'd like to use structured text and so far I'm just trying to get a basic On/off...
Replies
0
Views
70
Back
Top Bottom