Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with writing to a serial port.

I've just started using LabView and I'm having some trouble writing data to a device through a Serial Port.
 
The device works fine through MTTY except that I have to disable the DTR and RTS lines and set the baud rate to 115200, when I try the same approach through LabView: Property Node -> [Write to] DTS/RTS State -> [Constant] Unasserted my commands go through to the buffer but do not execute.
 
For example.  If I input x -> [Write] -> b -> [Write] -> a -> [Write] I get no errors, but the commands do not execute, however, when I reconnect MTTY and hit 'enter' xba pops up on the command line, gets sent to the device and causes an error.
 
Is the data getting trapped a buffer?  Am I not using the right write command? (pardon the pun)  I've tried using termination characters /n, /r and 0xA but they just get added to the command I'm trying to execute.
 
Questions:  Do I need to use VISA Open?  And if so do I set my settings before or after the open?
 
I've included a screenshot of my block diagram and the settings on MTTY in case I missed something.
 
Any help would be greatly appreciated.
 
PS:  Why does the spell checker on the ni.com forum flag LabView as spelled wrong? 🙂
0 Kudos
Message 1 of 8
(4,342 Views)

I think my problem just became even simpler...

How can I output a carrage return to the VISA Write command?

Robert

0 Kudos
Message 2 of 8
(4,335 Views)
Hi

In LabVIEW you can find the CR constant in the string palette

 


Message Edited by Albert Geven on 11-16-2007 02:54 PM
greetings from the Netherlands
0 Kudos
Message 3 of 8
(4,329 Views)

Thanks Albert,

That solution works off of my USB -> serial port adaptor, but when I compile the app and move it over to a desktop and try to run it through a regular serial port I'm back to square one.  MTTY works but the app doesn't... it's no big deal really, I can use a USB -> Serial adaptor but this is the first time I've ever had LESS trouble with a USB -> Serial then with straight serial control.

Thanks again for the help.

Robert.

0 Kudos
Message 4 of 8
(4,305 Views)
When you build an application, you should also create an installer and when you create the installer, you should also include the VISA run-time. You can also select to install MAX. With MAX, you can then veruify that VISA is installed and also test the port.
0 Kudos
Message 5 of 8
(4,299 Views)

I still can't get the desktop Serial port to work, and the USB -> Serial adaptor won't work on it either.  I've probed the 6 data lines going into and out of the device being controlled and it seems that every command I send from the desktop is resetting the device.  The only difference I can see is that the desktop calls the port a ASRL port and my laptop calls is a COM port. 

Any difference between these two?

Robert.

0 Kudos
Message 6 of 8
(4,290 Views)
Dennis,
 
I tried downloading the VISA Run Time environment, is 4.0 the most recent version?
 
Robert.
0 Kudos
Message 7 of 8
(4,277 Views)
No, the latest is 4.2. What version do you have on your development pc and what version of LabVIEW do you have?
0 Kudos
Message 8 of 8
(4,265 Views)