Denso programming function

  • Hi to all, i'm new to denso programming on wincaps III.

    This is my problem: in my main i have


    Sub Main
    If MyFunction(10) > 0 Then

    ' do something

    End If
    End Sub

    And MyFunction is:


    Function MyFunction(number As Integer) As Integer

    Dim new_number as Integer

    new_number = 5
    MyFunction = number*new_number
    End Function


    Ok and all works well.

    But if i want to pass to MyFunction an argument that is used on a Wait IO[signal] = ON instruction?

    How i can do that ?


    Because i want to check this signal in a Function like


    Function MyFunction(signal As IO) As Integer

    Dim response As Integer

    response = 0

    Wait IO[signal] = ON, 3000, response

    MyFunction = response

    End Function


    Thanks a lot for your support.

  • markolino

    Changed the title of the thread from “Denso programming finction” to “Denso programming function”.
  • I have a project developed by someone.

    And all the IO are defined in the DIO_TAB.h file by these lines for example:

    #define myInput 10 '

    #define a_myInput 11 '

    #define b_myInput 12 '



    So i suppose that 10, 11, 12 are the integer number of the input that is used like a parameter to MyFunction.

    It is correct ?


    Thanks a lot

  • if you have pre-defined information in header, than you need to include the header file into your main program. Let me show you:


    Here is my MyTask.pcs

    DIO_TAB.h

    Code
    '!TITLE "Denso robot program"
    '#define <constance> <Strings>
    #define myInput 10
    #define a_myInput 11
    
    #define b_myInput 12

Advertising from our partners