LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 1073807339 VISA READ TIME OUT

Solved!
Go to solution

Hi! I am writing a VI used for Razorbill RP100 strain cell power supply. 

I wrote a small and simple VI to see if I can communicate with LabView and it turned out that VISA Read got problem every time, getting Error 1073807339.

 

I can write and read from NI Max VISA panel perfectly well, and I have installed NI VISA on my laptop. 

The VISA open doesn't have problem so I assume it's not the problem from the connection.

I got the baud rate and other stuff from the settings of VISA panel of NI MAX( when the read and write were working well).

微信图片_20190819171840.png

I followed the suggestions from here: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019L3mSAE&l=en-GB ; but neither of them worked.

 

Does anyone have any ideas on how to solve this?

 

Thank you!

0 Kudos
Message 1 of 20
(3,306 Views)

1.  Do you know if your device will respond to the command *IDN?

 

2.  In your string to write, you have *IDN?\r\n   Is that string constant in normal mode or \Code mode?  Make Sure it is in \Code mode.  (This is item "D" in the link you attached.)

0 Kudos
Message 2 of 20
(3,253 Views)
Solution
Accepted by Seabass666

Hi,

  • *IDN? is allowed as a command, so I also suspect that you've used the default string display, and if you switch it to \ Display you'll see "*IDN?\\r\\n" (note double backslash - the first escapes the second).
    • To fix this, whilst in the \ mode, remove one of each pair of \. Then you'll see "*IDN?\r\n". If you go back to the normal display, you'll see a 2 line string constant.
  • Your device always replies with CRLF, but LabVIEW will only allow 1 termination character - you can set this to LF and then trim the CR each time, but creating a subVI to do that for you might be useful
  • Your device accepts any of CR, LF, or CRLF as terminators, so you can just use one to make it a bit simpler (especially if you choose to use the LF constant (or CF, etc) and Concatenate String, which removes ambiguity regarding display styles).

GCentral
0 Kudos
Message 3 of 20
(3,236 Views)

Hi! Thank you for replying. 

I tested it and I think the device can't read *IDN? itself but has to have a \n as well.

0 Kudos
Message 4 of 20
(3,221 Views)

Thank you!

I added one block for termination character and finally I can read string.

 

0 Kudos
Message 5 of 20
(3,218 Views)

Hi!

 

I can read string now but I keep getting error. It's a bit confusing.

 

Does anyone have any ideas on this situation?

 

Thanks!

微信截图_20190820130414.png

0 Kudos
Message 6 of 20
(3,214 Views)

Hi Seabass,

 

why don't you use AutoCleanup before posting code images? It would help a lot to be able to "read" your code!

 

Why don't you use SerialPortInit function instead of VISAOpen and that property node?

What's the point of that wait(0 ms) function? You don't need it!

 

Does anyone have any ideas on this situation?

Yes.

You receive data from your device, but it misses to send (atleast) 256 bytes or the TermChar you set when initializing the port. So you get the "received string" with an TimeOut error (after about 10s)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 20
(3,211 Views)

微信截图_20190820133!.png

 

Hi GerdW,

 

Thank you! I don't know there is a cleanup on the toolbar Smiley Sad

I got a nicer looked code now. I was thinking maybe the timeout was from the time gap between the write and read, so I set a wait section to test if this matters (It doesn't).

I changed the instrument setting of END IN in the last Bit but the error message was still there.

What do you think I should do now to get rid of this error?

(I attached the VI)

 

Best Regards,

Seabass

0 Kudos
Message 8 of 20
(3,208 Views)

I changed the read Byte count into 20 and it worked.

 

0 Kudos
Message 9 of 20
(3,204 Views)

@Seabass666 wrote:

I changed the read Byte count into 20 and it worked.


But your message is at least 28 bytes.  So you are not getting all of your data.

 

I think you have an issue with where you are setting the Termination Character.  There is a coercion dot on the property node, telling me you are not casting your Line Feed constant into a U8 like is expected.  You are likely casting to a I32, which will be coerced to 0 (would have to test to verify).  Change that constant on the Type Cast to be a U8 representation.


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 10 of 20
(3,200 Views)