unsupported operation in function

PaolaAG
PaolaAG
Altair Employee
edited August 2022 in Community Q&A

Hello, I have this error "unsupported operation in function OmlBlockFunction at line number 8 in file OmlBlockFunction_1.oml ( -1 )"

This is my function

image

I was wondering if somebody knows how to solve it. Thank you!

Best Answer

  • João Marabisa
    João Marabisa
    Altair Employee
    edited August 2022 Answer ✓

    Thank you so much! The function now works, but when I place it inside the Oml Block doesn´t work, do you know if I have to stablish some state or parameter?

    Hi Paola,

    When you use "OmlCustomBlock" you must use "vssGetInputData" function to get the block's input data, and to export them you must use "vssSetOutputData" function.

    I'm attaching a .SCM file with your desired function.

    Below you have the results between the previous (.OML) vs. actual (.SCM) files:

    image

    Hope it helps you,

    João.

Answers

  • João Marabisa
    João Marabisa
    Altair Employee
    edited July 2022

    Hi Paola,

    Once you are setting a function, you must include an 'end' command after line 18 (this 'end' is referring to the if's).

    I changed what I mentioned above, and it worked (attached).

    Hope it helps you,

    João.

  • PaolaAG
    PaolaAG
    Altair Employee
    edited July 2022

    Hi Paola,

    Once you are setting a function, you must include an 'end' command after line 18 (this 'end' is referring to the if's).

    I changed what I mentioned above, and it worked (attached).

    Hope it helps you,

    João.

    Thank you so much! The function now works, but when I place it inside the Oml Block doesn´t work, do you know if I have to stablish some state or parameter?

  • João Marabisa
    João Marabisa
    Altair Employee
    edited August 2022 Answer ✓

    Thank you so much! The function now works, but when I place it inside the Oml Block doesn´t work, do you know if I have to stablish some state or parameter?

    Hi Paola,

    When you use "OmlCustomBlock" you must use "vssGetInputData" function to get the block's input data, and to export them you must use "vssSetOutputData" function.

    I'm attaching a .SCM file with your desired function.

    Below you have the results between the previous (.OML) vs. actual (.SCM) files:

    image

    Hope it helps you,

    João.

  • PaolaAG
    PaolaAG
    Altair Employee
    edited August 2022

    Thank you!