LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI VISA Read function not working

Hello! 

 

I am fairly new to LabVIEW and am having trouble allowing my computer to communicate with my AMI 286 Liquid Level Controller, which is connected via a serial communications port. When I test supported SCPI commands in NI MAX, the write function works, but read and query do not.

 

nimax1.png

I am using commands specific to the AMI 286 according to its user manual: http://www.americanmagnetics.com/support/manuals/model286.pdf

Still, these commands do not work in this LabVIEW program either.

 

labview1.png

 

Please help.

Any direction is appreciated!

0 Kudos
Message 1 of 6
(1,566 Views)

Hi REU,

 


@REU_student_01 wrote:

I am using commands specific to the AMI 286 according to its user manual: http://www.americanmagnetics.com/support/manuals/model286.pdf


Unfortunately the website is just responding with "404"…

 

I guess you forgot to include some "end of line" chars (aka TermChars) when sending the command. What does the manual mention to append to a command(most likely something as CR+LF)?

 

When you start a serial communication you should use SerialPortInit instead of VISAOpen. And please watch this video!

Best regards,
GerdW


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

I would first verify you are using the correct baud rate.  The default is 9600.

 

In LabVIEW, you should use the VISA Configure Serial Port instead of the VISA Open.  This will ensure you are using the correct serial port settings.  All of the defaults should work, so you should only need to wire up the VISA Resource.

 

Additionally, you likely need to add a Carriage Return and Line Feed characters to the end of your commands.  The device needs those termination characters to know when the receiving command has ended.  In LabVIEW, you just concatenate the End Of Line character to your command (assuming you are using Windows).  In MAX, add "\r\n" to the command.


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 3 of 6
(1,554 Views)

@GerdW wrote:

Unfortunately the website is just responding with "404"…


The link worked just fine for me.  Perhaps it's a region issue?

 


@GerdW wrote:

And please watch this video!


Whoever made that video is a freakin' genius.  Lot's of good info.😁


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 4 of 6
(1,549 Views)

Hi Tim,

 


@crossrulz wrote:

@GerdW wrote:

Unfortunately the website is just responding with "404"…


The link worked just fine for me.  Perhaps it's a region issue?


Not for me:

Those "AmericanMagnetics" also are not capable of signing their website correctly:

 


@crossrulz wrote:

@GerdW wrote:

And please watch this video!


Whoever made that video is a freakin' genius.  Lot's of good info.😁


I link that video quite often in the last days. Thanks that genius made it public! 😄

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Download All
0 Kudos
Message 5 of 6
(1,545 Views)

just to comment that i own the guy from the video getting my CLAD. is daily CLAD being updated? that was so fun!

EDIT: not because he did that, but because usually had good explanations

Jorge Augusto Pessatto Mondadori, PhD
Sistema Fiep
CLAD, CLD
0 Kudos
Message 6 of 6
(1,510 Views)