From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
07-17-2015 02:59 PM
July 17
Group:
I am displaying a string of thermocouple data (ni-9213 module) using Labview 2014 in a text box. The output looks like the following:
7/17/2015 9:54:17 AM72.616310 0.00000072.692420 0.00000072.601004 0.00000072.197581 0.00000072.569151 0.00000072.518680 0.00000072.735436 0.00000073.559346 0.000000
I would like the output to look like this:
07-17-2015 09:54:17 72.62 72.69 72.60 72.20 72.57 72.52 72.73 73.56
any suggestions on where to start?
thanks
07-17-2015 04:38 PM - edited 07-17-2015 04:38 PM
Show the code that you're using to pack the string indicator.
This should just be a matter of using the format string and the Format Into String function.
I don't recall the timing formatting but your floats look like a straightforward %.2f.
07-17-2015 05:04 PM
July 17
Taki
Thanks for your interest. the screen shot of the block diagram is attached.
07-17-2015 05:19 PM
7/17/2015 9:54:17 AM72.616310 0.00000072.692420 0.00000072.601004 0.00000072.197581 0.00000072.569151 0.00000072.518680 0.00000072.735436 0.00000073.559346 0.000000
07-17-2015 09:54:17 72.62 72.69 72.60 72.20 72.57 72.52 72.73 73.56
It looks like you are getting 2 values for each reading. Are you sure there is not some type of control code in front of the 72s and 73 at the start of each temp value? Like a TAB that we can not see in the string that you posted?
This would be very easy if there was some control code in front of your readings
07-17-2015 05:26 PM - edited 07-17-2015 05:28 PM
Post your VI or a Snippet of your code and not a screen shot.
But if you add a space or TAB before or after your format string "%f %f" that will make it very very easy to pull out your reading.
use something like "%f\s%f\s"
Your readings are running together from the for loop.
07-17-2015 05:52 PM - edited 07-17-2015 06:04 PM
Let get ride of the extra 0.000 before they get into your string.
Are you reading multiple channel?
Your DAQmx Read is configured for a 2D array. Reading multi channel multiple time for each read. There is here the extra 0.000 is coming from.
Without knowing what your configuration, but from what it seems you are logging, I assume you have 8 thermocouple and you wish to take a temp readings from each every 10 sec. But you only want to take a single reading from each every 10 sec.
If that is the case, you should configure the DAQmx for Multiple Channel Single Reading (Analog 1D DBL NChan 1 Samp)
07-17-2015 06:19 PM
july 17
Omar:
thanks for your help. Attached is the actual vi that i'm working on.
would you please tell me what the 2 middle icons in your vi represent?
tom
07-17-2015 06:30 PM - edited 07-17-2015 06:33 PM
You can paste the snippet onto your block diagram
http://www.ni.com/tutorial/9330/en/
Just one of many ways to format your log data
"Number To Engineering String"
"Array To Spreadsheet String"
But, are you only wishing to read 8 thermocouple only once every 10 sec?
07-17-2015 06:45 PM
So from your Physical Channel
"cDAQ1Mod1/ai0:7" I assume you really only want one reading from each every 10 sec?
Configure your DAQmx Read for "NChan 1 Samp"
07-17-2015 07:29 PM
July 17
Omar:
your snippet works!
here's the output
07/17/2015 19:25:37 73.74 -1015 73.99 73.88 73.68 73.43 73.62 73.45
When complete, we'll be measuring 32 tc leads. And yes we take 32 readings every log.
currently the data scrolls to the screen, when the next log is sent to the screen the first set of reading disappears. How can i have serveral logs appear on the screen before they are scolled off?