08-19-2019 11:26 AM - edited 08-19-2019 11:27 AM
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).
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!
Solved! Go to Solution.
08-19-2019 06:08 PM
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.)
08-19-2019 11:45 PM - edited 08-19-2019 11:46 PM
Hi,
08-20-2019 06:59 AM
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.
08-20-2019 07:00 AM
Thank you!
I added one block for termination character and finally I can read string.
08-20-2019 07:06 AM
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!
08-20-2019 07:30 AM
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)…
08-20-2019 07:42 AM
Hi GerdW,
Thank you! I don't know there is a cleanup on the toolbar
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
08-20-2019 07:52 AM
I changed the read Byte count into 20 and it worked.
08-20-2019 08:01 AM
@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.