Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

serial read and write simultaneously

i want to write to a serial port and simultaneously be able to read what is send back to the pc. over the same port.

is it possible to attach a visa read and a visa write to the same port number?

if so, can someone tell me how to do it.
if not, maybe there is another way of doing it in Labview 6.1
0 Kudos
Message 1 of 13
(5,009 Views)
Stranger:

You need NI-VISA 3.0 or higher. This is from the readme:

"For a Serial INSTR resource, multiple sessions to the same port caused weird behavior if you tried to both write and read data simultaneously. This has been fixed."

You also need to open 2 separate VISA sessions to the same port because LabVIEW limits you to a single I/O operation at a given time on a given session. Not an unreasonable restriction, just something you need to know. Just set the "Open duplicate session" input parameter to VISA Open to TRUE.

Dan Mondrik
National Instruments
0 Kudos
Message 2 of 13
(5,009 Views)
i dont have NI-VISA 3.0 or higher.
i have the visa deliverd with LabView 6.1.

is there any way of doing it with the older version, or is it a bug in that older version.

also i am quite new to programming in Labview. if anyone has any sugestions on solving this problem, i'd really appreciate it.

thanks in advance
0 Kudos
Message 3 of 13
(5,011 Views)
Hi Stranger,

This was not a BUG! It was a limitation. This limitation does not exist in the newer versions of VISA.

You should be able to download the most recent version of NI-VISA.


Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 13
(5,013 Views)
Hi Ben,

where can i download the most recent version of
NI-VISA, and is it compatible with LabView 6.1?
0 Kudos
Message 5 of 13
(5,013 Views)
Try this

http://digital.ni.com/softlib.nsf/webcategories/85256410006C055586256BBB002C0E91?opendocument&node=132060_US

I just strarted at NI's home page and chased down the links under support.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 13
(5,013 Views)
hi,

i have downloaded and installed NI-VISA 3.0.
and it still does not work.

i want to be able to read and write to the serial port simultaniously. is it possible to address the TxD & RxD lines sepperately.

i've attached my program, and hope someone can tell me what i'm doing wrong.
0 Kudos
Message 7 of 13
(5,013 Views)
Sure, you're not opening 2 references like you need to do, as described above. Each usage should call VISA Open first.

Dan Mondrik
0 Kudos
Message 8 of 13
(5,013 Views)
i've done wat you said, now i get the following error message:

error code: �1073807339
"Timeout expired before operation completed."

i've tried to increse the timout (even to 20 seconds) but the error remains.

i've attached my program again to clarify

thanks in advance.
Message 9 of 13
(5,016 Views)
You still didn't have 2 sessions because you didn't pass "T" to "Create Duplicate Session". Also, explicitly calling VISA Open after it's been configured doesn't guarantee that the port remains in the same state. So I took the liberty of moving a few elements around in your diagram. What I have attached should work now.

Dan Mondrik
Message 10 of 13
(5,013 Views)