LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error in Read Function while using VISA

Hello Everyone,

Please find attached below my VI, in which I'm making a PID loop to acquire the temperatures from 2 thermocouples, and regulating the input of the power supply (PSD7303A) accordingly such that the heaters attached to both the thermocouples are set to a particular temperature.

PID loop is working properly but I'm not able to get the power output. On using probe, I'm getting an error as shown below. Why is my read buffer not working?

Please tell me how can I get output of power from the channels, without slowing down my program.

 

Download All
0 Kudos
Message 1 of 8
(1,128 Views)

You didn't show the explanation for the Error:  "VISA: (Hex 0xBFFF0037) Device reported an input protocol error during transfer."

 

Is it possible that VISA isn't configured properly?  One way to find out is to connect your VISA device, open MAX, and try to configure VISA as you have done in your code, send the initial message, read response, etc.  If you get an error, then examine such things as Baud Rate, # start/stop bits, parity, etc.  

 

Ah, I just opened your code, and notice that you don't have a VISA Configure Serial Port (which is where you set Baud Rate, etc., including the important "Enable Termination Character (T)" and "Default Termination Character (LF)".  Try adding this.

 

Bob Schor 

0 Kudos
Message 2 of 8
(1,091 Views)

Hi divb,

 


@divb wrote:

Please tell me how can I get output of power from the channels, without slowing down my program.


Read the fine manual of your power supply to learn how to read several measurement data "without slowing down your program"!

Does the device even support your request?

 

Btw. you should simplify that part of code like this:

And the manual explicitely says:

How do you implement to read the power from both channels???

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Download All
0 Kudos
Message 3 of 8
(1,055 Views)

Hi Bob, thank you very much for your suggestion.

Can you please check the screenshot below and let me know what's wrong. I'm getting an error and now the power supply is not writing the voltage value also. I'm new to this VISA functions in LabVIEW, so any help in setting this correctly would be much appreciated.

Also, a follow up to your reply: I've checked the configuration of VISA by NI Max and tried to give commands, it's working well with no errors.

Thank You.

0 Kudos
Message 4 of 8
(994 Views)

Thank You GerdW for your reply.

I intended to read power from both the channels by using separate write and read functions as shown in screenshot below, but it slows down the program. Is there any other way?

Also, can you please tell which function you used to simplify that part of the code.

 

Any suggestions would be much appreciated.

Thank You.

0 Kudos
Message 5 of 8
(992 Views)

Hi divb,

 


@divb wrote:

I intended to read power from both the channels by using separate write and read functions as shown in screenshot below, but it slows down the program. Is there any other way?


When the manual doesn't offer any other way then there is no other way: did you read the manual?

 


@divb wrote:

Also, can you please tell which function you used to simplify that part of the code.


FormatIntoString replaces NumToFloatString and ConcatString…

(You notice the disadvantages when you only attach images of code in contrast to real code?)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 8
(983 Views)

Hi GerdW,

Thank you for your reply.

Yes, I can't find any other way to do so in the manual, but right now I'm stuck at the point of reading power. There is an error coming, and I can't read the power. 

These are the VIs attached with few modifications I did to test:

DOUBT(1) : I'm able to write on power supply, but I'm not able to read power.

DOUBT(2): I tried using VISA property node, and now even the write function is not working.

Simple read write: This was a simple VI created by me to check the read and write command working. Write is working but read is not.

 

Please suggest the possible reason for this error and how can I get through it.

 

Also, yes I understand that attaching VIs would be better, so here it is 🙂

PFA the VIs and the screenshot of the errors.

Thank You.

 

 

0 Kudos
Message 7 of 8
(978 Views)

Hi divb,

 


@divb wrote:

DOUBT(1) : I'm able to write on power supply, but I'm not able to read power.


You still don't use AutoCleanup…

Why do you still convert an array to cluster and use Unbundle instead of indexing array elements using IndexArray?

 

What happens when you send each command on its own instead of creating a large string of several commands?

 


@divb wrote:

DOUBT(2): I tried using VISA property node, and now even the write function is not working.


Your device driver (that "USB0:…" port) does not suport all those properties!

Why do you want to set a baud rate for a USB device???

 


@divb wrote:

Simple read write: This was a simple VI created by me to check the read and write command working. Write is working but read is not.


Why do you open the port inside the loop? This belongs before the loop!

You get timeout errors as your device(s) don't respond: do you send the correct commands (including termchars)?

Why do you try to access the very same port twice? That will never work sufficiently…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 8
(971 Views)