Jump to content

Created a data table but really struggling to write to them


Recommended Posts

UN-USC-B5-B1
unilogics

Want to record certain data from the ladder into my data tables 

temp

time run

load number 

user log in name log in log out times 

To be stored on SD card 

got date and time to work 

etc 

 

 

Link to comment
Share on other sites

Hard to help without seeing your logic so far, but here goes anyway....

The data types you are trying to write to the table must match the data types set-up in the Data Table columns struct.

For the User name and login, logout times, you can use the event tags in the User Access Control struct to detect each time a user logs in or out. There will be some code required to save a "TimeStamp" to each event

The instructions used differ, depending on the type of data table created. If you are using an indexed data table, the easiest way is to use the insert row instruction. The existing data gets pushed down a row and the new data writes to the row number defined in the instruction. If you always insert at row 0, the table acts much the same as a FIFO table, deleting the last row of data(first-in) once the table is full.

To save the table's contents to SD card, use the Store DTI to File instruction. That instructions gives you some options such as whether to overwrite the file, append to the file, row # to start from and whether to create a .csv file, .csv-zip file, .udtf file or all types.

 

  • Thanks 1
Link to comment
Share on other sites

  • NoamM changed the title to Created a data table but really struggling to write to them

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...