Is it Possible to define a SF_TableTypeB_Read in an ST function Block

I am currently working on modularizing our software and wanted to create an instance of SF_TableTypeB_Read inside a Structured Text (ST) function block.

Although the help documentation does not mention any limitations regarding the use of SF_TableTypeB_Read in Function Blocks, I am receiving the following error:

SL1.SM1 “TableSource_1” E#0x4F “Table is used in code, but table parameter ‘TableSource_’ is ‘NOT used’, or vice versa”

the Call in the FB does Look like this:

LookUpTable_ReadSteeringAngle(Activate := TRUE, S_X_In := SteeringAngleDeg, S_Y_In := SAFEDINT#0, S_Z_In := SAFEDINT#0, S_TableID := SAFEINT#1);

Does anyone have experience using table objects and possibly know how to use tables inside a function block?

Hi @Sadek96 ,
Welcome to the Community!
I didn’t use that FUB so far but in the Integrated safety technology User’s manual 6.4.0 there is exactly your case: Subsequently loading a Safe Commissioning Table(page 2602) .
They don’t use ST for the implementation but the example explains step by step want you need to do; it’s possible something is missing in your prj.

Ciao
Valerio

Hi @valerio.manenti,

thank you for your reply. However, the example only demonstrates how to use it in the main program and does not show how to implement it within a separate function block.

Hi @Sadek96 ,
I have reproduced your error with just one FUB and one Worksheet in LD/SFC language (AS 6.5.1.7, mappSafety 6.4.1):


maybe…just one thought…Have you tried to use SF_TableTypeB_Read on the main program and not inside a FUB as described on the manual?
———————————
This is how I have fixed my issue:

  1. I have configured type of table (B):

  1. I have clicked on “Edit” (Automatically AS generates one called Table01.csv):

  1. I have clicked on “Lock“

  1. no issue during the build:

At the end I didn’t configure in proper way my Table. I’m positive you have the same issue.

Thanks
Ciao
Valerio

1 Like

Hi @valerio.manenti

Yep, that was it—thank you very much. It was a bit confusing because I had it defined in my main POU, and it still worked, but not anymore when it’s defined in an FUB. it was only beacuse i’v created a new Safety Program and didn’t lock the Table :sweat_smile:

1 Like