Jump to content

Name of new files


Recommended Posts

Hi,

I like to create a kind of log file after before my LV programm is closed (only if a failure exists).

The first log file was OK, but now I notice that the file names of the created log files must be expedient for later checks. My idea is, give the files a standard name e.g. log error messages. Then add the current date and time to this file name.

But how can I manage this? :headbang:

Link to comment
Hi,

I like to create a kind of log file after before my LV programm is closed (only if a failure exists).

The first log file was OK, but now I notice that the file names of the created log files must be expedient for later checks. My idea is, give the files a standard name e.g. log error messages. Then add the current date and time to this file name.

But how can I manage this?  :headbang:

1722[/snapback]

Hi,

I supposed you can put the name of file with the code error, with the tool unbundle by name you can selected the error code, and then convert to a string with Number to decimal string. So you are able to put this string in a name of file.

sorry for my bad english

bye

post-645-1094811756.jpg?width=400

Link to comment
Hi,

I supposed you can put the name of file with the code error, with the tool unbundle by name you can selected the error code, and then convert to a string with Number to decimal string. So you are able to put this string in a name of file.

sorry for my bad english

bye

1723[/snapback]

Oh, I just find an icon which can convert a path to a string :)

I used my builded date and time sting connect this with link strings. :yes: This string is able to connect at standard name from open/create/replace a file (there I used <create> but I get a dialog which I don't want)

Link to comment
Oh, I just find an icon which can convert a path to a string  :)  

I used my builded date and time sting connect this with link strings. :yes: This string is able to connect at standard name from open/create/replace a file (there I used <create> but I get a dialog which I don't want)

1724[/snapback]

if you don't want the dialog this example can help you, i used this in my project and this save the date automatically in file without appear a dialog

Bye

post-645-1094817239.jpg?width=400

Link to comment

Hi!

I have still problems with replacing a string.

I find an example in the LV help about this - "search string and replace.vi"

I built the same code in my vi and test it. But there is no change. The same stings comes out as the string which go in :headbang:

So I take the example, made a sub vi and paste it in my code.

Second test. I saw how the string goes in, the string was displayed in "string in". Then the character to replace and the new character were set. After this the replaced string was displayed in "string out".

But at the end the unreplaced string comes out :o

I will replace a : with a _. In the time/date string I build the time is displayed like this: 09:20. And windows don't like : in a path name :headbang:

What can be the problem?!

Link to comment
Hi!

I have still problems with replacing a string.

I find an example in the LV help about this - "search string and replace.vi"

I built the same code in my vi and test it. But there is no change. The same stings comes out as the string which go in  :headbang: 

So I take the example, made a sub vi and paste it in my code. 

Second test. I saw how the string goes in, the string was displayed in "string in". Then the character to replace and the new character were set. After this the replaced string was displayed in "string out". 

But at the end the unreplaced string comes out  :o  

I will replace a : with a _. In the time/date string I build the time is displayed like this: 09:20. And windows don't like : in a path name  :headbang: 

What can be the problem?!

1737[/snapback]

Hi,

you see the result of terminal offset past replacement? i think the character ":" is one of the Codes are enabled to show nonprinting characters and if you try on the example search string and replace.vi the character "\" don't replace :(

you can convert your time for seconds and you loose the problem":" :wacko:

bye

Link to comment

Hi Sarah,

So I take the example, made a sub vi and paste it in my code.

Second test. I saw how the string goes in, the string was displayed in "string in". Then the character to replace and the new character were set. After this the replaced string was displayed in "string out".

Just wondering (also happens to me sometimes) if you accidetally wired the input of your replace-subvi instead of its output?

Another possibility: if you have the timestamp as either seconds timestamp-type then you can wire it to the Format Date/Time String in the Time & Dialog palette.

You can also use this function if you just want the actual time, then do not wire the input timestamp.

Didier

Link to comment
Hmmm, but inside of the example vi, it will replace this character  :wacko:

But I don't get this replaced sting out, I only see it in the string display field "string out"

1739[/snapback]

Can you post an image of your diagram where this VI is used? It looks like your "replace.vi" is working fine from what I can see on the front panel. How is this VI used in the caller?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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

Important Information

By using this site, you agree to our Terms of Use.