TAGGED: mechanical, mechanical-apdl, voltage
-
-
October 12, 2020 at 10:05 am
Luigi0
SubscriberHi,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 -
October 12, 2020 at 2:46 pm
Rahul Kumbhar
Ansys EmployeeCan you please confirm if the csv format is correct? If you open the file in notepad, the values should be separated by commas, n -
October 12, 2020 at 3:20 pm
Luigi0
Subscriberthanks for the answer. I check and my values are separated by semicolon ;. Should I change with commas?n -
October 16, 2020 at 9:11 am
Rahul Kumbhar
Ansys EmployeeYes, the values should be separated by comma.n -
October 16, 2020 at 9:54 am
Luigi0
SubscriberThanks, now it works.n
-
Viewing 4 reply threads
- The topic ‘error in using the TREAD command’ is closed to new replies.
Innovation Space
Trending discussions
Top Contributors
-
6575
-
1906
-
1463
-
1311
-
1022
Top Rated Tags
© 2026 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.