LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Visa write/Read function not outputting same info consistently

Solved!
Go to solution

Hello,

 

I have vi where I want to read its output after it power up. But somehow it doesn't output all info sometimes. I want it to output consistently output all configuration info from microprocessor every time. See attach Vi and pictures. Thank you.

Download All
0 Kudos
Message 1 of 5
(2,083 Views)
Solution
Accepted by topic author Amit4

On mobile, so I can't look at your VI.  But my first thought is you are using the Bytes At Port when you should be using the Termination​ Character and read the lines in a loop until the Console> is read.  But looking at your images, it looks more like you turned on the microcontroller before you configured the serial port.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 5
(2,073 Views)

I think this is one of the rare times where Bytes at Port might work, as long as you've given enough of a wait for all bytes to be returned, because it seems to be a multi-line response.  Even the termination character was disabled at the VISA Configure, so that all checks out.

 

I think Crossrulz's explanation of the micro controller turned on before the serial port was ready is the most logical one.

Message 3 of 5
(2,058 Views)

Well, I'm going to "split the difference" here.  The Original Poster didn't give us much information to go on, but given the well-formed messages from the Device, I'm going to "guess" that it is outputting "well-formed Human-readable text", hence should be handled with the default <LF> Termination Character and "Termination Character" set to True on the VISA Configuration, and should absolutely not use Bytes at Port but rather a 1000-byte VISA Read (with, if necessary, a check for a Timeout Error alerting the User to "Turn on the MicroController, dummy!").  This would enable you to get rid of the Sequence Structures, eliminate the Delay (ms) functions (which don't always seem to be in the right places -- they need to be more tightly-bound to the Error Line with small Sequence Frames, if used at all, or the equivalent VIM used instead!!).

 

Bob Schor

0 Kudos
Message 4 of 5
(2,043 Views)

Finally able to look at the VI...

 

Where is the prompt to enter a password from the microcontroller?  Maybe you can give more details on what the process is supposed to be as if you were doing it by hand?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 5
(2,022 Views)