09-13-2021 07:09 AM
Hello
I use LabVIEW 2018.
I do a simple serial communication to external drive connected on COM port.
I use VISA configure serial port VI, then VISA Write and then VISA Read, then clear VISA and last Close VISA VI.
First time when I run the this program, serial communication works fine no problem.
But second time when I run, I do not get any error but serial Write is not done properly.
I am guessing that along with the VISA write, some other characters are going to port.
Or some characters are hanging in the port.
My termination character is false. The device does not need termination character.
How to clear the memory in device? I used Clear VISA port VI, that is not helping.
Thank you
09-13-2021 07:20 AM
Post your VI
09-13-2021 07:21 AM
Please attach your code. What's the port standard (RS232-RS422-RS485)? How do you know about those extra characters (do you have a serial port monitor)?
09-13-2021 08:18 AM
@hemalathagopal wrote:
Hello
I use LabVIEW 2018.
I do a simple serial communication to external drive connected on COM port.
I use VISA configure serial port VI, then VISA Write and then VISA Read, then clear VISA and last Close VISA VI.
First time when I run the this program, serial communication works fine no problem.
But second time when I run, I do not get any error but serial Write is not done properly.
I am guessing that along with the VISA write, some other characters are going to port.
Or some characters are hanging in the port.
My termination character is false. The device does not need termination character.
How to clear the memory in device? I used Clear VISA port VI, that is not helping.
Thank you
When something like this happens, 99% of the time it is a failure of the developer to completely understand the communications protocol. In addition to the code, it would be very helpful to have a copy of the manual or whatever defines the protocol.
09-21-2021 01:05 AM
Hi
Problem got solved by adding the VI VISA Flush I/O Buffer.vi in the end before Close VISA ref.vi
Thank you
09-21-2021 01:05 AM
Hi
Problem got solved by adding the VI VISA Flush I/O Buffer.vi in the end before Close VISA ref.vi
Thank you
09-21-2021 01:10 AM
That's one way to do it, but it's far more likely you are doing something else wrong, if you need buffer flushing in order to run your vi a second time.
09-21-2021 11:33 AM
@hemalathagopal wrote:
Hi
Problem got solved by adding the VI VISA Flush I/O Buffer.vi in the end before Close VISA ref.vi
Thank you
It's not solved; it's covered up, just waiting to bite you again when you find out those "extra" characters actually mean something later on down the road. You don't deal with an issue by ignoring it. (Usually.) This is like "solving" your termite problem by painting over the damaged wood.