Sarah83 Posted September 10, 2004 Report Share Posted September 10, 2004 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: Quote Link to comment
Paulo Almeida Posted September 10, 2004 Report Share Posted September 10, 2004 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 Quote Link to comment
Sarah83 Posted September 10, 2004 Author Report Share Posted September 10, 2004 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. 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) Quote Link to comment
Paulo Almeida Posted September 10, 2004 Report Share Posted September 10, 2004 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. 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 Quote Link to comment
Sarah83 Posted September 10, 2004 Author Report Share Posted September 10, 2004 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 Quote Link to comment
Sarah83 Posted September 13, 2004 Author Report Share Posted September 13, 2004 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 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?! Quote Link to comment
Paulo Almeida Posted September 13, 2004 Report Share Posted September 13, 2004 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 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":" bye Quote Link to comment
Sarah83 Posted September 13, 2004 Author Report Share Posted September 13, 2004 :headbang: Hi, you see the result of terminal offset past replacement? i think the character ":" is one of the Quote Link to comment
Paulo Almeida Posted September 13, 2004 Report Share Posted September 13, 2004 Hi, I find this example in NI forun and can help you in the ':'. In this example they put the ':' it should help you Download File:post-645-1095094072.vi Quote Link to comment
didierj Posted September 14, 2004 Report Share Posted September 14, 2004 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 Quote Link to comment
Michael Aivaliotis Posted September 17, 2004 Report Share Posted September 17, 2004 Hmmm, but inside of the example vi, it will replace this character 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? Quote Link to comment
Sarah83 Posted September 17, 2004 Author Report Share Posted September 17, 2004 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? 1787[/snapback] Hi Michael, here a screenshot. Yes, I think the problem isn't in the "replace.vi", too. Quote Link to comment
xseadog Posted September 17, 2004 Report Share Posted September 17, 2004 Hi Michael,here a screenshot. Yes, I think the problem isn't in the "replace.vi", too. 1792[/snapback] Hi Sarah is it possible to do another screen shot with a probe set before and after your un named vi :headbang: ie just before your last concatenate string chow xseadog Quote Link to comment
Sarah83 Posted September 17, 2004 Author Report Share Posted September 17, 2004 Hi Sarah is it possible to do another screen shot with a probe set before and after your un named vi :headbang: ie just before your last concatenate string chow xseadog 1793[/snapback] This sub vi is the "replace.vi" Which string do you mean? Before the case? :question: Quote Link to comment
xseadog Posted September 17, 2004 Report Share Posted September 17, 2004 This sub vi is the "replace.vi" Which string do you mean? Before the case? :question: 1794[/snapback] Hi Sarah in your replace vi screen shot I noticed that you have suceed in exchanging the : for _ but you have not addresse Quote Link to comment
Sarah83 Posted September 17, 2004 Author Report Share Posted September 17, 2004 Hi Sarah in your replace vi screen shot I noticed that you have suceed in exchanging the : for _ but you have not addresse Quote Link to comment
Michael Aivaliotis Posted September 18, 2004 Report Share Posted September 18, 2004 OK Sarah, I hope we can finaly close this thread. :thumbup: Here is some code that will help you out. I think I understand what you require now. Download File:post-2-1095480616.llb LV Version 7.0 Quote Link to comment
Sarah83 Posted September 22, 2004 Author Report Share Posted September 22, 2004 OK Sarah, I hope we can finaly close this thread. :thumbup: Here is some code that will help you out. I think I understand what you require now. Download File:post-2-1095480616.llb LV Version 7.0 1812[/snapback] Hi Michael, thanks! :worship: Now I understand why I must search and replace the string in two times Quote Link to comment
aledain Posted September 23, 2004 Report Share Posted September 23, 2004 ...ok, I will try to replace the ":" with a "_".... 1727[/snapback] Couldn't you create a date string using this instead of needing to replace the ":" ... Quote Link to comment
Sarah83 Posted September 23, 2004 Author Report Share Posted September 23, 2004 Couldn't you create a date string using this instead of needing to replace the ":" ... 1905[/snapback] I don't know, I can try this out if I have some time. It would be a shorter way. Quote Link to comment
Michael Aivaliotis Posted September 24, 2004 Report Share Posted September 24, 2004 Couldn't you create a date string using this instead of needing to replace the ":" ... 1905[/snapback] Doh! Thanks Alex, this is what I should have recommended. . I use that in my programs as well. It slipped my mind. Hey, at least this shows you read all the posts... Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.