From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

i want continous serial write and read

Hi all,
i want to do several read and write on serial communication.i need to write 10 strings of type !00072982382000000! to my hardware which will process and give me strings like !0000774324000000000000043432432! .For one string read and write im doing fine as i put the Visa read in while loop but for writing and reading continously with help of front panel i'm unable to end the while loop.my input and output string starts with ! symbol.i'm sending the VI as an attchment.kindly help me. please mail me at orbitmirchi@yahoo.co.uk

thanks
venkatesh
0 Kudos
Message 1 of 2
(2,842 Views)
venkatesh,

I looked at your VI and I see some possible problems stopping your inner while loop. For example if the VISA Write produces an error you will get stuck in the inner while loop. You can fix this by placing an true constant in the Error case and wire it to an OR to stop the loop.

Also to be honest I'm not really sure I understand what the purpose is of the inner while loop. Does your instrument return multiple replies for a single write? If not you will only need to read back the response from your instrument once.

If your instrument does return multiple replies to a single message and your inner while loop does not stop, you should place an indicator, or probe the output of the Match First String VI. My guess is that it never matches the index of the while loop so it never stops.

Shawn B.
National Instruments
Use NI products on Linux? Come join the NI Linux Users Community
0 Kudos
Message 2 of 2
(2,816 Views)