03-26-2013 01:00 PM
Hi Johnsold,
Thank you for helping out. I made the correction from Crossrulz. I will work on cosmetic better next time. About adding the time info to the data I collect (earlier post), Is there a way I could do that?
vzv
03-26-2013 03:16 PM
Take the time, format it into a string and concatenate that with the string data you are receiving from the serial port.
03-28-2013 04:41 PM - edited 03-28-2013 04:41 PM
I am able to concatenate the time string and string data. In the Format Date/Time String Function,using the time format string option I can choose on how the I require the time string need to be. I know I can make it display the seconds using <%S> but is there a way I can make it display milli seconds ? I tried using %<digit>u but I am unable to get the millisecond value.
Thank you,
vzv
03-28-2013 10:57 PM
Use %S%3u as the format code.
(Search LabVIEW help for Format Codes for Time Strings)
03-29-2013 10:56 AM
It worked perfect ! I have a question for you and wondered whether you can give me an input on it.
The serial port I am working with (Thermocouple Input Module) has 4 different channels to connect for 4 different thermocouples. It doesn't have the ability to acquire in all the 4 channels at once by writing a single string. So, in order to acquire from different channels I needed to write to the port everytime specifying from which channel I want the data to be read. I was thinking on the lines of round robin format such that after first string (corresponds to ch 1) is read it will wait for the time specified in 'delay before read' and then it will read the second string (corresponds to ch 2) and so on. The closest structure I found to use this in labview was Programming->Comparison->Select. But it can select only two depending on either True/False.
Is there a better way to accomplish what I'm trying to do here? I have also attached the VI I work with in case of reference.
Thank you,
vzv
03-29-2013 11:21 AM
Put your reads and writes into a For Loop. Put the commands for each channel into an array and let the For Loop auto -index on that. The it will run 4 times, once for each command in the array. You can let the results autoindex as well which will automatically build them into an array at the For loop boundary.
03-29-2013 11:26 AM
I think Raven is thinking of something like this. I also optimized the read since you know there is a term char.
03-29-2013 11:57 AM - edited 03-29-2013 12:00 PM
Pretty nice work for a minion! A few edits to improve some performance gaps and away you go.
03-29-2013 12:37 PM
Oh, oops - I guess I missed the requirement about the rate of aquisistion.
Also - really? Did I miss those shift registers on the for loop? Shame on me.
Good one about the file errors. They are one of the most important errors to catch and I forgot all about them.
I am a lowly minion because, for every thing I know about LabVIEW, I know there are ten things I don't know about it. Fortunately, I learn stuff from this forum just about every time I log on. I just browse topics that look interesting to me, and 99/100 times I will have learned something by the time I get to the end.
03-29-2013 12:54 PM
@billko wrote:
Fortunately, I learn stuff from this forum just about every time I log on. I just browse topics that look interesting to me, and 99/100 times I will have learned something by the time I get to the end.
After a few thousand posts you start getting the hang of not knowing something about LabVIEW! Trust me