Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot "see" USB/RS485" device?

I have a motor controller that I am operating from a USB/RS485 connection, (through a virtual com port, I believe).  I can use the vendor's s/w to control the motor, but, I cannot see the hardware on MAX.  It does not show up on Devices and Interfaces.  What am I missing?  I have both NI-VISA and NI-SERIAL installed, and used the serial connection to successfully send/receive from an Agilent 34401A digital multimeter using the NI USB/RS232 cable.

 

What am I missing here in order to communicate from the USB/485 cable to the motor controller which accepts simple alphanumeric string commands.  All I need to do is be able to send strings out through the USB port.  How do I do this?

 

Dave

0 Kudos
Message 1 of 16
(10,823 Views)

Which device are you referring to? The USB-RS485 controller or the motor? If you're referring to the motor, it will not show up since it's a serial device. There is no established protocol for serial devices for identification. This applies to all serial devices. If you are referring to the USB-RS485 controller is this a National Instruments controller, or a third-party controller?

0 Kudos
Message 2 of 16
(10,815 Views)

I am referring to the USB/RS485 converter. When I plug it into my PC, a little bell rings, and there is a notification at the lower right hand corner of my screen about "New Hardware Found..." and it shows up in my device manager.  However, it does not show up in MAX.  It also functions properly using the other vendor's control s/w, but, I need to use Labview.

 

At this point, MAX does not see anything.  MAX does not see the USB/RS485 converter (3rd party, not NI); MAX does not see the controller, and MAX does not see the motor/encoder.  I was told that the USB/RS485 cable, not supplied by NI, might not be recognized by MAX depending on the drivers inside that cable. 

 

Instead, I was told that if I get the NI USB-RS485, then, MAX would recognize that, and I could send alphanumeric commands through the resulting serial connection and operate my motor controller that way

 

Alternatively, I was told that if I changed the controller interface from RS485 to RS232, I could similarly use my NI USB-232 cable, which is recognized by MAX, and similarly send the alphanumer commands to the controller through it.

 

Do you agree with both of these ideas?

0 Kudos
Message 3 of 16
(10,810 Views)

OK, sorry for the "moving target" nature of this request.  After exiting and re-entering MAX and hitting REFRESH enough times, now, suddenly MAX can see the USB/RS485 converter.  It allows me to open a VISA Test Panel etc.  See the attached screen capture.

 

Now, however, I am not sure how to send test commands through the VISA test panel.  Does the VISA test panel allow one to send commands through the serial data port to activate my controller?  I have done this with my Agilent DMM, so, I assumed that I can send commands to the motor controller the same way.  The vendor s/w works fine, so, we know that the motor and controller hardware are properly wired and powered, but, the VISA test panel does not cause any response from the motor.  COM4 is the port.  The port settings are also correct.

 

Also, I observed that if the VISA test panel and the vendor s/w are open at the same time, the vendor s/w does not work.  But, as soon as I close MAX, the vendor s/w works fine.

 

Should I be able to send commands from the VISA test panel?

Do I need to use the NI USB/RS485 or USB/RS232 cable to solve this problem? 

 

Thanks,

Dave

0 Kudos
Message 4 of 16
(10,803 Views)

Do you have documentation about the protocol used by the motor controler ? Does the protocol require some specific timing ? The SCPI protocol used by the Agilent DMM is not very time sensitive. It only requires that the DMM answers read requests in a defined time. If the protocol for the motor controler requires that you answer some messages of the motor controler in a specific time, you will probably get problems to do that manually with the VISA panel.

 

Another point are the control lines ( e.g. RTS,CTS) of the serial port. Are you sure that you are setting up them in the way required by the controler ?

0 Kudos
Message 5 of 16
(10,795 Views)

 


dav2010 wrote: 

Do you agree with both of these ideas?


 

No, because it's all wrong. It has nothing to do with the cables as far as what's recognized. MAX will not recognize devices that are not made by NI. It doesn't matter what cable you use. All that you will see in MAX are the serial ports, NOT the devices. You screenshot showing COM4 is all that you're supposed to see. As I told you, you will NEVER see a serial device in MAX. All that you will ever see are the ports. That's because there is no protocol for identification on the serial port.

 

 


 I was told that the USB/RS485 cable, not supplied by NI, might not be recognized by MAX depending on the drivers inside that cable. 


Who told you this? Was this someone from NI? Regardless, it's complete nonsense. Cables don't have drivers. They're just wires.

 


Now, however, I am not sure how to send test commands through the VISA test panel.  Does the VISA test panel allow one to send commands through the serial data port to activate my controller?  I have done this with my Agilent DMM, so, I assumed that I can send commands to the motor controller the same way.  The vendor s/w works fine, so, we know that the motor and controller hardware are properly wired and powered, but, the VISA test panel does not cause any response from the motor.  COM4 is the port.  The port settings are also correct.


The best guess is that you are not sending a termination character for the write command. Look at the documentation for the motor. It will tell you whether commands are supposed to end with some characters. Usually this is a carriage return or a linefeed, or both.

 


Also, I observed that if the VISA test panel and the vendor s/w are open at the same time, the vendor s/w does not work.  But, as soon as I close MAX, the vendor s/w works fine.


That's because the operating system will not allow more than one application to access the serial port at the same time. It's either the VISA test panel or their software. You cannot have both running at the same time.

 


Should I be able to send commands from the VISA test panel?

Yes. As I said, please look at the documentation to see the proper format for the commands.

 


  Do I need to use the NI USB/RS485 or USB/RS232 cable to solve this problem?

 No. As I said, this has nothing to do with the cables.

 

 

 

Message 6 of 16
(10,785 Views)

Thanks for your explanation, but, I am still confused about a few comments.  Hope you can clarify.  I am grateful that you disagree with the other guys, because their answer is basically, "throw more h/w at it" and this costs money, and does not guarantee results.  THANKS!

 

"MAX will not recognize devices that are not made by NI. It doesn't matter what cable you use."  I use the NI USB-232 cable to communicate with Agilent 34401 meter.  The VISA test panel allows me to send/recieve commands to the Agilent device through the NI USB-232 cable.  In this case, isn't the MAX recognizing the Agilent device?  For example, when I use the command /IDN*? (sorry if the syntax is in error here) it shows the Agilent device.  Using the same command, we do not see any response from the motor controller.

 

Additionally, in the case of the 3rd party vendor, his cable (USB-RS485) is recognized by MAX as a COM port, as shown in the screen shot, COM4.  Perhaps I am misunderstanding the meaning of how you are using the word "recognize".  Or, are you saying that there is a difference between recognizing a COM port and recognizing the device?

 

"Who told you this? Was this someone from NI? Regardless, it's complete nonsense. Cables don't have drivers. They're just wires."  The guy on the NI telephone helpline told me this (PHONE AN ENGINEER); sorry I can't remember the name.  Also, he told me that the cables are not just wires, but, instead contain a circuit board and components in the connector.  This is consistent with my experience using non-NI adaptors for USB to RS232 that all failed with MAX.  Only the NI USB-232 cable actually worked and allowed me to communicate with the Agilent DMM.

 

Regarding the commands and making sure that they are properly entered, I am copying and pasting them directly from the vendor's s/w as they are entered there.  In other words, the command is entered in the vendor's user interface, and executed, and the motor behaves as expected.  I then COPY the command directly from the interface and PASTE it into the VISA test panel, and there is no response.  I also took note of your explanation about having 2 applications trying to access the same serial port, and so, I closed the 3rd party vendor's s/w to eliminate this issue, but, still it fails.  I am confident that the command is being input properly.

 

One additional observation that I made is the following.  On MAX, under TOOLS, there is NI-VISA>>VISA Interactive Control.  When I select VISA Interactive Control, I get "RUNTIME ERROR, R6030 -CRT not initialized"  Could this be contributing to this issue?  Should I get a different response when I select VISA Interactive Control?  It happens whether or not devices are plugged in or no plugged in.  Equally puzzling is that when all the devices are NOT PLUGGED into the USB port, MAX still identifies a COM3 them and indicates "This device is working properly".  Why would it show this message if nothing is plugged into any USB port?  COM3 has the port settings for the Agilent 34401A digital multimeter.  Is there a s/w issue happening?

 

Thanks again for your help!!!

 

 

0 Kudos
Message 7 of 16
(10,779 Views)

 


dav2010 wrote: 

"MAX will not recognize devices that are not made by NI. It doesn't matter what cable you use."  I use the NI USB-232 cable to communicate with Agilent 34401 meter.  The VISA test panel allows me to send/recieve commands to the Agilent device through the NI USB-232 cable.  In this case, isn't the MAX recognizing the Agilent device? 


No, MAX is not "recognizing the Agilent device". It's recognizing the existence of the serial port. It has no knowledge (and cannot have knowledge) of what's at the other end of the cable. You have to make a distinction between the serial port and the controller (the USB/serial port controller) and the instrument/device (the motor or the 34401). Part of the problem here is that you are using the same word to mean two different things. Once the drivers for the serial port controller are installed, then MAX will see a serial port. That's all that it will see. It will never see the devices connected at the other end of the serial port cable.

 

 

 


dav2010 wrote: 

For example, when I use the command /IDN*? (sorry if the syntax is in error here) it shows the Agilent device.  Using the same command, we do not see any response from the motor controller.


 

Do you know for a fact that the motor even implements the *IDN? command? If it doesn't then there's no way it's going to respond.

 

 


Additionally, in the case of the 3rd party vendor, his cable (USB-RS485) is recognized by MAX as a COM port, as shown in the screen shot, COM4.  Perhaps I am misunderstanding the meaning of how you are using the word "recognize".  Or, are you saying that there is a difference between recognizing a COM port and recognizing the device?

 

Yes. The controller is recognized in Windows. MAX will then be able to "see" the serial ports that are provided by the controller. As I've said numerous times, MAX will never see the devices (instruments) that are connected via a serial interface.

 

 


"Who told you this? Was this someone from NI? Regardless, it's complete nonsense. Cables don't have drivers. They're just wires."  The guy on the NI telephone helpline told me this (PHONE AN ENGINEER); sorry I can't remember the name.  Also, he told me that the cables are not just wires, but, instead contain a circuit board and components in the connector.  This is consistent with my experience using non-NI adaptors for USB to RS232 that all failed with MAX.  Only the NI USB-232 cable actually worked and allowed me to communicate with the Agilent DMM.


 

OK, that's different. When you were talking about a cable I thought you were talking about a cable that connects between some box (like the NI USB-232/2) and the computer. There are "cables" that have basically miniaturized controllers that are stuck at one of the ends of a cable. The NI USB-232 is one such example. The NI products require NI-Serial as the driver in order to get Windows to recognize the controller. A third-party vendor would have their own drivers for the controller so that Windows will recognize them. Once the drivers are installed then MAX will see the (virtual) serial ports that these controllers provide.

 

Also, you said that this third-party products is an RS-485 product, not an RS-232 product. RS-485 and RS-232 are not the same thing, and require different cabling. The 34401 meter is an RS-232 instrument, not an RS-485 instrument. Is the motor an RS-232 or an RS-485 instrument?

 

 


Regarding the commands and making sure that they are properly entered, I am copying and pasting them directly from the vendor's s/w as they are entered there.  In other words, the command is entered in the vendor's user interface, and executed, and the motor behaves as expected.  I then COPY the command directly from the interface and PASTE it into the VISA test panel, and there is no response.  I also took note of your explanation about having 2 applications trying to access the same serial port, and so, I closed the 3rd party vendor's s/w to eliminate this issue, but, still it fails.  I am confident that the command is being input properly.

How do you know that the application isn't appending (for your convenience) a character to whatever string you enter on the front panel to be ther termination character? You don't, unless you use a program like PortMon to see what's actually going over the serial port, or you, as I said, LOOK AT THE DOCUMENTATION FOR THE MOTOR TO SEE THE PROPER FORMAT OF THE COMMAND.

 

 

 


One additional observation that I made is the following.  On MAX, under TOOLS, there is NI-VISA>>VISA Interactive Control.  When I select VISA Interactive Control, I get "RUNTIME ERROR, R6030 -CRT not initialized"  Could this be contributing to this issue?  Should I get a different response when I select VISA Interactive Control?  It happens whether or not devices are plugged in or no plugged in.  Equally puzzling is that when all the devices are NOT PLUGGED into the USB port, MAX still identifies a COM3 them and indicates "This device is working properly".  Why would it show this message if nothing is plugged into any USB port?  COM3 has the port settings for the Agilent 34401A digital multimeter.  Is there a s/w issue happening?


That's a C Run-Time error. It's possible you may have a corruption with drivers since you've been mucking around with hardware and potentially software. My suggestion is to uninstall NI-Serial and NI-VISA. Also uninstall the driver software you got with this third-part USB<>Serial product. Then, reboot the computer. Reinstall NI-Serial and NI-VISA, and use the NI "cable" (which is really a controller). Verify that you can communicate with the 34401. Then, review the documentation for the motor to see the list of commands and what you need to send to communicate with it.

 

Message 8 of 16
(10,772 Views)

Part of the problem here is that you are using the same word to mean two different things. Once the drivers for the serial port controller are installed, then MAX will see a serial port. That's all that it will see. It will never see the devices connected at the other end of the serial port cable.

 

**THANK you very much for taking the time to clarify that for me.  I knew that I was confused about it, but, didn't know how to ask the question correctly.

 

  

Do you know for a fact that the motor even implements the *IDN? command? If it doesn't then there's no way it's going to respond.

 

**After discussions with the vendor, it is a half-duplexed device, and does not return anything, so, you are right.  We should not expect anything to come back from *IDN? command.

 

Also, you said that this third-party products is an RS-485 product, not an RS-232 product. RS-485 and RS-232 are not the same thing, and require different cabling. The 34401 meter is an RS-232 instrument, not an RS-485 instrument. Is the motor an RS-232 or an RS-485 instrument?

 

**The motor controller is operated from a USB to RS485 converter.  The controller is a RS485 device.  The vendor supplies this converter from USB to 4-wire RS485.   The 4-wires go to the controller. \ I understand that RS232 and RS485 are different.  My point was that I cannot get either to work now, and previously, we did have successful communication with the RS232 to the Agilent DMM. I cannot use MAX to talk to either device now, regardless of the h/w set.  I have the NI USB/RS232 converter cable.

 

 

How do you know that the application isn't appending (for your convenience) a character to whatever string you enter on the front panel to be ther termination character? You don't, unless you use a program like PortMon to see what's actually going over the serial port, or you, as I said, LOOK AT THE DOCUMENTATION FOR THE MOTOR TO SEE THE PROPER FORMAT OF THE COMMAND.

 

**Here is what I did.  I also used the Windows HYPERTERMINAL to send the command strings, the motor behaved as expected.  In addition, I asked the vendor if there is an automatic appending etc. and he said "NO."   So, if the same string works with the HYPERTERMINAL and the vendor-provided s/w, then, I am confident that I am using the proper format of the command from MAX.

 

 

That's a C Run-Time error. It's possible you may have a corruption with drivers since you've been mucking around with hardware and potentially software. My suggestion is to uninstall NI-Serial and NI-VISA. Also uninstall the driver software you got with this third-part USB<>Serial product. Then, reboot the computer. Reinstall NI-Serial and NI-VISA, and use the NI "cable" (which is really a controller). Verify that you can communicate with the 34401. Then, review the documentation for the motor to see the list of commands and what you need to send to communicate with it.

 

**OK, here is what I did.  I uninstalled ALL the National Instruments s/w, completely, everything, including the Labview 2010.  Then, instead of using the DVD's that were shipped to me, I used my serial number and activation code, and downloaded (quite tediously) the Labview 2010, the Application builder, NI-VISA, NI-SERIAL and NI-DAQmx.  So, all the s/w is dated 4/2/2011 on my Windows Explorer view and is the most recent revision.  Then, I used SETUP.EXE for each of them and they are all fresh, and new.  Still, there is this annoying RUNTIME error, and I cannot communicated through the serial port to the motor controller the same way I can using the Windows HYPERTERMINAL or the vendor s/w.   I also uninstalled the vendor s/w prior to uninstalling the NI s/w.  I did not re-install the vendor user interface.  It is gone from my system.  I also cannot communicate to the 34401 like I did a month ago.

 

**So, Do you have any idea why this thing is being so stubborn?  Also, there remains this mysterious COM3 that is listed under Devices and Hardware on MAX, even when nothing is plugged into the PC.  Furthermore, the DELETE option for that COM3 is grey and disabled when I right click it.  I have spent many hours in the last 2 days uninstalling, downloading, installing, rebooting etc... lots of hours.  What is happening here?  Why does the s/w appear to be stubbornly corrupted?

0 Kudos
Message 9 of 16
(10,758 Views)

 


@dav2010 wrote:

**After discussions with the vendor, it is a half-duplexed device, and does not return anything, so, you are right.  We should not expect anything to come back from *IDN? command.


You didn't understand what I said. The fact that it's a half-duplexed device is completely irrelevant. All that matters is what commands the motor understands. I have yet to hear from you that you've actually OPENED THE MANUAL AND READ IT to see what commands the motor understands. If the motor does not implement the *IDN? command, then it's not going to respond, regardless of whether it's a half-duplex or full-duplex.

 

 


**Here is what I did.  I also used the Windows HYPERTERMINAL to send the command strings, the motor behaved as expected.  In addition, I asked the vendor if there is an automatic appending etc. and he said "NO."   So, if the same string works with the HYPERTERMINAL and the vendor-provided s/w, then, I am confident that I am using the proper format of the command from MAX.

There can't be an "automatic appending" by the motor. You're the one responsible for that. HyperTerminal is adding the carriage return for you. The vendor's software is probably doing the same thing. You don't see that on the screen. Apparently, I can't repeat this often enough: OPEN THE PROGRAMMING MANUAL FOR THE MOTOR AND READ IT. See what it says about terminating commands. See what it says about the list of commands it understands. See what it says about how to format the parameters for the commands.

 

 

 


**OK, here is what I did.  I uninstalled ALL the National Instruments s/w, completely, everything, including the Labview 2010.  Then, instead of using the DVD's that were shipped to me, I used my serial number and activation code, and downloaded (quite tediously) the Labview 2010, the Application builder, NI-VISA, NI-SERIAL and NI-DAQmx.  So, all the s/w is dated 4/2/2011 on my Windows Explorer view and is the most recent revision.  Then, I used SETUP.EXE for each of them and they are all fresh, and new.  Still, there is this annoying RUNTIME error, and I cannot communicated through the serial port to the motor controller the same way I can using the Windows HYPERTERMINAL or the vendor s/w.   I also uninstalled the vendor s/w prior to uninstalling the NI s/w.  I did not re-install the vendor user interface.  It is gone from my system.  I also cannot communicate to the 34401 like I did a month ago.

 

**So, Do you have any idea why this thing is being so stubborn?  Also, there remains this mysterious COM3 that is listed under Devices and Hardware on MAX, even when nothing is plugged into the PC.  Furthermore, the DELETE option for that COM3 is grey and disabled when I right click it.  I have spent many hours in the last 2 days uninstalling, downloading, installing, rebooting etc... lots of hours.  What is happening here?  Why does the s/w appear to be stubbornly corrupted?


 

You do not need DAQmx. You only need DAQmx if you have a data acquisition board. When you uninstalled the vendor software did you also uninstall the drivers for the RS485 controller?  Which cable are you trying to use? If you're using the NI cable then you'd need NI-Serial.

 

When you were communicating with the 34401 were you using the VISA test panel, or the instrument drivers? Havbe you verified the settings on the meter to make sure they haven't been changed?

 

As for the issue with COM3, does it show up in the Windows Device Manager? If it does, then it will show up in MAX. If it does not show up in the Windows Device Manager, you may need to reinitialize the MAX database. There is also a tool in the NI Community, but I have never used it, so I cannot attest to its effectiveness, or lack thereof.

 

0 Kudos
Message 10 of 16
(10,742 Views)