Jump to content

Retrieving info from table using 'Read Row from DTI'


Exouxas

Recommended Posts

G'day!

I'm having some issues retrieving info from a specific row in a table, is there an easy way to do this?
I've tried using "Read Row from DTI", but it asks me to use a struct as an output with the same row structure, but I want this rows output to go into a single variable.

 

Thanks,
Exouxas

Link to comment
Share on other sites

Hello Exouxas,

 

Thank you for using our Unitronics Forum.

 

In order to pull a row from a data table, you must put it in an "instance" of the struct the data table was formed from.  (An instance is a variable with the "Type" being the struct)  Once this data is pulled, you can drill into this variable of the struct to pull single variables.  This architecture was created to organize and ensure proper data transfer.

 

So, lets say I have a program for recipes, and I have a data table with two columns based off my struct:  column 1 = recipe name, column 2 = motor speed (for mixer).  To get the motor speed, I use a read data table row, put that info into an instance I call "Run Recipe", and to get the motor speed, I would click within a box that supports and integer, choose "Run Recipe" then choose "Motor Speed".  It will appear as "Run Recipe.Motor Speed" in the integer box.

 

Please let us know if this helps.

Link to comment
Share on other sites

Nope, I'm still lost.

 

What I have is a two-way "encoding" that turns decimals to hex"ish" (0-J instead of 0-F) and puts it in a string. And the other way.

I have a table with one column that contains the Hex"ish" and I plan to use the row number as the decimals.

Link to comment
Share on other sites

OK, you will still need to create an instance to extract the data to.  Within the global tags list, click the add new tag button, and give this tag the name of "Data Table Row Info" or something of that sort.  Then, under the "Type" scroll down to the bottom selections and you should see you struct you created for the data table.  Select this struct and save the tag.

 

In your read row from data table function block, you should now be able to select the instance you created.  Wherever you wish to put that information, you will have to call it as "Data Table Row Info.*****". 

 

It was created like this to ensure the data table row extracted matched the data types it was being entered into.  Unfortunately, we are unable to extract a data table cell from the data table at this time (even though you only have one column to search from).  We can only extract rows via the row number.

 

A good video to watch, which can probably explain this feature better than I over the forum, is the tutorial on Data Table Indexed on our youtube page.  You can find the link to this page on our web page www.unitronics.com/support/webinars under the title "UniStream Tutorial Webinars".

 

Let us know if this helps.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.