How to include SPS file

  • Hello all, i hope the way i am asking question is right :/ if not, i am sorry in advance.

    My question is:

    i am gonna scan a 300mm x 300mm area with an inductive sensor and then If this sensor perceives a metal surface, there will be a process that calculates the center point of the metal piece.

    I wanna use SPS file to make sensor check whether there is metal or not, but i dont know how to include SPS file to the SRC file to make them work together

  • AD
  • You are on the wrong road.

    You should check the sensor in the main program during movement, otherwise you will run into problems with synchronization of the two processes.

    Search for interrupt / resume here in the forum.

  • You are on the wrong road.

    You should check the sensor in the main program during movement, otherwise you will run into problems with synchronization of the two processes.

    Search for interrupt / resume here in the forum.

    hermann actually i already did it as you wrote and it worked well, but now my mentor wants me to do it by using SPS file :/

  • I am reading between the lines here but maybe your mentor wants a separate function/program/subroutine instead of everything written in 1 .src file.


    Because using the SPS is like what hermann said it doesn't make any sense.

    Every problem has a solution, that isn't the problem. The problem is the solution.

  • Hello all, i hope the way i am asking question is right :/ if not, i am sorry in advance.

    My question is:

    i am gonna scan a 300mm x 300mm area with an inductive sensor and then If this sensor perceives a metal surface, there will be a process that calculates the center point of the metal piece.

    I wanna use SPS file to make sensor check whether there is metal or not, but i dont know how to include SPS file to the SRC file to make them work together

    Maybe giving away too much here but your teacher probably wants something like this in SPS


    IF inductive_sensor THEN
    metal_surface = TRUE
    ENDIF

    then you can use the metal_surface in .src and do the calculations there
    The reason might be as Leon said.

  • it makes no sense involving SPS in this. SPS is a low priority task that runs asynchronously to robot program. there is no point in discussing this further unless goal is to show how result becomes less accurate.

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • Quote

    i'll try what dogeautomate said

    why?! Because A it should not be in the SPS! and B it is also incomplete, ask yourself when is metal_surface become false? if the answer is when inductive_sensor is false then congratulations you just added a few pointless lines of code.

    Every problem has a solution, that isn't the problem. The problem is the solution.

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