Menu

if Array Size is undefined rte crashes

2014-09-11
2014-09-18
  • raz ben jehuda

    raz ben jehuda - 2014-09-11

    Hello

    I defined an array as input to a simple FB without a size. when testing this FB it crashed the rte. when size is defined then the rte is not crashed.

     
  • Zoitl Alois

    Zoitl Alois - 2014-09-11

    How are you defining an array without size? In 4DIAC-IDE you need to specify the inputs datatype and if it should be an array its array size. Otherwise it will be a single value input. The reason for this is that IEC 61499 is a strongly typed language where all variables need to have a defined data type.

     
  • Georg Neugschwandtner

    Could you provide a list of steps how to reproduce the error you are describing? The point is that the UI should not allow you to define an array without a size. If it does, this is something that needs to be fixed.

     
  • raz ben jehuda

    raz ben jehuda - 2014-09-15

    thank you Georg and Alois for your help. Here are the steps:
    1. define a simple function block type.
    2. define its QI to array type.
    3. do not set the array size , but leave it as-is.
    4. export the function block. compile it cpp/h presentation to an rte ( linux ).
    5. launch rte
    6. launch FBTester.

    rte would crash.

     
  • Zoitl Alois

    Zoitl Alois - 2014-09-15

    Hi,

    thanks for the clarification this helps us to trace this done. I already saw that the array code in FORTE needs to add further checks to handle this situation more gracefully.

    However there is a major issue how you are specifying arrays. IEC 61131-3 defines for arrays that the always have to have a data type and a fixed defined length. As IEC 61499 takes the data type definition from IEC 61131-3 the same applies here. So to have a data input as an array, you first need to select what kind of data the array should hold (e.g., INT) and also the size of the array.

    So from your description I think there should be a further check in 4DIAC-IDE that would not allow to do your step 2.

    Just to be sure that I understood you correctly: you have a data type "ARRAY" in your list of available data types?

     
  • raz ben jehuda

    raz ben jehuda - 2014-09-15

    yes. I do have the data type ARRAY . At the moment I assume it is an array of integers. also, what would happen if i connect two arrays ( output to input ) of different sizes ?

     
  • Zoitl Alois

    Zoitl Alois - 2014-09-15

    Ok this is not good. ARRAY should not be there. Please use INT and the appropriate size.

    If you have different sizes. FORTE gracefully makes a save copy of the smaller size.

     
  • raz ben jehuda

    raz ben jehuda - 2014-09-18

    what is the size of INT ? where can i get this information ?

     
  • Zoitl Alois

    Zoitl Alois - 2014-09-18

    IEC 61499 uses the datatypes defined in IEC 61131-3. There INT is defined as 16Bit signed integer.