03-15-2022 07:16 AM
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.
Solved! Go to Solution.
03-15-2022 07:56 AM
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).
03-15-2022 08:01 AM
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).
03-15-2022 08:25 AM
Term Char is not working, Its giving some error in VISA CLR. But Thanks though for trying.
03-15-2022 08:28 AM
@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.
03-15-2022 08:50 AM
@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.
03-15-2022 10:28 AM
Is this what you meant? It didn't work though...
Thanks anyway
03-15-2022 10:40 AM
Thank you so much I removed the property node altogether and VISA CLR [Suggested by other user]. Now code works.
03-15-2022 10:42 AM
@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.
03-15-2022 10:42 AM
Thanks a lot, after removing VISA CLR it worked.