How to use SIN in RSLogix

pbr_forum

Member
Join Date
Aug 2010
Location
Rimouski
Posts
15
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
 
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 ...

Sine_Wave_S42.JPG
 
Last edited:
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!
 
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:
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 ...
 

Similar Topics

Good morning everyone, I'm having difficulty using the "sin" and "cos" functions in sysmac, in particular the results of the functions are not...
Replies
15
Views
1,058
Hi, How to force analog I/O values in Proworx 32 Software (Modicon). Thanks.
Replies
2
Views
1,618
Is it even possible to conevert NB HMI program TO NC HMI programm or how to get .csv file from cx programmer for some reason program named tag...
Replies
3
Views
1,351
Twice in less than a week! Another former customer of mine has run into a problem. Their machine had a Red Lion Kadet HMI that went belly-up and...
Replies
3
Views
1,555
In Rslogix 5000, how to convert the angle of sin54 to degree? if i use SIN instruction,it converts as radian. Please help some one
Replies
3
Views
1,972
Back
Top Bottom