LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Electronic comparator

But this one isn't what I would do. Isn't it? I will try it

0 Kudos
Message 21 of 45
(793 Views)

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.

Example_VI.png

 

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.


GCentral
0 Kudos
Message 22 of 45
(782 Views)

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)

0 Kudos
Message 23 of 45
(778 Views)

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?


GCentral
0 Kudos
Message 24 of 45
(776 Views)

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

Download All
0 Kudos
Message 25 of 45
(772 Views)

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.


GCentral
0 Kudos
Message 26 of 45
(767 Views)

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?

0 Kudos
Message 27 of 45
(765 Views)

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)


GCentral
0 Kudos
Message 28 of 45
(746 Views)

I find just replace by case selector. I don't find shift register!

0 Kudos
Message 29 of 45
(744 Views)

Hi ki4,

 

did you take those trainings, advertised for in the header of this LabVIEW board?

Then you should know about shift registers and how to create them!

 

Really: do some basic training!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 30 of 45
(721 Views)