math with slc505 and stepper card to move spray bar

There is nothing to reset timer T4:1, so the OSR will not fire. The data tables show 0 in O:7.0, while you have -31727 in N9:0.

Try replacing the XIC T4:1 and the OSR with XIC S:1/15 (First Pass) to write your configuration bits to the output words once on first scan.

Paul

EDIT: Nevermind...I see you are clearing that word intentionally on the next rungs.
 
Last edited:
I now understand how to use the cosine and arc cosine functions. For example if the total width of spray bar is 38 inches and it needs to rotate to only spray fabric that is 10 inches wide, then the arc cosine of 10/38 = 74.74 degrees. If the slc uses radians then could you post how to enter this in the slc
As peter posted "You need to use an acos(width/10) function then scale the angle 0-∏/2 to 0-500In your application you have the ratio of the lengths in a right triangle and you need to determine the angle needed to achieve that length ratio. That means you need the arc functions. As OkiePC said, the functions in the SLC require an input in radians. There are 2*Pi radians (6.283184) in 360 degrees.
0 counts.",
Could you post a small section of code for this, can not figure out how to enter the code and scale it.
Hope I am not asking for too much, but really confused on this one
And as Keith posted "
 
Thinks to everyone, have done a lot of reading and pulled out some old math books from tech school (30 years ago) and researched the links that Peter posted, and now hopefully have a better understanding of how to do this.
This is the code i used to determine the angle. No way of testing it yet, do not have a actual plc, but will when I get to the plant in a few weeks.
Anyone see anything in this code that does not look quite correct would appreciate some advice.
Thanks
 
I was hoping one of the more knowledgeable folks that use this site would take a look at the code and give me there thoughts.
Thanks
 

Similar Topics

I have an expression in a structured text routine of a Logix controller that looks more or less like the following: ResultInteger := Integer1 *...
Replies
13
Views
389
This application has a motor with encoder feedback that drives a linear actuator that moves in/out, and is at roughly 45 degs from horiz. As the...
Replies
19
Views
1,365
Hi all. First time programming a machine of this type. A center driven unwind feeding to a center driven rewind. No dancers or load cells, just...
Replies
37
Views
4,894
Hello, Been a while since I posted , Still sucking air been a interesting 3.5 years the dreaded health with old age scenario. Back at it and had a...
Replies
11
Views
2,057
Hello: Some time ago I wrote some basic code for a GuardLogix, in which I needed to add and subtract tags of LINT data type. When tried to use the...
Replies
13
Views
3,753
Back
Top Bottom