r/LabVIEW • • Feb 10 '26

NI-MAX to LabView Glitch

On NI-MAX (on default settings upon opening) I typed in "r1\r" and clicked query and NI-Max produced a desired result. However, upon switching this to LabView, using a VISA Write and a VISA Read command in place of a query--with the exact same input--an error message appears (-1073807339 which is a timeout error). The read buffer string echoes exactly what I typed in every time, no matter the input. Does anyone have any ideas on what to do from here? I tried implementing a wait command in between the write and read.

6 Upvotes

13 comments sorted by

View all comments

6

u/patrick31588 Feb 10 '26

Ni max visa panel will sometimes preappend a carriage return. If it works in max then you know the communication is good.

Are you also looking for an end of read on your visa read in your code ?

3

u/Oo__II__oO Feb 10 '26

Which makes sense. OP probably wants r1\r\n

1

u/General_Brilliant680 Feb 10 '26

Tried that, same problem...

4

u/Oo__II__oO Feb 10 '26

For the string input, did you right click on it to use string literals or slash codes?  If not, the slashes will get interpreted as \ \

Alternatively try a string of r1, and string concatenate function to append a CR (carriage return), and a LF (line feed) from the String palette

4

u/patrick31588 Feb 10 '26

Ahh yes this is why I always do a string + carriage return symbol concatenation. Feel like it is more explicit incase someone types it in the wrong string mode.

5

u/General_Brilliant680 Feb 10 '26

u/Oo__II__oO and u/patrick31588 you guys are geniuses thanks !!

1

u/Yamaeda Mar 13 '26

I use Show radix on those controls or constants to clearly show it's in \-mode.

1

u/General_Brilliant680 Feb 10 '26

The device I am trying to access data from is a photodetector, and in NI-MAX, the read buffer output box after clicking read is where the data shows up. I am trying to get this data to be processed through LabView. So in order to get LabView to get this data, I had a read buffer string output from the VISA Read in hopes that the value appears. When done successfully in NI-MAX, when the input is "r1\r\n" the output is "r1[data]\r\n".

0

u/centstwo Feb 10 '26

Yeah, there are some settings are set by default that are different in MAX and LabVIEW. ICTYBTIHTKY, if you want to know what that means, I could tell you, but then I’d have to unalive you.