Sign in to follow this  
Followers 0
seroke

Creating a Servo Motor Home Operation Function Block with Axis Indexing ?

5 posts in this topic

Hello everyone,

I'm writing a block in GX Works3 to perform the "Home" operation of a servo motor.
(The algorithm inside the block has been tested and is working.)

However, in projects with many servo motors, I want to use the block.
The axis number will be requested from input the block, and the value received needs to be indexed into the places labeled as "Axis" within the block.

And I need values like (4*(AxisNo))+2 inside some structure labels.

The function block I want to create will look like the attached file.

Which methods should I use to achieve this, and how can I do it?
I tried using arrays but couldn't succeed.

 

Example; If I enter a value of 2 for the Axis, the labels below will look like this:

FX5SSC_1.stnAxCtrl2_D[Axis].uPositioningStart_D.0                               ====> FX5SSC_1.stnAxCtrl2_D[2].uPositioningStart_D.0         
FX5SSC_1.stSysCtrl_D.uExternalInputOperationDevice1_D.(4*Axis+2)   ====> FX5SSC_1.stSysCtrl_D.uExternalInputOperationDevice1_D.10

 

 

home.jpg

Share this post


Link to post
Share on other sites

Why not use the existing FB for poisitioning and use 9001 ?

440SSC_Home.jpg

Share this post


Link to post
Share on other sites
On 15.10.2024 at 14:52, Gambit said:

Mevcut FB'yi konumlandırma için kullanıp 9001'i neden kullanmıyorsunuz?

440SSC_Anasayfa.jpg

Hello Gambit ,
this block can only be used for "set method".
I use "count method 2". That is, I make Home with an external sensor signal.

Share this post


Link to post
Share on other sites

Can you write logic in your function block to calculate the value and then use the value?  There's no way I know of to use a formula directly on an array index, but point the index at a variable and calculate that value...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0