11-18-2015 10:35 AM
I am trying to remote control the MKS 647B Mass Flow Controller and Aglient 33120A Function Generator for my college capstone project.
I have installed NI-VISA (for RS232 control) and NI-488.2 (for GPIB control). I downloaded the drivers via LabVIEW:
Tools>>Instrumentation>>Find Instrument Drivers...
Using the example provided with the driver for the function generator, I have remote control working via GPIB, but I cannot get RS232 control to work. I would just work with GPIB control, but the MKS 647B does not have a GPIB port so I have to use RS232 communication.
Since I know the function generator drivers work, I have been doing my RS232 testing with the function generator. I have checked the Parity, Baud Rate, and Data Bits to make sure they all match and they do, however, every time I run the program I continuously get error -1073807253 when trying to initialize the VISA connection between the PC and function generator. I also get error:
"VISA error code 0xBFFF0072
The resource is valid, but VISA cannot currently access it."
when trying to connect via NI-MAX.
I have been through quite a few support forums and tried many different solutions, but none have worked. The only thing I have not tried is a new serial cable, but I'm not sure exactly which one I need so I have put off buying a new one.
I have attached the .vi I am using as well as an image of the .vi for quick reference. Ignore the error code in the image, I did not have the function generator attached when I ran it.
Does anyone have any thoughts on what could be going wrong? Or could someone send me a link to the serial cable I should be using (I need it to be female DB-9 to USB)?
Solved! Go to Solution.
11-18-2015 10:42 AM - edited 11-18-2015 10:45 AM
The description in the error code is pretty accurate: "The resource is valid, but VISA cannot currently access it" indicates that the serial port is reserved/in-use by another application.
You should check that you don't have any other applications open that are trying to access the serial port - e.g. LabVIEW (if you didn't call VISA Close, the resource stays locked until you completely exit LabVIEW), NI-MAX or any other serial programs.
Also - your screenshot shows you're using LPT1...a parallel printer port? You should check in device manager which serial port you are using (it should be something like COM1).
11-18-2015 10:57 AM - edited 11-18-2015 11:04 AM
Sorry I should have taken the image while the function generator was connected. I am using COM4 which works perfectly fine when using GPIB control.
I have tried running VISA close immediately before the intialization process and got the same error. I've attached an image of what I tried.
I won't be able to get back to the equipment until later tonight (approx 7 hours from now) to test, but I'm fairly certain I have run the program while my LabVIEW program is the only program running on my laptop.
11-18-2015 11:08 AM
What about other applications? Have you closed NI-MAX? Were you using any other applications to test the device?
Have you tried restarting your computer (to ensure all applications have released the serial port)?
11-18-2015 12:18 PM
What drivers does your usb to serial device use. I found some references that the FTDI drivers/chips work best. I have Prolific drivers/chips in the devices on hand, and I'm having problems. I've ordered, and expect, a new device that uses FTDI drivers/chips.
I am working with usb to RS485 right now. http://www.nordfield.com/usb-serial-rs485-adapter
If you find a usb to RS485 that works well please list it as I have a future project that will need a couple of these.
Here is a link to the NIsingle port usb to rs232 convertert which should work... I haven't tried it yet.
http://sine.ni.com/nips/cds/view/p/lang/en/nid/12844
11-18-2015 12:42 PM
@Sam_Sharp
I'll try restarting my computer and get back to you ASAP.
@PatrickLye
I don't have any information on the cable I'm using. It is just something I found in a bin of serial cables.
I found a serial cable (RS232 to USB) online from StarTech that uses an FTDI chip. Do you happen to know what purpose the FTDI chip serves? From what I can find online it seems like the chip is an extra, unnecessary accessory.
11-18-2015 12:54 PM
Converting usb to rs232. It isn't a straight wire conversion. There are also options for optical isolation depending on what devices you buy. It is best to be optically isolated whenever possible. You would have to get the exact chip part number to get more depth. FTDI is just another chip manufacturer.
11-18-2015 02:35 PM
11-18-2015 08:20 PM
@Sam_Sharp
I restarted my computer and got a different error. I attached a new image of my code while the F-Gen is attached as well as the showing the error I get.
The error is "-1073807346: Invalid VISA session"
If I open up the Initialize Sub-VI and run that, I get a different error: "-1073807339: Timeout" as the Error Sub-Sub-VI tries to run.
I've found a few forums that say it is likely just an error in the termination character, but I don't see anywhere to change the termination character.
@PatrickLye
Thanks for the information on serial to USB convertion. I didn't know that! Definitely very helpful to know when doing RS232 communication.
The drivers that my computer uses by default are <Prolific USB-to-Serial Comm Port Version: 3.6.81.357 [9/4/2015]>, but when using those my computer doesn't recognize the device. In order to get my computer to recognize the device I had to backdate my drivers to version <Prolific USB-to-Serial Comm Port Version: 3.2.0.0 [7/31/2007]>.
@Everyone
Random thought, all the drivers and programs that I'm using say they are compatible with Windows up to Windows 8. Could the fact that I'm running Windows 10 be causing this problem?
11-18-2015 08:47 PM