How do I use a FB in Structured Text on Omron

theColonel26

Lifetime Supporting Member
Join Date
Feb 2014
Location
West Michigan
Posts
781
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,851
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,006
Good morning. I'm doing a rehab and I need to recycle some part of the old code that won't change and that I need. This is a calculation that...
Replies
22
Views
1,166
I'm writing some structured text that's handling a data structure that comes from a PC. The PC structure is in the "new" LREAL 64-bit floating...
Replies
3
Views
439
Trying to put these equations in structured text program in a Micro 830. when I run the verify I get this error. ;:expected before this new...
Replies
4
Views
394
Back
Top Bottom