CFBFP Posted December 29, 2014 Report Share Posted December 29, 2014 Hi i have made a datatable with 50 rows and 5 colums in Unilogic. How can I read a row of this datatable and directly put them in my global variables? (These global variables are used in my program to do more calculations with) In Visilogic, this was very easy with the function "Read row from Datatables": you select the rownumber and had to fill in the source cells and direct them to the destination global variables. I want to do the same in Unilogic. Can someone help me? thank you in advance. Link to comment Share on other sites More sharing options...
s.pratt Posted December 29, 2014 Report Share Posted December 29, 2014 Hello, In UniLogic, you must create an instance of the struct you used for the data table format. This basically means you must create a tag with the "type" being the struct. You can find the struct you used for the data table format near the bottom of the "type" list. This tag you created will ensure the same data, in the same orientation as the columns are listed out, will be transferred correctly. Also, it was designed to help to organize your data. Once this is complete, you can use the read row function block for the according data table you used (LIFO, FIFO, Indexed) and pass that row data into your tag instance described above. You can then call the individual tags by calling the data table, then the specific data. (Example: Data_Table.Column1Data) Please let us know if this helps. Link to comment Share on other sites More sharing options...
CFBFP Posted December 31, 2014 Author Report Share Posted December 31, 2014 Hi, if will try this first, but i'm not sure if i understand fully. I still have to find out if the members of the new created struct can hold global variables or if they are only cells that i have to select with row, column to transfer them in the variable i want. As i understand now there are 3 steps: - making the datatable - creating a new struct that meets the datatable to transfer values - selecting the values with row/column and finally transfer them in my variable where if want it thank you for your answer, i let you know if i succeeded. Link to comment Share on other sites More sharing options...
s.pratt Posted December 31, 2014 Report Share Posted December 31, 2014 Hi, if will try this first, but i'm not sure if i understand fully. I still have to find out if the members of the new created struct can hold global variables or if they are only cells that i have to select with row, column to transfer them in the variable i want. As i understand now there are 3 steps: - making the datatable - creating a new struct that meets the datatable to transfer values - selecting the values with row/column and finally transfer them in my variable where if want it thank you for your answer, i let you know if i succeeded. Hello again, I apologize if I gave you any confusion. But your steps look to be correct to me. Please allow me to clarify how the structs are working: When a struct is created, you are basically creating a format. No tags are associated with the structs created in the struct tab. They are just for formatting, or you could look at the as a "configuration file". This is why you must created an "instance" of the struct in the global tags list. Let me know if this helps. Link to comment Share on other sites More sharing options...
CFBFP Posted January 5, 2015 Author Report Share Posted January 5, 2015 Hi this helped a lot. It is clear to me know and can use datatables fully as i wanted. It is even more flexible as in Visilogic in my personal opinion. many thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now