Ansys Assistant will be unavailable on the Learning Forum starting January 30. An upgraded version is coming soon. We apologize for any inconvenience and appreciate your patience. Stay tuned for updates.
General Mechanical

General Mechanical

Topics related to Mechanical Enterprise, Motion, Additive Print and more.

error in using the TREAD command

    • Luigi0
      Subscriber
      Hi,nI am trying to apply a sinusoidal voltage on a surface (name of the surface is pos) of a piezoelectric layer. I create a table (2 columns: time vs voltage) in excel and I save it as CSV file. Then I found an example https://www.simutechgroup.com/tips-and-tricks/fea-articles/227-using-tread-in-ansys-mechanical-apdl-to-read-external-data) on the use of TREAD command in oder to read csv file in ansys mechanical.nnto_skip=0      ! enter number of lines to skip--NONE in this examplen/INQUIRE,numlines,LINES,data_example,csvnto_read=numlines-to_skipn!n*DEL,mytable,,NOPRn*DIM,mytable,TABLE,to_read                ! table array to hold datan*TREAD,mytable,data_example,csv,,to_skipn! Apply time varying voltagend,pos,volt,%mytable%nnI adapt this script to my purpose: data_example is substituted with my file's name and I want that the first line of the table is skipped so I write to_skip=1. I get an error TREAD cannot read the csv file. But I don't know where the error is. Any help?n(I am using ansys 19.1, and this is a transient structural analysis)n
    • Rahul Kumbhar
      Ansys Employee
      Can you please confirm if the csv format is correct? If you open the file in notepad, the values should be separated by commas, n
    • Luigi0
      Subscriber
      thanks for the answer. I check and my values are separated by semicolon ;. Should I change with commas?n
    • Rahul Kumbhar
      Ansys Employee
      Yes, the values should be separated by comma.n
    • Luigi0
      Subscriber
      Thanks, now it works.n
Viewing 4 reply threads
  • The topic ‘error in using the TREAD command’ is closed to new replies.
[bingo_chatbox]