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.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


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

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old November 14th, 2010, 05:38 PM   #1
pbr_forum
Member
Canada

pbr_forum is offline
 
Join Date: Aug 2010
Location: Rimouski
Posts: 15
How to use SIN in RSLogix

Hello,

I am not an expert in RSLogix, that's why I am asking for some help. I need to add a SIN wave in RSLogix. It needs to look like this: sin((1/60)*time). I have read in the help section that: dest:=sin(source), so my «source» needs to be: (1/60)*time. My problem is the following: I don't know how to input the time correctly. It doesn't look like a hard task, but I just want some tips because I want to be sure to do it correctly. Thank you!

Pierre
  Reply With Quote
Old November 14th, 2010, 05:59 PM   #2
Ron Beaufort
Lifetime Supporting Member
United States

Ron Beaufort is offline
 
Ron Beaufort's Avatar
 
Join Date: Jul 2002
Location: Charleston, SC
Posts: 5,291
well, you didn't tell us WHICH RSLogix you're using – and you didn't tell us WHAT TIME (seconds, minutes, hours, etc.) you want to use - but maybe the two following examples will get you started ...

===============

for RSLogix500 – use a Floating Point location (example: F8:0) as your destination for a CPT (Compute) instruction ...

try this for the expression:

((SIN(S:42 * 0.10649)) * 50.0) + 50.0

that should give you a sine wave with a period of one minute – and a range from 0 to 100 ...

===============

for RSLogix5 – use a Floating Point location (example: F8:0) as your destination for a CPT (Compute) instruction ...

try this for the expression:

((SIN(S:23 * 0.10649)) * 50.0) + 50.0

that should give you a sine wave with a period of one minute – and a range from 0 to 100 ...

===============

both of the examples above are based on using the seconds reading from the processor's real-time clock ... if your processor doesn't have a clock, then let us know and we'll try something else ...

if this doesn't fully answer your question, please post again with more details ...
Attached Images
File Type: jpg Sine_Wave_S42.JPG (36.1 KB, 352 views)
__________________

2-B ?
Best regards, ----+----] [----+------------( )----
Ron | |
PLC Training Boot Camp | 2-B |
+----]/[----+

I once was lost, but now am found, was blind, but now I see.


Last edited by Ron Beaufort; November 14th, 2010 at 06:29 PM.
  Reply With Quote
Old November 14th, 2010, 10:10 PM   #3
pbr_forum
Member
Canada

pbr_forum is offline
 
Join Date: Aug 2010
Location: Rimouski
Posts: 15
thank you for your answer!
The version I'm using is RSLogix5000 and the time is in seconds. I would like to implement a SIN bloc (found under «Trig Function») in a «Function Bloc Diagram».

Thanks Again!
  Reply With Quote
Old November 15th, 2010, 02:50 AM   #4
rdrast
Lifetime Supporting Member
United States

rdrast is offline
 
rdrast's Avatar
 
Join Date: Apr 2003
Location: South Carolina Lowcountry
Posts: 5,019
In Logix 5000, all the trig functions take angles as Radians, not degrees. Something to be aware of if it looks like numbers are coming out strange.
__________________
------------------------------------
How to ask questions the SMART Way!

Look First, Ask Second!

  Reply With Quote
Old November 15th, 2010, 06:11 AM   #5
Ron Beaufort
Lifetime Supporting Member
United States

Ron Beaufort is offline
 
Ron Beaufort's Avatar
 
Join Date: Jul 2002
Location: Charleston, SC
Posts: 5,291
short on time ... see if this helps ...

this pretty much duplicates the earlier examples - but in FBD programming ...
Attached Images
File Type: jpg Sine_Wave_5000.jpg (38.0 KB, 335 views)
__________________

2-B ?
Best regards, ----+----] [----+------------( )----
Ron | |
PLC Training Boot Camp | 2-B |
+----]/[----+

I once was lost, but now am found, was blind, but now I see.

  Reply With Quote
Old November 15th, 2010, 07:45 AM   #6
The Plc Kid
Member
United States

The Plc Kid is offline
 
The Plc Kid's Avatar
 
Join Date: Feb 2009
Location: Macon, Georgia
Posts: 3,235
Ron

Where and when would you use this? What type of application?
  Reply With Quote
Old November 15th, 2010, 08:09 AM   #7
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: Vancouver, WA, US
Posts: 6,525
Testing

We/our customers use sine waves all the time in testing applications. The amplitude and frequency are ramped up when doing fatigue testing.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old November 15th, 2010, 08:34 AM   #8
The Plc Kid
Member
United States

The Plc Kid is offline
 
The Plc Kid's Avatar
 
Join Date: Feb 2009
Location: Macon, Georgia
Posts: 3,235
So you are controling a output in a sine wave?
  Reply With Quote
Old November 15th, 2010, 10:26 AM   #9
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: Vancouver, WA, US
Posts: 6,525
Quote:
Originally Posted by The Plc Kid View Post
So you are controling a output in a sine wave?
Sometimes but rarely with a hydraulic system. Usually the motion or force profile is a sine wave. The output is what ever is need to achieve the sine wave motion or force profile
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old November 15th, 2010, 10:54 AM   #10
ndzied1
Lifetime Supporting Member
United States

ndzied1 is offline
 
ndzied1's Avatar
 
Join Date: Aug 2002
Location: Chicago, Illinois
Posts: 2,308
The output would likely be a sine wave when testing the valve itself but that is a very limited application.
__________________
nOrM
======================
nOrM=Norman Dziedzic Jr.
"I decry the current tendency to seek patents on algorithms. There are better ways to earn a living than to prevent other people from making use of one's contributions to computer science." Donald Knuth
  Reply With Quote
Old February 25th, 2016, 02:27 PM   #11
sanchit9590
Member
United States

sanchit9590 is offline
 
Join Date: Apr 2014
Location: ATL
Posts: 1
I know this is a really old post. I hope its fine if I revive this.
The equation works perfectly, creates an really nice sine curve of period 1 minute.

How did we reach at 0.10649? The equation above is Sine(Seconds * 0.1649).


My initial guess was its Time period, derived by (2π/60), ie. 2*PI/60, which comes out to be 0.10471975. But clearly I'm missing something here

Last edited by sanchit9590; February 25th, 2016 at 02:35 PM.
  Reply With Quote
Old February 25th, 2016, 10:51 PM   #12
Ron Beaufort
Lifetime Supporting Member
United States

Ron Beaufort is offline
 
Ron Beaufort's Avatar
 
Join Date: Jul 2002
Location: Charleston, SC
Posts: 5,291
the Seconds reading from the clock only goes up to a maximum value of 59 (it never reaches 60) ... so try dividing (2*pi) by 59 ...

and welcome to the forum ...
__________________

2-B ?
Best regards, ----+----] [----+------------( )----
Ron | |
PLC Training Boot Camp | 2-B |
+----]/[----+

I once was lost, but now am found, was blind, but now I see.

  Reply With Quote
Old September 21st, 2016, 04:24 AM   #13
thailapillai
Member
India

thailapillai is offline
 
Join Date: May 2016
Location: *******
Posts: 10
Quote:
Originally Posted by rdrast View Post
In Logix 5000, all the trig functions take angles as Radians, not degrees. Something to be aware of if it looks like numbers are coming out strange.
can u explain how to convert angle sin45 to degree?
  Reply With Quote
Old September 21st, 2016, 10:09 AM   #14
TConnolly
Lifetime Supporting Member
United States

TConnolly is offline
 
TConnolly's Avatar
 
Join Date: Apr 2005
Location: Salt Lake City
Posts: 6,147
Pi radians = 180 degrees.

To convert degrees to radians use (a/180)*pi where a is the angle in degrees.
__________________
True craftsmanship is only one more power tool away.

That's the beauty of processors, they don't have emotions they just run code - The PLC Kid.
  Reply With Quote
Old September 21st, 2016, 10:09 AM   #15
Mickey
Lifetime Supporting Member
United States

Mickey is offline
 
Mickey's Avatar
 
Join Date: May 2003
Location: Palmdale,Ca
Posts: 9,826
Quote:
Originally Posted by thailapillai View Post
can u explain how to convert angle sin45 to degree?
Do you mean convert radians to degrees?

https://www.google.com/webhp?sourcei...ians%20formula


Edit: TConnolly types faster then I do.
__________________
Mickey

If you want happiness for an hour-take a nap. If you want happiness for a day-go fishing. If you want happiness for a month-getmarried. If you want happiness for a year-inherit a fortune. If you want happiness for a lifetime-help someone else.
----- Chinese Proverb
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


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
RSlinx Lite and RSLogix 500 Starter... FREE geniusintraining LIVE PLC Questions And Answers 21 February 24th, 2012 05:11 PM
Rockwell Allen Bradley Programming Software, RSLogix 5, RSLogix 500, RS Linx, RSLogix vvcd LIVE PLC Questions And Answers 21 September 24th, 2009 10:04 PM
RSLogix 5000 V15 Features Samneggs LIVE PLC Questions And Answers 18 April 20th, 2006 05:45 PM
RSLogix 500 bug bit me today.... jstolaruk LIVE PLC Questions And Answers 1 February 3rd, 2006 01:08 AM
RSLogix 500 Vs. RsLogix 5 mrdmrd LIVE PLC Questions And Answers 7 February 21st, 2005 05:11 AM


All times are GMT -5. The time now is 03:27 AM.


.