-
-
October 22, 2024 at 1:57 pm
yair.oros
SubscriberHey! have a good day.ÂI am trying to create a function in suite that reads a number from a file and then just put it in a variable. I wish to increase this until read information of a flight but I am doing test first with a number.ÂI achieved create the imported function that contains code C, instantiated in the function of suite. It build and simulates but when I will try to start the simulation a pop-up window show: "An exception has occurred: access violation" I think is for the "fopen" in my code, but I wish to know if there are some way to take this data from a document.Please could someone helps me?ÂI add here my c code and the imported function instantiated in suite. -
October 23, 2024 at 9:17 am
Romain Andrieux
Ansys EmployeeHello,
Â
In your situation, you are using format string "%d" which will read an int; however numActual is of type kcg_int8 which is by default a 'char', causing an Access Violation (since you are trying to write 32bits into 8bits) when perfoming the fscanf. To fix it you can change the string formating to "%c".Â
Hope this helps.
Â
Best Regards
Romain
-
October 23, 2024 at 10:18 pm
yair.oros
SubscriberThanks! the observation were really useful, and guide me to change the return in my function a cast with the int value.
-
Viewing 2 reply threads
- You must be logged in to reply to this topic.
Ansys Innovation Space
Trending discussions
Top Contributors
-
3467
-
1057
-
1051
-
918
-
896
Top Rated Tags
© 2025 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.