Jump to content

Using DT in C function


Igi

Recommended Posts

Hello,

 

I don't believe you can address the data table directly in the C function.  You would have to perform a 'read row from DTI' to put the row information into a tag.  Then pass this tag (which will be a struct) into your C function.

 

It is important to note that when passing the struct into a subroutine, the struct will update with each scan since it is a passed in by reference.  You will not have to pass the struct back out - it will be updated as it moves through the subroutine.

 

Hope this helps.

Link to comment
Share on other sites

Hello,

 

I don't believe you can address the data table directly in the C function.  You would have to perform a 'read row from DTI' to put the row information into a tag.  Then pass this tag (which will be a struct) into your C function.

 

It is important to note that when passing the struct into a subroutine, the struct will update with each scan since it is a passed in by reference.  You will not have to pass the struct back out - it will be updated as it moves through the subroutine.

 

Hope this helps.

Thank you, but it is possible to use directly DT, but in last version of Unistream you can choose type of input DT then in C code is automatically generated this structure:

typedef struct

{

  unsigned int BufferPointer; // BufferPointer

  unsigned int EntrySize; // EntrySize

  unsigned int Number_of_rows; // Number of rows

  unsigned int Signature; // Signature

  char Status; // Status

  char PadUInt[3]; // PadUInt

} Data_Table_Indexed; // Data Table: Indexed

but I do not know what to do with these members of the structure( I know C programming very well and I can work with structures etc.) . I mean how to get data from that. I tried to read from all, I tried to write one of them then read from the others etc...,  but I have got just garbage values...

Link to comment
Share on other sites

Thank you, but it is possible to use directly DT, but in last version of Unistream you can choose type of input DT then in C code is automatically generated this structure:

typedef struct

{

  unsigned int BufferPointer; // BufferPointer

  unsigned int EntrySize; // EntrySize

  unsigned int Number_of_rows; // Number of rows

  unsigned int Signature; // Signature

  char Status; // Status

  char PadUInt[3]; // PadUInt

} Data_Table_Indexed; // Data Table: Indexed

but I do not know what to do with these members of the structure( I know C programming very well and I can work with structures etc.) . I mean how to get data from that. I tried to read from all, I tried to write one of them then read from the others etc...,  but I have got just garbage values...

Please e-mail into support@unitronics.com for more information on this topic.

 

As far as I am aware, this type of input for a C function is only to configure a data table.  But I do not believe it will allow you to read/write from a specific data table.

Link to comment
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...