05-14-2019 03:55 AM
But this one isn't what I would do. Isn't it? I will try it
05-14-2019 04:34 AM
To write a bunch of values (small number, not hundreds) into a string, I'd recommend the Format into String node on the Strings palette.
Right clicking on the node and then reading the help for the link to Format Specifiers will give you all the details about how to format the string to get the appropriate decimal places etc.
05-14-2019 04:38 AM
BUT for my project, I should read the file (tdms or .txt) where the counters values are in serial communication, not as you suggest (reading the values directly from the counters)
05-14-2019 04:44 AM
I have absolutely no idea why you'd want to read a file that you're writing during the time that you're writing it, to send the values that you already have somewhere else.
You could send the file afterwards, using serialization, but you'd probably need/want to use LabVIEW to receive it - you said you only want the iteration's data in Putty, as a string.
Alternatively, after you finish, you could open the file, read the data, and send it all at once, but again, that would be after, not during.
There's no particularly good way to read from a file in the way you're describing (and I don't understand the reason you'd want to). Maybe someone else has some idea?
05-14-2019 05:45 AM
So, I will do your suggestions, and see the result at first time.
and for creating automatically TDMS file when it exceed file, I have this error
05-14-2019 06:09 AM
Two points based on the image of the code:
Your replacement is using the same file path. This means you'll probably have either an error that the file already exists, or you'll overwrite your data (not sure which).
You're not using a shift register for the reference, so even if you did open a new file reference, the next iteration you'd reuse the old one (now closed) and definitely get an error.
05-14-2019 06:13 AM
Ya I use the same path because I need path for the command.
shift register for the reference: Where should I add it? and how? can you show me picture plz?
05-14-2019 07:59 AM
Where the wire reaches the edge of the While loop, right click on it and choose Replace with Shift Register. Your cursor will change shape, hover carefully over the other side of the While loop until it changes again and click on the other wire (same type - the file reference).
As to a file path, typically for that kind of issue you'd create a SubVI which generates a file name based on a basic name (example) and then a number or a date (becomes "example-1.tdms", "example-2.tdms" or "example-20190514-12_34" etc)
05-14-2019 08:07 AM
I find just replace by case selector. I don't find shift register!
05-14-2019 12:20 PM