Jump to content

Recommended Posts

Posted

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

Posted
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.

Posted

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...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...