You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old December 15th, 2016, 09:13 AM   #1
theColonel26
Lifetime Supporting Member
United States

theColonel26 is offline
 
theColonel26's Avatar
 
Join Date: Feb 2014
Location: West Michigan
Posts: 770
How do I use a FB in Structured Text on Omron

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


ST using the FB
Attached Images
File Type: png SB-BEN 2016-12-15 - 09-04-54-001.png (918 Bytes, 46 views)
File Type: png SB-BEN 2016-12-15 - 09-06-51-001.png (3.8 KB, 44 views)
  Reply With Quote
Old December 15th, 2016, 09:28 AM   #2
gclshortt
Member
Canada

gclshortt is offline
 
gclshortt's Avatar
 
Join Date: Dec 2014
Location: Ontario
Posts: 3,220
https://echannel.omron247.com/marcom...df?OpenElement

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

Hope this helps you out.
Regards,
__________________
Garry
https://www.accautomation.ca
Connect with us on Facebook: facebook.com/accautomation/
  Reply With Quote
Old December 16th, 2016, 08:20 AM   #3
theColonel26
Lifetime Supporting Member
United States

theColonel26 is offline
 
theColonel26's Avatar
 
Join Date: Feb 2014
Location: West Michigan
Posts: 770
Quote:
Originally Posted by gclshortt View Post
https://echannel.omron247.com/marcom...df?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);
  Reply With Quote
Old December 16th, 2016, 01:33 PM   #4
paraffin power
Member
England

paraffin power is offline
 
paraffin power's Avatar
 
Join Date: Aug 2002
Location: Manchester
Posts: 518
Yeah. Cxp is nearly compliant
__________________
Whatever hits the fan will not be evenly distributed.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
structured text programming nova manihuruk LIVE PLC Questions And Answers 18 March 24th, 2015 04:40 AM
Structured Text dbh6 LIVE PLC Questions And Answers 44 March 25th, 2013 03:35 PM
RSLogix 5000 Structured Text rajy2r LIVE PLC Questions And Answers 2 February 9th, 2011 05:28 PM
Structured text - Getting started nettogrisen LIVE PLC Questions And Answers 3 July 12th, 2007 11:00 AM
Documentation on Structured Text cmulder LIVE PLC Questions And Answers 13 June 11th, 2003 11:10 AM


All times are GMT -4. The time now is 02:31 PM.


.