LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RS232 communication with LabView

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

 

 

0 Kudos
Message 21 of 43
(2,523 Views)

Take the time, format it into a string and concatenate that with the string data you are receiving from the serial port.

Message 22 of 43
(2,515 Views)

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

0 Kudos
Message 23 of 43
(2,491 Views)

Use %S%3u as the format code.

 

(Search LabVIEW help for Format Codes for Time Strings)

Message 24 of 43
(2,478 Views)

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

0 Kudos
Message 25 of 43
(2,452 Views)

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.

0 Kudos
Message 26 of 43
(2,446 Views)

I think Raven is thinking of something like this.  I also optimized the read since you know there is a term char.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 27 of 43
(2,444 Views)

Pretty nice work for a minion!  A few edits to improve some performance gaps and away you go.

 mod3_t_Basic Serial Write and ReadWithJJBEdits.png


"Should be" isn't "Is" -Jay
Message 28 of 43
(2,435 Views)

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.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 29 of 43
(2,422 Views)

@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 Smiley Wink


"Should be" isn't "Is" -Jay
0 Kudos
Message 30 of 43
(2,419 Views)