Automatically detect com port

Hello
I would like to create a User Event that defines which method data is provided to the VI (either Serial port or Telnet). If it is Serial port then I would like the VI to automatically find the correct data port that is providing valid instrument data and then stream the data to the screen. If it is a Telnet connection then the IP addresses are pre-determined and the data will also stream to the screen.
As you can see in the attached VI, I am chasing my tail. I can successfully configure my Serial ports to my instrument thanks to some previous help but when I try to build an automatic COM port detection loop, I make a mess of it and my clean-working VI get all gunked-up.
Will someone please put me back on track? What are the key elements that I am missing in this logic?
Thank you so much.
~Derailed
p.s LabView 2009 on MacOSX
p.p.s. I just found this in the forum help topics and will explore it, but I think I need additional logical sequences to accomplish my goal.
http://forums.ni.com/t5/LabVIEW/ASRL-versus-COM-display/m-p/88100#M54017
Attachments:
NIMS4.vi ‏27 KB

So I simplified. Attached is a VI using VISA Find Resource to pipe a list to a While Loop that searches the com ports for valid packets.
When running with highlighted execution ON, I can see that the loop sees the correct com port and the logic is good but the VISA Read reads no data. I removed the Flush Buffer vi and increased the bytes to VISA Read but still have the same result - no data to screen.
I also tried to lengthen the amount of time the Mac might need to read the com port from 50ms to 100ms but still nothing. Any ideas?
Thanks,
~Almost back on one rail
Attachments:
ComPortDetect.vi ‏19 KB

Similar Messages

  • Lab View is not detecting two com ports of system

    Hi,
       In my PC, three com ports are there COM1, COM4 and COM6. But when we create new visa resource name, lab view is detecting only COM1 port. I want to know is there any way to correct this.
    Regards
    Shivakumar Singh

    Hi,
    First of all check if the ports are visible in the NI MAX. If not, you can try to Create New Port by going into Measuremenmt & Automation Explorer. Assign the Port values accordingly. This can be done by right clicking on the Ports (Serial & Parallel) section of the Devices and Interfaces tree.
    Regards,
    Deepu.

  • Automatically detect a Printer plugged to a serial port?

    Hello, is there a way for me to automatically detect with java if a printer is plugged in to a serial port (and if so, which one) on my computer.
    I am using javax.comm, but there is no such feature in there.
    Thanks in advance.

    I am not very familiar with this area but I am 99% sure you wouldn't get a signal to tell you are printer had been plugged in to a serial port.
    Your best bet is to spawn a new thread that polls the serial port looking for a new printer.
    Not very pretty I admit but it shouldn't be to hard to do.

  • Is there a way to automatically detect and delete duplicate photos in a library

    I just imported a load of photos into my main iPhoto '11 Library from several older MAC's Photo Libraries. Despite repeatedly using the "Don't Import Duplicate Photos" dialogue box, I have many duplicate photos. Is there a way to automatically detect and delete Duplicate Photos?
    I also have iPhoto Library Manager installed on my MAC, but cannot seem to locate on it anything that would do this.
    I have over 4,000 photos, so would really appreciate some help here! Thanks in advance...

    duplicate annihilator - http://www.brattoo.com/propaganda/
    And NEVER import an iPhoto library into another iPhoto library - doing so des not work and creates massive duplication
    if you still have all of the original iPhoto libraries I recommend you drag the bad one you created to the desktop (delete it later when everythin has successfully been completed) and start over usin iPhoto Library Manager - http://www.fatcatsoftware.com/iplm/ -  to merge the libraries
    LN

  • How to automatically detect server ip address

    does any one know how to automatically detect an ip address of a server from the client with a socket based connection ?
    instead of prompting the client to connect to the server ip address which is trouble some.

    You must start with some initial information and a known environment.
    There are several possibilities after that.
    - The server has a 'name'. This is not an ip address but a name like "yahoo.com". When you connect using that, even if the IP changes, the correct IP will be returned. (At least ignoring an annoying bug in some VMs)
    - A specific IP address
    - Use a methodoly to 'request' a server address. One version of this is to use a UDP broadcast another version uses a service manager (which itself must be found.)

  • Detecting serial ports when program is already running

    hi, i've tried detecting the available ports of my computer usingEnumeration portList = CommPortIdentifier.getPortIdentifiers ();
    while (portList.hasMoreElements()) { ... }, i use it when my program starts to run and it works well. but i have a button which can give users option to change the port for which he wants to use.. and a port may not be available when the porgram started and may be available when the program is already running (i'm using a serial-to-USB cable so i can just plug and unplug it), i'm using the same code as above but it only detects the ports that i detected from the beginning, not including the new ports... does anyone know what i'm doing wrong? thanks!

    just found my solution in one of the threads, i inserted try{
    CommDriver cd= (CommDriver) Class.forName("com.sun.comm.Win32Driver").newInstance();
    cd.initialize();
    }catch(Exception e) {System.out.println("No available daw"); }before my Enumeration... my problem is solved!! Thanks for taking time to reply.

  • Application to detect correct port

    Hi,
    I am building an application which is to work for different computers. In the application I control a I/O device and a power supply through USB. I think that there might be problems with pre seting the name of the ports in the application since the port names might be different in other computers.
    Is it possible to make a VI which auto detects which ports it needs to communicate with? Or is there some other smart way to make sure that it is not a problem?
    Best Regards,
    MAthias

    Hi Mathias_P,
    if you speak about COM and LPT try this example.
    Mike
    Attachments:
    Unbenannt 1_LV80.vi ‏8 KB

  • Ethernet cable not detected by port

    Hello,
    The ethernet cable of my laptop is not being detected by port. Also the network adapter settings is not showing lan/ ethernet. This problem arose all of a sudden. I did recovery but no help. I reintalled Realtek LAn all in one window adapter but it did not istall. It gives an error that realtek controller was not found. What should i do now?

    Hi @microbio ,
    Thank you for visiting the HP Support Forums and Welcome. I have looked into your issue about your HP 15 b005DU Notebook and issues with the Ethernet connection. Here is a link to troubleshoot the Internet connections. The Ethernet cable should have a light flashing to show operation. Do you see the light on the cable?
    Here is a document on Airplane mode.
    If Airplane mode is on you cannot use your WiFi or Ethernet, so Airplane mode should off.
    You can do a system restore. System restore will help if something automatically updated and did not go well on the Notebook.
    When performing a System restore please note remove any and all USB devices. Disconnect all non-essential devices as they can cause issues.
    I hope this helps.
    Thanks.
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the bottom to say “Thanks” for helping!

  • How to find COM port for a specific USB device

    I want to automatically find the COM port for a specific USB device. I use the VISA find resource function but I can't get the manufacturer's ID. VISA says the device doesn't have this information. The find resource function does narrow my search (and often finds the port depending on what other usb devices are connected). In the case where it finds multiple possible ports, can I safely send a message to each port to determine if it is the correct device? I know it will work for my purposes but I don't know if I am asking for trouble by sending messages to unidentified devices. Any thoughts on how I can identify my device port will be appreciated. Thank you - Dave F

    You can do it using WMI.  I have C# code I am supposed to convert into LabVIEW foing something similar to what you want to do.  In my case, I am testing a USB device and need to know which port on the hub is which COM port (the device creates a virtual COM port for communication).  Using WMI, you can find the hardware path to the device and know that COM10 is USB hub Port 1 for example.  Unfortunately, I cannot share the C# code.
    You can download the WMI Code Creator tool from Microsoft, which should help you tremendously find the proper method of getting your info.
    You basically want to look at all the W32_USB devices for the specific device you are looking for.  Once you have that, you can look for the COM Port associated with it.  I don't know when I will get to coding this up in LabVIEW, but will report back when I do, assuming you haven't found the solution by then.

  • Automatically detect the caller class!

    Guys,
    I have a simple but "sounds-like-general-and-interesting" doubt..
    I have a class 'A' and another class 'B'. I have a method in 'A' called 'a' calling a method in class 'B' (which is 'b').
    suppose the control is inside the method 'b' of the class 'B'.
    Now, the doubt is
    how can I find out that it was class 'A' who called the method 'b' of class 'B' from within the method 'b'?
    the scenario is a simpe loging scenario where the class 'B' is a Logger class and I want to automatically detect the class calling this component from within this component so that it can be logged too.
    Hope my problem is clear. Thankx in advance for the replies.. am stuck and confused too.. and hop there's a solution for this
    regards
    Manesh

    mgumbs is right - typically a Logger class will accept a context (Object) to indicate where the message has come from. Sometimes people pass in "this", sometimes they pass in "this.class" or sometimes they'll log on behalf of another class. It's pretty much the same solution - if it's needed you should supply it.
    One method made possible in J2SDK-1.4 is using a stack trace to find out what the calling class/method is. Perhaps the only way to do that would be to throw a new Exception and get hold of its stack trace elements. I suspect that this would add significant overhead, though, and I certainly wouldn't recommend it!

  • Sites work using manual proxy but not with automatic detect

    I asked this in the ISA forum but they said since the WPAD file isn't generated by ISA to cross-post over here.
    We have an ISA 2006 build 5.0.5712 operating as our web proxy. We have WPAD configured both in DNS and in DHCP to point to this ISA server. There are two sites (rentsentinel.com and epmsonline.com) which when we use the 'Automatically detect settings' option
    in IE8, it either gives red X's in part of the homepage (rentsentinel), or doesn't show the page at all (epms). If we manually specify the proxy settings for this same server, it works fine. It would also appear that one can browse fine on random sites, but
    once we attempt to browse to one of these two sites,  that further browsing to other sites no longer works, even those we visited in the same browsing session.
    If I manually specify the http://wpad/wpad.dat file in the config field, no change in behavior. But if I use that same entry in Firefox, both websites render fine. Our wpad.dat is included below, with our internal domain
    name switched to domain.com.
    I'm looking for help on getting these sites working correctly with automatic detection. Thanks!
    //Copyright (c) 1997-2006 Microsoft Corporation
    BackupRoute="DIRECT";
    UseDirectForLocal=true;
    function MakeIPs(){
    this[0]="127.0.0.0";
    this[1]="255.0.0.0";
    this[2]="127.0.0.1";
    this[3]="255.255.255.255";
    this[4]="159.10.3.201";
    this[5]="255.255.255.255";
    this[6]="159.10.3.202";
    this[7]="255.255.255.254";
    this[8]="159.10.3.204";
    this[9]="255.255.255.252";
    this[10]="159.10.3.208";
    this[11]="255.255.255.254";
    this[12]="64.244.122.129";
    this[13]="255.255.255.255";
    this[14]="66.45.70.181";
    this[15]="255.255.255.255";
    this[16]="10.0.0.0";
    this[17]="255.0.0.0";
    this[18]="128.0.0.0";
    this[19]="192.0.0.0";
    this[20]="192.0.0.0";
    this[21]="224.0.0.0";
    this[22]="240.0.0.0";
    this[23]="248.0.0.0";
    this[24]="248.0.0.0";
    this[25]="252.0.0.0";
    this[26]="252.0.0.0";
    this[27]="254.0.0.0";
    this[28]="254.0.0.0";
    this[29]="255.0.0.0";
    this[30]="255.0.0.0";
    this[31]="255.128.0.0";
    this[32]="255.128.0.0";
    this[33]="255.192.0.0";
    this[34]="255.192.0.0";
    this[35]="255.224.0.0";
    this[36]="255.224.0.0";
    this[37]="255.240.0.0";
    this[38]="255.240.0.0";
    this[39]="255.248.0.0";
    this[40]="255.248.0.0";
    this[41]="255.252.0.0";
    this[42]="255.252.0.0";
    this[43]="255.254.0.0";
    this[44]="255.254.0.0";
    this[45]="255.255.0.0";
    this[46]="255.255.0.0";
    this[47]="255.255.128.0";
    this[48]="255.255.128.0";
    this[49]="255.255.192.0";
    this[50]="255.255.192.0";
    this[51]="255.255.224.0";
    this[52]="255.255.224.0";
    this[53]="255.255.240.0";
    this[54]="255.255.240.0";
    this[55]="255.255.248.0";
    this[56]="255.255.248.0";
    this[57]="255.255.252.0";
    this[58]="255.255.252.0";
    this[59]="255.255.254.0";
    this[60]="255.255.254.0";
    this[61]="255.255.255.0";
    this[62]="255.255.255.0";
    this[63]="255.255.255.128";
    this[64]="255.255.255.128";
    this[65]="255.255.255.192";
    this[66]="255.255.255.192";
    this[67]="255.255.255.224";
    this[68]="255.255.255.224";
    this[69]="255.255.255.240";
    this[70]="255.255.255.240";
    this[71]="255.255.255.248";
    this[72]="255.255.255.248";
    this[73]="255.255.255.252";
    this[74]="255.255.255.252";
    this[75]="255.255.255.254";
    this[76]="255.255.255.254";
    this[77]="255.255.255.255";
    DirectIPs=new MakeIPs();
    cDirectIPs=78;
    function MakeCARPExceptions(){
    CARPExceptions=new MakeCARPExceptions();
    cCARPExceptions=0;
    function MakeNames(){
    this[0]="gracehill.com";
    this[1]="*.cna.com";
    this[2]="*.itsolutions.com";
    this[3]="*.rentsentinel.com";
    this[4]="domain.com";
    DirectNames=new MakeNames();
    cDirectNames=5;
    HttpPort="8080";
    cNodes=1;
    function MakeProxies(){
    this[0]=new Node("hades-1.domain.com",0,1.000000);
    Proxies = new MakeProxies();
    function Node(name, hash, load){
    this.name = name;
    this.hash = hash;
    this.load = load;
    this.score = 0;
    return this;
    function FindProxyForURL(url, host){
    var hash=0, urllower, i, fIp=false, ip, nocarp=false, skiphost=false;
    var list="", pl, j, score, ibest, bestscore;
    urllower = url.toLowerCase();
    if((urllower.substring(0,5)=="rtsp:") ||
    (urllower.substring(0,6)=="rtspt:") ||
    (urllower.substring(0,6)=="rtspu:") ||
    (urllower.substring(0,4)=="mms:") ||
    (urllower.substring(0,5)=="mmst:") ||
    (urllower.substring(0,5)=="mmsu:"))
    return "DIRECT";
    if(UseDirectForLocal){
    if(isPlainHostName(host))
    fIp = true;}
    for(i=0; i<cDirectNames; i++){
    if(shExpMatch(host, DirectNames[i])){
    fIp = true;
    break;}
    if(shExpMatch(url, DirectNames[i]))
    return "DIRECT";
    if(cDirectIPs == 0){
    if(fIp)
    return "DIRECT";}
    else{
    ip = host;
    if(fIp)
    ip = dnsResolve(host);
    var isIpAddr = /^(\d+.){3}\d+$/;
    if(isIpAddr.test(ip)){
    for(i=0; i<cDirectIPs; i += 2){
    if(isInNet(ip, DirectIPs[i], DirectIPs[i+1]))
    return "DIRECT";}}
    else if(isPlainHostName(host))
    return "DIRECT";
    if(cCARPExceptions > 0){
    for(i = 0; i < cCARPExceptions; i++){
    if(shExpMatch(host, CARPExceptions[i])){
    nocarp = true;}
    if(shExpMatch(url, CARPExceptions[i])){
    nocarp = true;
    skiphost = true;
    break;
    if(!skiphost)
    hash = HashString(host,hash);
    if(nocarp)
    hash = HashString(myIpAddress(), hash);
    pl = new Array();
    for(i = 0; i<cNodes; i++){
    Proxies[i].score = Proxies[i].load * Scramble(hash ^ Proxies[i].hash);
    pl[i] = i;
    for(j = 0; j < cNodes; j++){
    bestscore = -1;
    for(i = 0; i < cNodes-j; i++){
    score = Proxies[pl[i]].score;
    if(score > bestscore){
    bestscore = score;
    ibest = i;
    list = list + "PROXY " + Proxies[pl[ibest]].name + ":" + HttpPort + "; ";
    pl[ibest] = pl[cNodes-j-1];
    list = list + BackupRoute;
    return list;
    var h_tbl = new Array(0,0x10D01913,0x21A03226,0x31702B35,0x4340644C,0x53907D5F,0x62E0566A,0x72304F79,0x8680C898,0x9650D18B,0xA720FABE,0xB7F0E3AD,0xC5C0ACD4,0xD510B5C7,0xE4609EF2,0xF4B087E1);
    function HashString(str, h){
    for(var i=0; i<str.length; i++){
    var c = str.charAt(i);
    if(c ==':' || c == '/') break;
    c = CharToAscii(c.toLowerCase());
    h = (h >>> 4) ^ h_tbl[(h ^ c) & 15];
    h = (h >>> 4) ^ h_tbl[(h ^ (c>>>4)) & 15];
    h = MakeInt(h);
    return h;
    function Scramble(h){
    h += ((h & 0xffff) * 0x1965) + ((((h >> 16) & 0xffff) * 0x1965) << 16) + (((h & 0xffff) * 0x6253) << 16);
    h = MakeInt(h);
    h += (((h & 0x7ff) << 21) | ((h >> 11) & 0x1fffff));
    return MakeInt(h);
    var Chars =" !\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€???????????Ž????????????ž? ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþ ";
    function CharToAscii(c){
    return Chars.indexOf(c) + 32;
    function MakeInt(x){
    x %= 4294967296;
    if(x < 0)
    x += 4294967296;
    return x;

    Hi,
    Sorry for the late response.
    Since the issue is complex and difficulty to troublshooting, we discussed for some time corssing the specialty. Here is some direction we may let you know to do further troubleshooting:
    capture network trace to confirm whats happening across the wire.
    confirm the wpad.dat is the expected.
    If you have any difficulty when doing this, we suggest you to contact with IT Pro Support via the link below:
    http://technet.microsoft.com/en-us/ms772425?WT.mc_id=SMCfoot_ENUS_TEXT
    I think it can help you define the root cause via some deeper tools due to the complicated symptom you have.
    I appreciate your understanding and time.
    Best Regards,
    Annie Gu

  • Netsh and Automatically Detect settings

    Hi All,
    I have 'Automatically detect settings' checked in IE and the browser is picking the wpad file as expected. Having said that, I have been unsuccessful trying to set this proxy setting on a system wide level using netsh.
    I have executed the following command in netsh: "winhttp import proxy source=ie"
    I would have expected netsh to pick up the proxy from the auto detect settings but unfortunately no proxy is set as a result of executing that netsh command. Strange enough, if I were to set the proxy settings manually in IE, the netsh import command would
    pick this change and set the proxy successfully.
    Please note that I have attempted this on Windows XP and Windows 7 (using both 32 and 64 versions of netsh) and the 'winhttp import source=ie' only works on XP when automatically detect settings is set in IE.
    Any reason why netsh isn't picking up my auto detect settings on Win7?
    Thanks
    mskh

    Hi,
    Please make sure to follow guide in the following link to manually configure proxy settings with netsh
    Netsh Commands for Windows Hypertext Transfer Protocol (WINHTTP)
    http://technet.microsoft.com/en-us/library/cc731131(v=ws.10).aspx#BKMK_5
    Example in the link below can also be helpful
    http://support2.microsoft.com/kb/900935
    Or configure the proxy settings via registry if you want to global control this setting
    http://support2.microsoft.com/kb/819961
    Yolanda Zhu
    TechNet Community Support

  • Detect / Resolve Conflicts: Automatically detect and resolve conflicts

    Hi
    From documentation:http://technet.oracle.com/products/oracle9i/daily/jun05.html
    " Detect / Resolve Conflicts: Automatically detect and resolve conflicts "
    I know that the detection of the conflicts between versions is automatic, but I didn't know that the resolution was also automatic.
    So Can you tell me, please, in which cases the resolution of conflicts is automatic?
    thank you in advance
    (sorry for the previous message)

    Just to follow up on Arun's reply: The Workspace Manager manual has the correct information (i.e., conflicts are detected automatically, but must be resolved manually). The error is just in the OTN document that you refer to.

  • Uncheck automatically detect settings of IE

    Hi
    I need to uncheck only "automatically detect settings" on XP workstation.
    I searched lots of Google but could not right solution.

    Hi,
    Thanks for your posting.
    You can create a GPO, link it to a scope (Site, Domain, or OU level) which contain user account object.
    Configure the GPO:
    User Configuration \ Policies \ Windows Settings \ Internet Explorer Maintenance \ Connection \ Automatic Browser Configuration \uncheck “Automatically detect configuration settings”
    For more and detail information, please check the simialr thread:
    uncheck "use automatic configuration script" in IE LAN settings
    http://social.technet.microsoft.com/Forums/en-US/05a7c683-075e-435c-8583-da8fd3559cf2/uncheck-use-automatic-configuration-script-in-ie-lan-settings
    Regards.
    Vivian Wang
    TechNet Community Support

  • Uncheck'Automatically detect settings' in Internet Explorer

    Hi All
    How to Uncheck 'Automatically detect settings' option in internet explorer using VBScript???

    You can set this in the registry, using batch or vbscript:
    HKCU/Software/Microsoft/Windows/CurrentVersion/Internet Settings/Connections/DefaultConnectionSettings
    The 9th Byte should be changed to 09, this sets the checkbox to automatically detect settings.
    I have used this to switch back between my auto-configuration script and automatically detect settings. If fast switching is what you are after I would use this approach, if you want to manage multiple computer, just push it via group policy.
    Source: https://groups.google.com/forum/?fromgroups=#!topic/microsoft.public.inetsdk.programming.scripting.vbscript/EGdKXiEcwG4
    Jaap Brasser
    http://www.jaapbrasser.com

Maybe you are looking for