Structured text newbie

Thank you! :geek:

Below is code for servo driven press section of machine.

The program doesn't have a MAM anywhere to be found. Coincidentally, the 19 parameters between ( ) are the same number (19) as a MAM instruction.

MOV on the other hand oly has (10 parameters)?
This press moves two servos at once A416 and A416.
I omitted A416 at the bottom (duplicate of Positioner A415)

// PRESSORI MOTORIZZATI //
MOV_GUIDE(A415_MoveGuide,CICLO_PRESSORE1mot,A415_Posizionamento_ok,A415_Errore,Marcia_Assi,RESET_ASSI,TIME_CLOCK,Errore_Guide_PRESSmot1,A415_Start,A415_MoveGuideDurata);
MOV_GUIDE(A416_MoveGuide,CICLO_PRESSORE2mot,A416_Posizionamento_ok,A416_Errore,Marcia_Assi,RESET_ASSI,TIME_CLOCK,Errore_Guide_PRESSmot2,A416_Start,A416_MoveGuideDurata);

Positioner(A415_Motion,
A415Axis,
A415_TARGET_POS,
A415_LIM_MIN,
A415_LIM_MAX,
0,
A415_Start,
RESET_ASSI,
Immediate_ESTOP_F,
Delayed_ESTOP_F,
0,
A415_Velocity,
A415_Acc,
A415_Dec,
A415_Posizionamento_ok,
A415_Homed,
A415_Locked,
A415_Errore,
A415_ErrCode);


No one answered this so I will and as I noted I know very little RSLogix..anything.


I think this needs knowledge of RSLogix5000 platform, RSLogix motion control and Structured Text in general. Why I think that:


Whatever that "Positioner" is should've been recognized by your right away if you are familiar with the platform,ADD_ON meaning it is either a call to routine (sub routine or whatever it is called) or it maybe some motion control datatype which would've bee declared as a tag/variable somewhere or actual native instruction (I couldn't find it).


Since this is way beyond me I will answer your original post with links that I think should be helpful:


Motion control video tutorials (look for RSLogix ones in the list)



RSLogix structured text.


RSLogix motion control instructions.



Structured text video tutorial (way too basic but search their playlist they may just have more.


The instructions should look same whether in LADDER or ST, that is the instruction will have the same input, output and Input_Output formal parameters whether in ST or LADDER, the difference is in LADDER it is graphical and in ST it is not so much, they are between parenthesis. In other platforms we get context help to show us the parameters as we are typing them in and if we do not provide all the *required* parameters the compiler would produce and error.
Again depending on the platform (I think) I may have to write the formal parameter name then assign a tag to it, I can not just list the tag in between the parenthesis, and in any case it is good practice to do so even though it stretches the code quite a bit.


So the call would like MAM(Axis:=myAxis, MotionControl:=myMOT_CTRL, MoveType:=diMove_Type, Position:=myRealPosition,*****etc all the way to the end);

Outputs are assigned this way (myTag => Formal_Parameter)


It is quite the learning curve so take your time is the quickest way to get where you want.
 
Cleaned up.


No one answered this so I will and as I noted I know very little RSLogix..anything.


I think this needs knowledge of RSLogix5000 platform, RSLogix motion control and Structured Text in general. Why I think that:

Whatever that "Positioner" is should've been recognized by you right away if you are familiar with the platform, meaning it is either a call to a routine (ADD_ON, sub routine, etc) or it maybe some motion control datatype which would've been declared as a tag/variable somewhere, or actual native instruction (I couldn't find it).

Since this is way beyond me I will answer your original post with links that I think should be helpful:

Motion control video tutorials (look for RSLogix ones in the list)

RSLogix structured text.

RSLogix motion control instructions.

Structured text video tutorial (way too basic but search their playlist they may just have more.

The instructions should look the same whether in LADDER or ST, that is the instruction will have the same input, output and Input_Output formal parameters whether in ST or LADDER, the difference is, in LADDER it is graphical and in ST it is not so much, they are between parenthesis. In other platforms we get context help to show us the parameters as we are typing them and if we do not provide all the *required* parameters the compiler would produce an error.
Again depending on the platform (I think) I may have to write the formal parameter name then assign a tag to it, I can not just list the tags in between the parenthesis, and in any case it is good practice to do so even though it stretches the code quite a bit.

So the call would look like:
MAM(Axis:=myAxis, MotionControl:=myMOT_CTRL, MoveType:=diMove_Type, Position:=myRealPosition,*****etc all the way to the end);

Outputs are assigned this way (Formal_Parameter => myTag)

It is quite the learning curve so taking your time is the quickest way to get where you want.
 
I think I'm far from getting it.

So what all is involved in making the Axis move?
Surely not merely changing the target position.

With ladder (generally) you would give several comands; mso, mam, etc.

If Mam is a ST command, why don't I see one?

Can someone please look at the code in post #12 and shed some light on what I'm looking at?

Are the items listed in () conditions the all must be true for "Mov_Guide" to be true?

"Positiiner" on the other hand seems to have parameters within () assigned. Is this the command to move the drive?

Why is everything all grouped together on the top, but nicely listed on the item at the bottom?
Does the format make a difference?


Thanks,
John
 
Last edited:
I think this needs knowledge of RSLogix5000 platform, RSLogix motion control and Structured Text in general. Why I think that:

Whatever that "Positioner" is should've been recognized by you right away if you are familiar with the platform, meaning it is either a call to a routine (ADD_ON, sub routine, etc) or it maybe some motion control datatype which would've been declared as a tag/variable somewhere..

Thank you Kalabdel!
I have some experience with Logix5000 and motion but always in ladder.
I have programed in Basic years ago and know a little C so I ST shouldn't be too hard to follow.

I don't know what "Positioer" is off hand but I can search to find its origin.
There are no routes or srs for it.

All I know is A415 is the axis and the parameters listed are related to motor control.

I'll definitely check out some of the links and dig
a little further next week.

I appreciate your help.
 
Last edited:
Is it possible to post the .ACD file, that might make it easier to assist.
It looks like they could be ADD-On instructions, that will have the standard motion instructions inside (however this is just a WAG..)
 
I agree but can't figure out why duplicate an instruction with AOI, the parameters seem identical.


Doubleclick on the "Positioner" call and click F1.


Is there something similar to Siemens and CodeSys "Go to definition"?
 
Last edited:
Is it possible to post the .ACD file, that might make it easier to assist.
It looks like they could be ADD-On instructions, that will have the standard motion instructions inside (however this is just a WAG..)

I doubt I can upload a 14.1Mb file here.

I did not see an AOI for that axis.

Yes Kalabdel, "Positioner" is a datatype listed 27 times and "A415_motion" is one of its tags. If I expand this, I see 21 subtags?

20220320_073645.jpg
 
Actually after I wrote that I thought it could not be a datatype and that it is something that can be called or instantiated, like AOI or system function block (Siemens terminology).
Take more screenshots of Positioner specially of whatever made you think it is a datatype and someone knowledgable of AB may spot what it is. The screenshot you posted shows "Alias for" and I don't know what that means

If you are in Michigan that means I am not the only one who can't sleep.
 
Last edited:
"Positioner" shows up as an AOI and lists tag "A415_Motion" in S10810.

"Positioner" also shows up as DataType tag "A415_Motion"

Yes, I'm an early bird šŸ¦

20220321_094021.jpg 20220321_091914.jpg
 
The screenshot you posted shows "Alias for" and I don't know what that means.
From my understanding; Alias is basically an easier to read name for a tag that was a new feature to assign and save the name along with the program.
With newer versions Aliasing became unnecessary because tags and comments are now automatically saved along with the program. The Aias for tag A415 says Positioner (DataType)

Positioner is a Datatype, but also an AOI?

Unfortunately I can't click on the ST because I only have the standard edition at the moment.
I only have a hardcopy to review.
 
Last edited:
From my understanding; Alias is basically an easier to read name for a tag that was a new feature to assign and save the name along with the program.
With newer versions Aliasing became unnecessary because tags and comments are now automatically saved along with the program. The Aias for tag A415 says Positioner (DataType)

Positioner is a Datatype, but also an AOI?

Unfortunately I can't click on the ST because I only have the standard edition at the moment.
I only have a hardcopy to review.


Email it to me if you like and I will have a look and I can post *for you* any code you want help with. If that works, PM me.
 

Similar Topics

Hello, I am using studio 5000 pro and am trying to figure out the structured text. Here's my scenario: An operator scans a barcode, the barcode...
Replies
15
Views
284
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
417
Good evening. I display the step number of a SFC on a display. Sometimes, on a trip, it goes quickly through many steps and I need to prove to...
Replies
1
Views
153
I am trying to set up a piece of equipment with a Horner HE-X4R. I'd like to use structured text and so far I'm just trying to get a basic On/off...
Replies
0
Views
91
Good morning. I'm doing a rehab and I need to recycle some part of the old code that won't change and that I need. This is a calculation that...
Replies
22
Views
1,387
Back
Top Bottom