LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA read always returns blank

Solved!
Go to solution

@Raghunathan wrote:

Thanks for the tips. My device does not accept a LF as termination character.

 

I have tried with a white space and also checked for any errors. Still no luck . As you can see from  the image below, there is 47 bytes at the Read buffer, excpet that it is hoidden from me - I still dont read it in the indicator named Read Buffer.

StripWhiteSpaces.png


I'd turn on the termination character option in the VISA serial config.  That way you can dump all those timing delays/bytes at port junk and just wait for the termination character.  Hard-coded waits are usually (but not always) a substitute for understanding communications requirements.

 

[edit] forgot he said he already had the term char option on.  I would avoid the use of both the bytes at port and term char at the same time...

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.
0 Kudos
Message 11 of 32
(1,620 Views)

Yes . That was a great pointer instead of advising to read a tutorial on ASCII !

In a technical forum it's such a relief to see advises that don't presume the OP as a stupid human.

Will get access to the equipment shortly and will check out your suggestion. Thanks.

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 12 of 32
(1,597 Views)

Have you tried checking the size of the data returned? This would help you to also see if you are simply reading not printable/displayable data or are reading nothing.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 13 of 32
(1,595 Views)

@Raghunathan wrote:

Yes . That was a great pointer instead of advising to read a tutorial on ASCII !

In a technical forum it's such a relief to see advises that don't presume the OP as a stupid human.

Will get access to the equipment shortly and will check out your suggestion. Thanks.


Im sorry if my post offended.  You posted to the NI forums so I assumed intelegenceSmiley Wink

Ignorance and stupidity are quite different.  If there had been a knowledge gap the tutorial would have cleared it up.  Thanks for the follow up Bill.


"Should be" isn't "Is" -Jay
Message 14 of 32
(1,583 Views)
There is not much help we can offer in this thread until the original poster comes back with some of the questions answered such as the actual data saved in the indicator as default and uploading the VI, and the number of bytes actually read by the VISA read when it returns.
0 Kudos
Message 15 of 32
(1,579 Views)

@RavensFan wrote:
There is not much help we can offer in this thread until the original poster comes back with some of the questions answered such as the actual data saved in the indicator as default and uploading the VI, and the number of bytes actually read by the VISA read when it returns.

True . I now will have to check the following as advised :

 

1. Not use the option of TermChar and BytesAtPort together.

2. See if the characters returned are unprintable. 

3. Check actual number of bytes read by the function.

 

And this will be after two days when I return back to base. Thanks for all the support.

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 16 of 32
(1,565 Views)
 
I had tried all suggestions as listed out in my previous post. But still reading a blank. Tried changing the indicator to read Code display and also Hex display without any success . The probes in the attached PNG tell the story... Actually I expect only 21 bytes for the valid query but just entered 30 Bytes. ( the value of 47 bytes is for an initial transaction and that is not important for me. In any case norhing is being shown on indicator, so I guess thats irrelevant. )  It is now confirmed that the read buffer is not empty at all, but then why does not the VISA Read get them ??
 
The only other thing that I tired was to vary the time delay between a Write and Read. I start getting valid numbers in the Read Buffer only when the delay is more than 15ms.
Bytes at Port.png
Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 17 of 32
(1,542 Views)
The first character was cr and VISA Read stopped.

"Should be" isn't "Is" -Jay
0 Kudos
Message 18 of 32
(1,529 Views)

The error/warning code in your picture also shows that some bytes are left in the visa buffer from last read.

 

Warning code 1073676294 is a information from visa read, that there are still bytes left in the buffer after a read.

http://digital.ni.com/public.nsf/allkb/C96C84C922DC3F978625632500482F78

 

But since this warning is there in the error cluster before your visa read in your picture, that support the theory that what you get is a new line feed, only one byte. And that this new line feed is leftover from a previous vise read.

0 Kudos
Message 19 of 32
(1,525 Views)

You could try to clear the buffers before you make your new request. Try using the VISA Clear before you send out your command.

Message 20 of 32
(1,524 Views)