LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Read not working

Solved!
Go to solution

Hi,

I am stuck with my LabVIEW code, that I made for controlling my power supply. I am able to go to remote mode on/off, and switch on/off the output power. But I am neither able to set the voltage nor record the power from the power supply. It seems that VISA read is the problem. Please help.

Please note - as some of the suggestions on this forum that I already have tried for example removing the property node when I am using the termination character, this doesn't work.

I have attached my code.

I would really appreciate any help.

 

0 Kudos
Message 1 of 10
(2,108 Views)

Please attach your actual code instead of images. And don't use Bytes at port to read VISA, either termchar (if applicable) or fixed number of bytes. According to command "power?\r\n" i'd say use termchar with "\n" as the character (0x0A).

0 Kudos
Message 2 of 10
(2,094 Views)
Solution
Accepted by Win_PhD_2023

1. Why are you trying to perform a read after setting the voltage?  That is unless the supply gives a reply after you set it.

2. DO NOT USE THE BYTES AT PORT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! (still not enough emphasis)  You seem to have a clear ASCII based protocol here.  So just tell the VISA Read to read more bytes than you ever expect in a response and it will stop reading when the termination character is read (defaulting to a Line Feed).


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 3 of 10
(2,089 Views)

Term Char is not working, Its giving some error in VISA CLR. But Thanks though for trying.

0 Kudos
Message 4 of 10
(2,077 Views)
Solution
Accepted by Win_PhD_2023

@Win_PhD_2023 wrote:

Its giving some error in VISA CLR.


And what is that error?  There is also the argument you shouldn't even need the VISA Clear.


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 5 of 10
(2,073 Views)

@crossrulz wrote:

@Win_PhD_2023 wrote:

Its giving some error in VISA CLR.


And what is that error?  There is also the argument you shouldn't even need the VISA Clear.


A strong argument.  You only need that "in the middle" if you are doing something wrong!  In this case, it might even be what is messing up the communication.

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 6 of 10
(2,066 Views)

Is this what you meant? It didn't work though...

Thanks anyway

0 Kudos
Message 7 of 10
(2,041 Views)

Thank you so much I removed the property node altogether and VISA CLR [Suggested by other user]. Now code works.

0 Kudos
Message 8 of 10
(2,036 Views)

@Win_PhD_2023 wrote:

Is this what you meant? It didn't work though...

Thanks anyway


Did you eliminate the Read after setting the voltage?  The large majority of instruments do not reply with anything when you set a value.  They will only reply if you perform a query.


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 9 of 10
(2,031 Views)

Thanks a lot, after removing VISA CLR it worked.

0 Kudos
Message 10 of 10
(2,028 Views)