LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Code is not running well on target PC

Solved!
Go to solution

Dear forumers,

I have developer PC and target PC. Communication is unreliable with the USB device on target PC. I built application exe that is to be running on target PC.When i open my application exe on target PC, COM selection gets confused. It won't refresh COM ports or shows COM11 instead of COM5. Next time i plugged in the device to the same USB port and it showed me COM6. When i unplugging the device will not affect the list of COM devices after refreshing it.

 

Note:

 

- I use 10m long 2.0 active USB cable,

- When i loose communication during data acquisition I connect my instrument to my developer PC and i get "" (empty string constant from the instrument). Labview shows me no communication error which is very strange.

- After communication lost, I connected the instrument to my developer PC and tesed it with manufacturer's serial communication application that could communicate with the instrument.

 

Developer PC config:

Developer_PC.jpg

Target PC config:

Target_PC.jpg

 

Target PC confguration must be compatible with currently running application exe.

 

Could someone please tell me how to fix this issue?

 

Kind regards,

Balázs

0 Kudos
Message 1 of 7
(1,364 Views)

Which device gets which com port is determined by the OS.

 

There's little you can do about it.

 

You can make the com ports selectable by the user or from file. (Recommended)

 

Or, loop over all com ports available and try to use *IDN?, etc. to figure out which device is connected where.

0 Kudos
Message 2 of 7
(1,341 Views)

Alternatively, if you have a desktop PC, use the onboard serial port and assign it to the same COM port as your dev PC.  I Hate USB to RS-232 adapters.  They are evil.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 7
(1,328 Views)
  1. What brand USB-Serial device is it?
    1. Hopefully it is an FTDI device
  2. Windows 7 and newer should "remember" what Com port was assigned to what device UUID is plugged into what port.
  3. Judging by the high port numbers you have been plunging in a lot of these devices. Windows remembers it gave the device you plugged in months ago Com4 that's why you are up in the com11 range now.
  4. Control Panel-->Device Manager-->Ports(COM & LPT)
    1. Select the port
    2. Select "Advanced"
    3. That allows you to select what Com Port is assigned to it
  5. You will see a list of Com Ports marked "In Use" that are obviously not in use because they are not plugged in.
    1. These are the Com Ports that are reserved and waiting for that certain device UUID to be plugged back in.
    2. You can clear these ports that are marked "in use", Google it.
  6. Another suggestion is to create a "VISA Alias" for your device. I know it seems like an extra step for one device on one port but when you have a system with multiple devices on multiple ports it's a Godsend.
========================
=== Engineer Ambiguously ===
========================
Message 4 of 7
(1,298 Views)

"I use 10m long 2.0 active USB cable"

 

Any chance you can shorten that?  5 meters or less is best for USB, with 2m and under being even better.  10m is asking for problems.

0 Kudos
Message 5 of 7
(1,278 Views)

@Kyle97330 wrote:

"I use 10m long 2.0 active USB cable"

 

Any chance you can shorten that?  5 meters or less is best for USB, with 2m and under being even better.  10m is asking for problems.


Also, do you use that cable for the development and the target?

 

If you're going to compare, that might make a big difference.

0 Kudos
Message 6 of 7
(1,236 Views)
Solution
Accepted by topic author LTBALAZS

It was because of a contact issue with the mini USB cable that goes into the instrument. After I replaced the USB->Mini USB cable to another one the configuration is working well with 10m long active USB cable.

 

Kind regards,

 

Balázs

0 Kudos
Message 7 of 7
(1,186 Views)