LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simulating Arduino's Serial Monitor with Labview?

Solved!
Go to solution

Objective:  Simulate Arduino's Serial Monitor using Labview's Basic Serial Write and Read.Vi. 

Problem: When a continuous stream of ASCII data is sent to the Basic Serial Write and Read.VI  it stops reading after approximately 3 seconds.  Whereas it should continually read data even when there is more data than can fit in the Read String Indicator. Ideally it should push old data off the top of the display and show new data at the bottom of the display. 

 

What modification should I make to the Basis Serial Write and Read.VI to simulate Arduino's Serial Monitor? 

 

Howard

0 Kudos
Message 1 of 12
(4,445 Views)
The example needs quite a bit of work. It is set to run only once. If you are using the run continuous button, stop. That is for special debug use only.

The simplest mod is to put a read inside a while loop. If the device is appending a termination character, get rid of the bytes at serial port function. Use a shift register with a concatenate string function. Take care to limit the max length of the string. Use a property node to set the string position to the end of the string.
0 Kudos
Message 2 of 12
(4,434 Views)

hi howard, can you upload you VI (in 2011)

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 3 of 12
(4,411 Views)

Hello Ranjeet,

 

The Basic Serial Write and Read.VI I am using is an example that comes with Labview.  I just checked and it is available with Labview 2011.  Attached is a zip file copy of the Arduino sketch I am using for comparing the performance of Arduino's Serial Monitor and Labview's Basic Serial Write and Read.VI

 

Howard

0 Kudos
Message 4 of 12
(4,373 Views)
What is the point of attaching that? Attach the modified LabVIEW example you make. Using the unmodified example for a comparison is simply a waste of time.
0 Kudos
Message 5 of 12
(4,363 Views)

Hello Ranjeet.

 

The point is the Basic Serial Write and Read.VI produced the problem I described in my initial post. It is the starting point I am using to create a Labview serial monitor that is better suited for working with micro controllers than the Basic Serial Write and Read.VI.  If you are unwilling to offer suggestions on how to modify the Basic Serial Write and Read.VI. please stop asking for information that is not applicable to the problem.  .

 

Howard

 

 

0 Kudos
Message 6 of 12
(4,353 Views)
I offered several suggestions. Instead of paying attention to them, you posted an arduino project. You then posted a response to Ranjeet for some reason. When you have modified the example, post your modified code if you have problems.
0 Kudos
Message 7 of 12
(4,345 Views)

Hello Dennis,

 

I like your suggestions but haven't tried them yet. 

 

With respect to Ranjeet I thought a simple answer like telling him where the Basic Serial Write and ReadVI could be found would answer his query.  But no he wanted to go off on a tangent.

 

Thank you.  I appreciate your direct and to the point advice.

 

Howard

0 Kudos
Message 8 of 12
(4,332 Views)

Unfortunately, Ranjeet has a tendency to do that at times.

 

However in this case, he wasn't on a tangent.  He wanted to see YOUR VI in an older version he'd be able to open.  We don't care about the LabVIEW example.  We've all seen that thousands of times.

0 Kudos
Message 9 of 12
(4,316 Views)

Hello Dennis,

 

Your recommendation to put the Read in a while loop fixed the problem of the Basic Serial Write and Read.VI not being able to continuously read data for the continuous stream of input data case.

 

However, I could not get the VI to simulate Arduino's Serial Monitor.   When the Arduino Serial monitor gets to the bottom of the screen it pushes each line up, the oldest line is pushed off the screen and the newest line is displayed at the bottom of the screen,   Whereas with the test program I used when the termination character is ON only one line is displayed. Each line of data is terminated in a new nine character.  Changing the rate of arrival of data did not changed the number of lines of data displayed.   When the termination character is OFF multiple lines of data could be displayed.  The number of lines displayed is a function of the rate of arrival of data.  However, instead of scrolling the display all displayed data is replaced simultaneously.  For example with a full screen display all of the old data was erased and replace in one step. 

 

My question is does the String Indicator have other modes of operation?   Does if have a scrolling mode or am I stuck with the mode described above?

 

I tried attaching my modified Basic Serial Write and Read.VI but couldn't because I got the "contents of the attachment doesn't match its file type" error.

 

Thank you for your Help

Howard

 

0 Kudos
Message 10 of 12
(4,290 Views)