LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using USB device with Virtual Com port

I have an actisys IR USB device that creates a virtual serial port. I can read from it using VISA, however it will not write. I have the same setup working on LV 6.1 running windows 2000. I need to make it work on my system running XP and LV 7.1.
 
 
0 Kudos
Message 1 of 12
(5,976 Views)
Hello MattEE,
Have you tried writing and reading to the port through the VISA Interactive Control (VISAIC) in Measurement and Automation Explorer (MAX)?  If you have only tried it using LabVIEW, try using VISAIC and see if you see similar behavior.  Just go to the Basic I/O tab and try to Write a command and Read a response.  Do you see the same behavior here too?
 
Chris R.
Applications Engineer
National Instruments
Chris R.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 12
(5,954 Views)

Yes, I have tried bypassing Labview using VISAIC. I get the same response. Writing to the device results in a timeout.

 

0 Kudos
Message 3 of 12
(5,935 Views)

I have a new discovery. Using portmon shows that VISA write works, however VISA does not recognize the successful write, and will retry until the timeout occurs. I need to either disable the retries, or have the operation recognize a succesful write. Any ideas??

Matt

 

0 Kudos
Message 4 of 12
(5,912 Views)

Hello,
Does your Windows 2000/LabVIEW 6.1 system work correctly or do you see the same behavior?  It sounds like there may be something wrong with the termination of the command.  What termination method are you using?  Is your instrument set for that method?  You may also want to try using the NI-488.2 Interactive Control. This will bypass VISA and LabVIEW.  If this works, you may want to update to the latest version of VISA (if you don't already have it) to see if that fixes the issue.

Chris R.

 
Chris R.
Applications Engineer
National Instruments
0 Kudos
Message 5 of 12
(5,908 Views)

 

Message Edited by Chris_R. on 12-29-2005 10:50 AM

Chris R.
Applications Engineer
National Instruments
0 Kudos
Message 6 of 12
(5,880 Views)

Hello,
Sorry about my last message about 488.2.  I was thinking GPIB at the time.  Instead, can you use Hyperterminal to read and write from the virtual port?  Since it is a virtual com port, it may not behave the same way as a regular COM port since it may not have the full RS232 specifications.  You may be able to use Portmon to replicate the command set in Hyperterminal and see if you can write and read successfully.  Hyperterminal will bypass VISA and we can see if that may be the issue.

Chris R.

Chris R.
Applications Engineer
National Instruments
0 Kudos
Message 7 of 12
(5,879 Views)

Hyperterminal works properly. I have tried multiple termination techniques, and they all operate the same.  Any more ideas?

Matt

 

0 Kudos
Message 8 of 12
(5,845 Views)
By default LabVIEW and VISAIC both try to do asynchronous writes, however most virtual com ports don't support a lot of calls like asynchronous calls and flushes depending on the quality of the driver and device. In a perfect world a virtual com port would support all of the same commands that a real com port uses and it would behave the same.

First try to change the VISA Write to synchrounous, by right clicking on the VI and selecting synchronous and see if that works. If you are still having problems call the VISA Set Buffer after calling the VISA Open, with the mask set to 32 and the size set to something larger than the number of bytes you plan to write out. That will disable the Flush that is called after every write.

I hope this helps out.

-Josh
0 Kudos
Message 9 of 12
(5,819 Views)
Thanks for the idea. Unfortunatly, it still doesn't work. I have an idea of what the problem might be. Upon my investigation into the feasibility of using kernel32.dll to write to the serial port, I noticed that the writefile call, does not return a bytes written value. Instead it only returns a value of 1 for a complete operation. If VISA is looking for a bytes written count to identify a proper write, this would explain the behavior I am seeing.  I am still open to any ideas. Thanks Again!
 
0 Kudos
Message 10 of 12
(5,805 Views)