From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
06-12-2017 09:43 AM
Hello, I wanted to create a file where its name is written during simulation and always with the date and time. I tried to add the "open / create a file" and instead of putting a path in command I put a concatenated string consisting of the date and time and a command string where I will write The name and then I converted this string to path but I still have a 1430 error. But also I wanted to choose the file type (.txt or .csv) during simulation.
06-12-2017 10:52 AM
Show us your code so we can figure out what you did wrong. Generally, you should be using the Build Path to create the path for your file. In your instance, it sounds like you provided an incomplete path.
06-14-2017 06:13 AM
this is my code
06-14-2017 06:35 AM
06-14-2017 07:33 AM
sam2017 a écrit :
this is my code
There is a pretty obvious race condition in your code. Nothing prevent the sequence at the right to be executed before the code at the left. In this case the File To Save local variable would not have been written by the code at the left resulting in error 1430.
Ben64
06-14-2017 12:39 PM
@sam2017 wrote:
this is my code
There is a small issue in your VI. There are no delimiters between the values that you write to file. I like to use "Format Into String" rather than using multiple Number/String Conversions. It looks cleaner. I'm assuming you are writing a CSV file with comma delimiters.
06-15-2017 08:10 AM
thanks for your help but i still have some issue.
when i excute the program the file's name become for example " 2017_06_15_14_42_29_test.txt"
but when i rexcute it a new file is created and its name becomes " 2017_06_15_14_42_50_2017_06_15_14_42_29_test.txt"
when ever i rexcute the present date will be added to the previous file name.
otherwise i need a new file to be created with a new name and date.
06-15-2017 08:15 AM
because, from the original file-path,
the directory is extracted and the filename,
which is then prepended with the date.
if you select a file as input, that has already a date in the name, the new date will be prepended.
just hardcode the file-name suffix in your vi
06-16-2017 06:07 AM
how can i do it ?
can you help me with that?
06-16-2017 06:18 AM
@sam2017 wrote:
how can i do it ?
can you help me with that?
Just get rid of the "chemin" local variable and your previous data/time will not be part of the file name.