Jump to content

Recommended Posts

I like to link different Data Tables (Indexed) to one Function as IN parameter.

Has someone done this already? What I'm doing wrong? (Please see example Function1 Rung 1; Direct linking is possible Function1 Rung 2)

 

Test_Function_In_DT_Indexed.png

Link to post
Share on other sites

hi Daniel_EWW,

i think that the "problem" is that the DT_Index as FunctionIn variable is not able to define the type/lenght of sructure that it is referring (seems somthing like late binding)...then is not able to let you select the right local or global structure variable to store the "value".

Link to post
Share on other sites

A data Table is an array of structs in that matter.

The only way, currently, to work with a Data Table that is passed to a function is the function is a C function, and then work with pointers in order to read and write data from that table.

It is not a nice code, and I know someone from another department in our company that did that. And there is also a limitation. The C function knows the type of the struct that is used in the data table. It is not like you can define a generic function that can work with any data table structure.... It just let you pass the Data Table as a reference (so if you have 2 tables of the same struct, then you can pass a different table each time).

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...