RS 5000: Use OneShotRising in ST?

theColonel26

Lifetime Supporting Member
Join Date
Feb 2014
Location
West Michigan
Posts
785
I am using RS 5000 v30. I am trying to use the OSRI AOI to detect a Rising Edge.


OSR_EnableACC is of Type FBD_ONESHOT


EnableACC is what I want to detect the Rising Edge on.



Here is my Code
Code:
OSR_EnableACC.InputBit = EnableACC;

OSRI(OSR_EnableACC);

IF OSR_EnableACC.OutputBit Then
    //Do Somthing
END_IF;
I am getting a
Error: Line 1, ';': Unexpected.

2020-03-09_10-40-54.png
 
I'm not well versed on Rockwell's structured text, but if it follows IEC61131 then you need to use := as the assignment operator.

Code:
OSR_EnableACC.InputBit := EnableACC;
 
I'm not well versed on Rockwell's structured text, but if it follows IEC61131 then you need to use := as the assignment operator.

Code:
OSR_EnableACC.InputBit := EnableACC;
šŸ™ƒ that was the problem. It's been awhile since I used ST.


I forgot about it's weird PASCAL like syntax.


Thanks :)
 
Curious - why not DIY:

Code:
if (condition & not OneShot) then
   // do something
end_if;
OneShot := condition;
 
Curious - why not DIY:

Code:
if (condition & not OneShot) then
   // do something
end_if;
OneShot := condition;


Well I have done that in the past, and might still do it. But I am trying to reinvent the wheel less.


AB doesn't have plain User Defined Functions does it? Just FBs aka AOIs.


I'm gonna start a new thread about Functions.
 
Last edited:

Similar Topics

Hi Everyone. Not posted on here for a long time, but I am hoping someone can help me. I am doing a differential pressure calculation in a L27ERM...
Replies
15
Views
203
Hi, how do I convert 2x Integer registers to a Real? The two integers are from Modbus registers that contain a floating point value, I need to...
Replies
2
Views
116
What is the best way to extract the hour and minute from the register that comes from Yaskawa VFD. In studio 5000 I have a register saved as INT...
Replies
3
Views
119
I have an Allen Bradley temperature switch that I am trying to use in studio 5000. I am getting the message "Unable to interpret the IODD file"...
Replies
0
Views
72
Hi all. I want to ask what may seem a stupid question, as I have a project to send live data to a Yeacode line printer which will print meterage...
Replies
10
Views
195
Back
Top Bottom