11-05-2012 08:49 AM
What kind of USB - serial device are you using? Is it an NI device or 3rd party? I have never been able to get a 3rd party USB - serial converter to work consistently or well in LV/Visa. I always go with old school, on-board serial.
11-05-2012 09:26 AM
@Omar_II wrote:
"When I plug it into the serial port, I can get it connected, but not via USB."
Are you saying by "connected" that you are able to send and receive commands when connected to a "built in" comm port of your PC using a program like Terra Term or Hyper Terminal, but not able to send and receive commands when using a 3rd party "RS-232 to USB" converter? Then your problem is with your "RS-232 to USB" device, it's driver and how the device drivers are installed.
The settings in MAX are only the default settings if you do not explicitly set them when using LabVIEW. The settings in MAX will have NO effect when using a terminal program like Terra Term or Hyper Terminal. There are also default com port settings in the Device Manager of Windows. But don't rely on the default setting, but explicitly set them yourself in the application that you are using.
"I get the very same error when I plug my power supply into the serial port of my computer and try to run the test VIs"
Note the Termination setting!
Just as a sanity check. Check the power supplies system remote interface settings
The power supply is shipped with both an GPIB (IEEE-488) interface and an RS-232 interface on the rear panel. Only one interface can be enabled at a time. The
GPIB interface is selected when the power supply is shipped from the factory.
The remote interface can be selected from the front-panel only.
•The interface selection is stored in
non-volatile memory, and does not change when power has been off or after a remote interface reset.
•If you select the GPIB interface, you must select a unique address for the power supply. The current address is displayed momentarily on the front panel when you turn on the power supply.
1
•Your GPIB bus controller has its own address. Be sure to avoid using the bus controller’s address for any instrument on the interface bus. Agilent Technologies controllers generally use address
"21".
•If you enable the RS-232 interface, you must select the baud rate and parity to be used. "RS-232" is displayed momentarily on the front panel when you turn on the power supply if you have selected this interface.
2
~~~Oh magic 8-ball It the supply set to the factory default GPIB remote interfacce? ~~~~
11-05-2012 10:54 AM - edited 11-05-2012 10:56 AM
Hello Omar,
That really was the mistake.. The opower supply still was set to HPIB / 488 ( I am a bit embarassed..) After I switched this setting on the device, I was able to set it via RS 232.
I am however still not able to access the device via USB.
Highlight execution mode showed me that problem lies in the initialize- Sub VI of the driver, which expects the ID of the power supply, and instead gets the ID from the adapter (or nothing?)
Setting ID Query and Reset to "NO" solved this problem. However the close VI and the error query also seemed to have problems, which means that I would have to disable the error query in all of the other sub VIs of the driver...
What would you do? I somehow think it would be a bad idea to just disable all the stuffs and hope fopr the best...
Thank you very much for the example for setting the default values myself. I did not know that and it helped a lot!
Thanks again,
Keksbold
11-05-2012 10:59 AM - edited 11-05-2012 11:02 AM
I would suspect the Serial- USB adaptor may not support the voltage level the RS-232 really needs on that supply's com port (Agilient expects +/-12 level for RS-232 and most USB adaptors just output TTL levels.
I guess the 8-ball is working fine today.
11-05-2012 12:46 PM - edited 11-05-2012 12:58 PM
USB to RS-232 converters are not all created equal.
But, I just checked an E3631A Agilent Power Supply with a USB to Serial that we had in house using the LabVIEW Snippet that I posted earlier.
*IDN? returned
HEWLETT-PACKARD,E3631A,0,2.1-5.0-1.0
Windows Device Manager reports it as a "Tripp Lite USB to Serial Bridge"
Searching VID_067B PID_2303 tell me it uses the Prolific Technology chip set.
Check the spec on YOUR USB to Serial, but I suspect that you do not have something connected correctly.
In my test at first I had problems with the cabling.
I first made sure I could communicate through my "built in" or "on board" com port using the LabVIEW snippet I posted with the correct cable and gender changer and NULL modem. Then moved the cable connection to the USB and changed the Com port ref on the block diag. Everything worked the same.
11-08-2012 03:24 PM - edited 11-08-2012 03:28 PM
Hello to everyone, 🙂
I am using a "plugable USB Serial converter" which uses a Prolific PL2303HX D chipset. It's RS 232 - VDD is 3.3 V ~5.5 V,
does this mean it is not capable of outputting the voltage my power supply needs to be controlled?
I have tried to copy your VI Omar, but somehow I couldn't get it to run, I really don't know why, but everything I get is the error
"-1073807339 VISA Read in ID Query Manually - 1.0.vi" (ID Query Manually is the VIs name (I have attached it..)
I am very surprised to get the error even when I try to read the ID via RS-232...
In windows device manager my adapter appears as "Prolific USB-to-Serial COMM Port"
One of my other approaches was it, that the interconnected adapter disturbs the IDN - transmission, or even brings in it's own IDN.
So I tried switching off the ID query in the initialize Sub VI of the driver. This seemed to work, but the next error appeared when it tried to reset.
So I began taking a closer look at the driver in Highlight Execution mode and started decoupling all the stuffs which made problems:
Setting the ID Query? to NO
Setting Reset? to NO
And then I had to remove the error query (even if I feel kind of bad about just removing the error query..)
That made the initialize sub VI run.
After that I had to remove the error queries from the Configure Output and the Configure Current Limit as well, which made these work too.
I don't know whether this strategy would have been successful, because at the moment I am having trouble with the Read Output VI, where "VISA Read" gives me an error. I really don't know how to solve this, and am pretty sure that a simple decoupling would not be a good idea.. 😉
Does anybody have an idea why I am not even able to get the IDN via MAX, or whether there is any use in rebuilding the driver at all?
Or do you think I should get myself another adapter?
During my research online, I have found out that prolific chips have kind of a bad reputation..
Regards and thank you all, I really appreciate you all trying to help me,
Keksbold
P.S.
Sorry, I am quite new to the world of online communities, and have made a blunder by crossposting.
I did not know this was not accepted and did not plan on playing someone off against someone else,
As soon as the problem is solved I will post the solution everywhere I asked for help.
Thanks and sorry again.
Crossposts:
http://www.labviewportal.eu/viewtopic.php?f=18&t=5359&p=44684#p44684
http://www.labviewforum.de/Thread-Agilent-E3631A-ueber-Labview
11-08-2012 04:31 PM
-1073807339 is a timeout error. Commands are not getting out to the power supply and back.
Or you could have the setting for "Termination" wrong in LabVIEW. LabVIEW could read back some number of bytes but still throw a timeout error.
I would close down LabVIEW and work with a terminal program like Tera Term or HyperTerminal to work out problems with your hardware. I have been doing RS232 communication for over 25 years and that is what I do so much so that normally I have a Tera Term window open most of the time when working with new RS232 devices. If you can't get it to work with a terminal program, LabVIEW is not going to be any easier.
Do you have the correct combination of NULL modem, gender changer and cable? The other day when I tested the same model of Power supply that you have, I was not able to plug the DB-9 side of my USB to RS232 directly into the back of the power supply, but needed a extra cable. The first cable I tried did not work. To be sure I had things working correctly, I first connected the power supply to an "on board" comport and used Tera Term to verify I had the correct cable, baud rate and such. Then moved the cable over to the USB and tested again in Tera Term. Closed down Tera Term and tried LabVIEW.
Try your "on board" serial port. Did you say that you had it communicating once that way? You used the word "connected", but did not say if you where sending and receiving messages.
Try another USB to Serial. We have a number of laptops using USB to serial converters to talk to meters and power supplies. Not without problems, but generally they work. Our biggest problem is if Bob trades USB com port with Frank, then the USB comport shows up on a different com port number. We fix that by having the software go out and hunt for the instrument on what ever comport it is on. But to do that you must be able to send *IDN? and read back a reply.
11-12-2012 05:03 PM
Hello Omar,
my boss bought two USB to serial converters just for this task.
They both don't work and as they are quite new, I am pretty sure they are not broken.. 😞
I am also quite sure that I chose the right COM Port, as I always just plug it in and choose the one which newly appeared in the list..
I downloaded HyperTerminal and was able to make a connection via RS 232 AND via USB.
However I found out that I am obviously able to make a connecttion even if I just plug in the converter (not linked to the device, so JUST the converter)...
I am meanwhile able to connect to the device via RS232 and to control it successfully.
Actually I have to admit that I am just using a gender changer.. Do you think I need a NULL modem too?
Thank you very much for your help,
Keksbold
11-13-2012 03:12 PM
@Keksbold wrote:
I am meanwhile able to connect to the device via RS232 and to control it successfully.
Actually I have to admit that I am just using a gender changer.. Do you think I need a NULL modem too?
So by "RS232" you don't mean RS232 via your USB, but via an "on board" RS232 port in your computer?
Also connecting to a comport only means you are able to get as far as the com port itself. You can't tell if you are "connected" to a device until you actual try to send and receive messages.
On page 55 of my E3631A manual it say to use a NULL modem and has drawings showing how to wire up a NULL modem. If you are actually sending and receiving commands to the power supply, then what you have must be a NULL modem. If you are actually sending and receiving commands then you have the correct cabling and no need to change things. If it is working and you take the computer end of your cable and transfer it to RS232 end of your USB comport, change the com port ref and it fail to send and receive the same commands, Then the USB to RS232 are not compatible with your E3631A. They may not be "broken", but may not be designed to probvide the correct signal voltage levels for your power supply.
11-20-2012 09:52 AM
Hello Omar,
that solved the problem..
Obviously the RS323 to RS232 Wire I was using to control the power supply contains a NULL modem
(which I would never have suspected, because it is not written on it or sth. like that.. )
So my first fault were the front panel settings, and my second one was a missing NULL modem. I am a bit embarassed again..
Thank you so much for your help!!
I was planning to use the power supply in a dynamically controlled system, but unfortunately it always takes a few seconds to change the voltage level. I fear this might not be fast enough for my system. Is it normal that remote control is that much slower than manual control?
Thanks again,
Keksbold