Close COM-Port

Hi
When I use COM-Ports in my VI, they're open still I close LabVIEW. Is someone
there who has a solution for this problem?
I'm searching for a VI, that closes my I/O-COM-Port.
Thanks
Chris

"Chris Herzig" wrote:
>>Hi>>When I use COM-Ports in my VI, they're open still I close LabVIEW.
Is someone>there who has a solution for this problem?>I'm searching for a
VI, that closes my I/O-COM-Port.>>Thanks >>Chris
hallo chris.
hi chris.
i know this problem and it's quite easy to solve:
..\labview\vi.lib\instr\_sersup.llb\"close serial driver.vi" is exactly the
vi you need. you van find some other useful vis at this location.

Similar Messages

  • ASCII closes COM port randomly during long periods of unsolicited response monitoring

    I have lots of serial ASCII objects monitoring for unsolicited responses (every two seconds, from 20 different COM ports).  Randomly, sometimes a few times a day, sometimes no problem for 2-3 days....but the ASCII object somehow lets the COM ports close or it loses contact with the COM port occasionally.  All I have to do is go into edit mode and "touch" the properties....such as changing the "Retry Attempts" setting and the communication returns.
    There are no alarms logged when this happens!
    Ed

    Ryan,
    I currently use 6 Ascii objects from 6 ports and plan to use 2 more.  Unsolicited data arrives every two minutes (as measured by the sending end).  I have a button on the panel for each object that I can press to send a request to the sending end.  Each of the senders connects to a digi portserver II and is delivered to lookout via an ethernet connection (as a virtual com port).  The ethernet connection is routed over various paths including micowave, which could have an occasional traffic interupting fade. One or more of the Ascii objects may fail to respond at any time, but several days may pass without a problem.  When a failure is noticed, you can usually select the properties for that object and the problem clears.  If instead, you send a request to any of the other Ascii objects , Lookout may just hang (permanet hour glass).   When a failure is noticed, if Lookout is then turned off and the offending port is monitored with hyperterminal, the data from the sending port is on time and correctly formatted.  The help file has a section "Ascii alarm and error messages" with a section named "Early temination when parsing the response frame".  There are a bunch of reasons listed there as to why the Ascii object might not function properly.  I've tried everything that I can think of to make this work reliably.  Any ideas?  See the link for response format information. http://jrcamenzind.googlepages.com/lookout

  • How to close the COM Port ??????????

    Dear all :
    I have written an application that send AT commands to a modem , Once I opened a com port , i don't know how to close it . I got the null pointer exception when i create a new channel , because the inputStream and outputStream is owned by the previous channel . So , some one can teach me how to close the com port that opened before ?
    my source code for open port :
    public void Connect_Com(CommPortIdentifier portId) {
    Integer i = new Integer((int) (Math.random()* 1000));
    String channel = "channel" + i.toString();
    System.out.println(channel);
    try {
    System.out.println("preparing to open port");
    serialPort = (SerialPort) portId.open(channel, 2000);
    } catch (PortInUseException e) {}
    try {
    inputStream = serialPort.getInputStream();
    System.out.println("getting inputStream");
              } catch (IOException e) {}
    try {
    serialPort.addEventListener(this);
              } catch (TooManyListenersException e) {}
    serialPort.notifyOnDataAvailable(true);
    try {
    serialPort.setSerialPortParams(9600,
    SerialPort.DATABITS_8,
    SerialPort.STOPBITS_1,
    SerialPort.PARITY_NONE);
    } catch (UnsupportedCommOperationException e) {}

    serialPort.close() ?
    From the documentation of SerialPort:
    - SerialPort extends CommPort.
    - CommPort.close() closes the communications port.

  • HyperTerminal sees a COM port but VISA does not

    It should not be possible that HyperTerminal sees a COM port but VISA does not. Does anyone know why or have any ideas?
    Here's some more info: I wrote a LabView (LV) program and deployed it (via the Application Builder) to some of our production department's PCs (some Windows XP and some Windows 7). We use it to set up products we design and manufacture through our device's USB serial port. The USB port is actually a virtual COM port (VCP) - a USB to Serial converter or "bridge". We have a custom driver for our device and since each device's USB bridge chip is programmed with a different serial number, every time we connect a new device to the PC the installer runs and assigns a new COM port number. This is so our customers can use multiple devices on a PC. Fine. On one of our production PC's we were close to  COM900 ports (HyperTerminal sees only up to COM256) when suddenly Win7 would not allow any more. We were able to uninstall orphaned (non-present) COM ports from DeviceManager ("DM") by starting it from a command console (DOS window) with a special command-line switch, "set devmgr_show_nonpresent_devices=1" then "start devmgmt.msc" (I have this in a batch file). In DM View menu you can "Show hidden devices" and uninstall them as if they were connected. I've also tried uninstalling them the normal way when the device was actually connected. Either way, sometimes, not always, depending on the COM port number, after reusing that port number by installing a new device which picks up that old, freed-up number, LV VISA doesn't see it. In other words, when "Refresh" is clicked in the COM port VISA list box, any new devices installed should be and normally are seen. (Refresh is not needed if the application is started after the device's driver is installed. It is only need if the LV application is open with the new device is added.) However, HyperTerminal does see it and lists it in the Properties screen, the "Connect using..." list box. And the port works with HyperTerminal. (Of course we've tried rebooting after uninstalling and/or reinstalling the device, with the same results.)
    When I've spoken to the NI Applications Engineers in the past about serial port issues (not about this problem) they have confirmed that if HyperTerminal can see the port then NI VISA should also see it. This is crazy. I am posting this in hope that someone can shed some light on this problem.
    Thank you. -Ed

    Good catch. Yes, we're using the Silicon Labs CP2102 and have created a "custom driver" installation package. Our new PCBs have a factory-programmed chip, so the PC reuses that COM port (COM3 on that PC). The problem is when we we re-program the CP2102 (setIDs exe) with our PID, and device strings (including the S/N), the PC runs our installer and assigns the next COM port number. I was hoping that maybe it would go up to 64K or something! Anyway, it surpassed COM256 but we ran into this problem when almost up to COM900.)
    There is a registry entry for each SN device, which shows the assigned port. If we delete the key with regedit, the COM port database (don't know the file name) still has the port number. That's where Device Manager comes in. It seems to allow us to manually delete the ports, but it would take quite a while to delete 900. (I was trying to make a batch file for DevCon, but couldn't get it to see the HW ID of the devices in need of deletion.) So we tried manually deleting a few. After doing that Device Manager shows that Windows (and HyperTerminal) can reuse the port number when a new device (new SN) is installed, but, as you know from this post, VISA cannot see unless I manually add it in MAX.
    I can't see how it has anything to do with the Silicon Labs driver. I might have to delete ALL of MY devices, then uninstall the driver files, reboot, then reinstall, as you suggested with the SiLabs driver. However, I don't see how VISA will now see these changes. VISA must have it's own database. That's what I thought deleting the ports in MAX would clear out, like a fresh install, but apparently not.
    I've been through Silicon Labs' tech support on other issues and they've been able to help on some. I could run this by them.
    BTW, have you noticed that Silicon Labs' chip and driver, while faster than NI's own "bridge" or serial-USB converter (I returned it because at $100 it's performance was worse than a $20 converter you can buy in Staples), is substantially slower than a real serial port? For example, our device can transmit 250 readings per second (a 12 byte string). A real serial port used with my LabView program can keep up, i.e.., graph & tabulate at that rate, but with a VCP we only get about 70 RPS. Same code. Can't figure this one out. They say the've tested the driver to 900 KB claimed. We're using 115KB here. Anyway, the VCP driver makes it look like a COM port which LV thinks it is. Why is it slower than a real port when the USB should be able to work almost 10 times faster than I'm using it (up to 1024 bytes per mSec per the full-speed USB spec, which SiLabs claims they verified)?
    Anyway, I appreciate your help. Thanks! -Ed

  • The LV crashed when I call a dll to control my com port

    I am controlling the com port with calling a dll(dwdio.dll--see the attachment). The VI I used is also attached below.
    I just used four functions of this dwdio.dll, as followings:
    1. bool DWD_set_comport(unsigned char com_port,int *handle)
    Parameter config:return type--unsigned 8-bit int(value),com_port --unsigned 8-bit int(value),handle--signed 32-bit int(point to value)
    bool DWD_set_baud_rate(int baud,int *handle)
    Parameter config:return type--unsigned 8-bit int(value),baud--signed 32-bit int(value),handle--signed 32-bit int(value)
    bool DWD_check_comm_link(int *handle)
    Parameter config:return type--unsigned 8-bit int(value),handle--signed 32-bit int(value)
    bool DWD_close_com_port(int *handle)
    Parameter config:return type--unsigned 8-bit int(value),handle--signed 32-bit int(value)
    I can run my vi successfully,but Labview will crashed when I close Labview application. I tried many ways to change the parameters and convention, but there is no effect.
    Because this dll file need hardware dongle,so I can't upload the vi. I just attached the screen-shot of it.
    Can anybody have some analysis on my vi to give me some valuable suggestion?
    Attachments:
    dwdio & explanation &my vi.zip ‏2456 KB

    Yaoming wrote:
    > SVences,<br><br>I know that Erroneous data types assignments can cause crashes.
    > I have checked all the data type with my experience and knowledge,but I didn't
    > find anything should cause this crash problem.<br><br>After all,I am not very
    > experienced in Call Library Function, so maybe my vi still have some erroneous
    > data type assignments. Can any DLL expert help me to locate them?
    > For the original function description, I have posted as attachment in the first
    > post. Therefore,anybody who want to check my data type error can have a check
    > with that function description.
    > That issue is very urgent and important to me. Can anybody to help me sort
    > this problem as soon as possible? Thanks in advance.
    A few remarks:
    1) the Bool return value is probably an int. It doesn't look like a
    standard Widnows datatype so you will have to look in the documentation.
    However this is unlikely to crash your code.
    2) The handle parameter for DWD_set_comport should be set as Pass:
    Pointer to Value. All other parameters should be passed by Value only as
    they are not pointers at all. Also please wire a 0 constant to the right
    side of the CLN for that parameter to provide memory for the DLL to
    write in.
    3) The calling convention for the DLL functions is not obvious from your
    documentation. You have the choice between C (cdecl) and WINAPI
    (stdcall) on Windows. Since this DLL seems to be available for multiple
    platforms (The remark for each function) it may be that the developer
    decided to use cdecl calling convention (a smart choice I would say) but
    Windows DLLs usually use stdcall instead.
    Having the wrong one will absolutely crash LabVIEW but usually at the
    moment you return from the functioncall and not later on.
    So I would guess the most probable cause is number 2, but don't discount
    the other ones completely.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • RV042 - How to close all ports and leave some specific open

    Hello everybody,
    Here is the scenario of my network:
    - A company with 20 branches in Rio de Janeiro area. The main servers are in a datacenter located in downtown.
    Each branch has a RV042 router with firmware version 1.3.12.19-tm (Feb 13 2009 13:03:21) installed.
    All users in this network have a proxy configuration pointing to proxy.[blah].com.br port 3128.
    The HTTP/HTTPS traffic should go through proxy only.
    The network settings for every RV042 are similar:
    RV042 LAN IP = 172.16.***.1 /24.
    RV042 WAN IP = 192.***.***.*** /30.
    Network Setting Status
    LAN IP: 172.16.***.1 /24
    WAN1 IP: 192.168.***.*** /30               
    WAN2 IP: Not used
    Mode: Router
    DNS(WAN1): 208.67.220.220 / 208.67.222.222 [OpenDNS Service]
    DNS(WAN2): Not used
    Firewall Setting Status
    SPI (Stateful Packet Inspection): On
    DoS (Denial of Service): On
    Block WAN Request: On
    Firewall -> Access Rules Section: Please see below
    The problem:
    - Some "smart" users were caught using Ultrasurf application, which changes the proxy settings to go through port 9666 or even 443.
    In other machines, we've found some black proxies [for example: 212.46.27.142 port 8080].
    My objective:
    - To close all ports in Firewall -> Access Rules section and grant permission only to some selected and specified ports.
    - To redirect all HTTP/HTTPS connections to go to proxy's IP address only.
    Gentlemen, could you please tell me which Access Rules can I set in these RV042s in order to block and prevent these users to continue abusing this network? Is there anything else am I missing?
    P.S.: The users who were caught using Ultrasurf were fired. ;-)
    I gladly appreciate your comments.
    Thanks in advance,
    Luciano

    Hello Randy,
    Thanks for your answer. But let me tell you better. In this scenario, all machines in LAN can use RDP and VNC normally.
    I want to block everything else, just to avoid users to try using other ports.
    You might want to try Deny all traffic out, except for the PC's you need  to use RDP, and then only allow 80, and 443 to the proxy.[blah].com.br  port 3128. This way all web traffic would have to pass through that  proxy, otherwise it would be denied.
    In this network, we use VNC to provide remote IT support to users in these branches.
    They use RDP to access some servers in the datacenter.
    I think that the rule below line 6 is letting users go and traverse the proxy.
    Priority    Policy Name    Enable    Action    Service        Source Iface    Source    Destination        Time    Day
    *                                                  Allow    All Traffic [1]             LAN     Any        Any                  Always    
    How can I modify this access rule? It seems it cannot be altered.
    Thanks in advance,
    Luciano

  • Close open ports

    Troubleshooting my client network invasion and researched some information via my macbook.  The network is Windows7. 
    Issue at hand is all of the established connections from my computer to the outside world via ports 50000 through 65000.  Wondering how to close said ports.

    Much Ado about nothing.
    What is outgoing on those ports?
    Doesn't really matter. It is incoming that you have to worry about and if they were Invaded then their router is not setup correctly. Has nothing to do with the computers behind the router. Not unless there are BOTs installed on those computer. And in that case closing ports won't help.
    EDIT:
    Go to ShieldsUP.com and do a scan.

  • Write among COM ports in the same PC without cables

    How can I write to the memory address(es) of a serial COM port?  I would like to send data from one serial COM port to another in a manner similar to the that of the 'Simple Data Client' and 'Simple Data Server' vi examples.  This must sound strange since this is exactly what a null modem cable will do, externally.  I would like to eliminate the cable connection between COM ports that exsit in the same PC and communicate between them, internal to the PC, somehow. 
    Currently, I am using a LabVIEW vi to read a serial message on COM1, translate it, send the trsanslation out on COM2, so that a separate windows program (no .DLLs to interface with LabVIEW) can read the message on COM 3.  COM 2 and COM 3 are connected by a null-modem cable.  This requires three COM ports, and two serial cables.  I realize that I can use a physical loop-back jumper on COM2, for instance, where I send and read the translated message on COM2, but I still wonder if there is a method for doing this in memory, or something. Is there a way to accomplish the same objective with one cable (into COM1), no loop-back jumpers, and only two serial ports?  In summary, I want to read on COM 1, translate in LabVIEW, then write directly to another COM port, internally, without using a serial cable.  Can the 'IN PORT' or 'OUT PORT' vi's apply here?  Are these tools only for parallel ports?
    Hope this is not too confusing....  It seems like I am always trying to do something with LabVIEW that was not meant to be done....
    Thanks.

    Thank you.  If I pay the price they ask, this looks like it will create and share virtual COM ports - exactly what I need.  However, I would really like to find a way to do this in LabVIEW, such that I do not have to make my application dependent on another piece of third party software.  The 'Simple Data Client.vi' and 'Simple Data Server.vi', included in the shipset examples, seem to do this for TCP/ IP ports.  I wonder why the COM ports cannot be addressed at the memory level, in a similar manner???

  • Can two users share a COM port?

    I have a system services Labview executable that opens a VISA session on a COM port.
    But I also have a User Interface VI that needs to communicate with the device on same COM port.
    Is this possible?  Can I use a Shared Variable to keep the VISA Resource name and have multiple users (one at a time) communicate with the device?

    LabVIEW semaphores and all other LabVIEW objects like queues, notifiers, events, etc are not only process local objects only but even application context local only. While this makes no difference for built applications it is important inside the development environment as each LabVIEW project lives in its own application context (and tools started from the Tools menu run in yet another context). To do what you want to do, you need to implement some form of interapplication communication as Mark already mentioned. Or you can access named OS semaphores by calling OS APIs.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How can I write to multiple daisy-chained network serial addresses through a single COM port?

    I have a VI to write to 3 PI Mercury motor controllers using daisy chained RS232 connected via a Prolific USB-to-Serial adapter. I know that it is possible to talk to the individual controllers because the PI terminal that I have recognises the addresses of multiple controllers and designates them Device 1,2,3. The VISA resource name when configuring the port just comes up as COM5 most of time, with seemingly no way to specify an address on that COM port. Occasionally the VISA resource is ASRL5::INSTR and as this is disconnected and re-connected, this address moves up a number (e.g ASRL7::INSTR). Can anybody tell me how I can configure my serial communication to allow me to individually communicate with the different devices through a single COM port?

    What does the manual say about addressing? RS-232 is not multidrop, the resource name is correct, and there is no additional configuration needed. There would have be a specific write in order to address a certain controller.

  • How to use shared variables to address multiple Watlow controller​s on the same COM port

    Hello,
    I am trying to use LabVIEW 2010 to control 4 Watlow temperature controllers on one COM port. 3 are Model 96 and 1 is an EZ zone controller. Each controller has a unique modbus address, and I am trying to read from and write to individual registers (such as closed loop setpoint) using shared variables. I am getting return data when reading (although the data appears to be invalid), but am unable to change the value in the register by writing. How can I be sure that the Modbus server is sending commands to the correct controller?
    Chuck
    Solved!
    Go to Solution.

    Peter,
    Thanks for the reply. I have actually solved that problem. I realized that the Modbus server address has to be the same as the controller's Modbus address.
    I have, however, run into another problem. Perhaps you could help me with that. I have a system with 4 Watlow controllers, 3 are series 96 controllers, one is PID only and 2 are ramping. The 4th controller is an EZ zone. I am using RS485 for communications and the controllers are all wired in parallel for communications and power.
    I have set up 2 Modbus servers for 2 of the controllers.
    This is the first I have ever worked with Modbus based communications. I have successfully programmed using the Modbus read/write VIs, and am wanting to move to shared variables. My questions right now revolve around addressing, Modbus I/O servers and COM ports. Specifically, at this point, I know the addresses need to match up between the server and the slave device (Watlow controller in my case), how many servers can I create and use on one COM port? If the number is limited, is there a way I can specify an address that I want the server to talk to? Will the broadcast mode work to request data values from the controllers?
    I'd appreciate any information you can help me with, or if you could point me to some sort of concise 'How-To' for Modbus communication.
    Thanks.
    Chuck

  • GPS Error on F3507g & Windows 7 "The GPS NMEA COM Port is not available" x200

    I have an X200 with a WWAN Card 43R153 (Ericsson F3507g) running Window 7.
    The WWAN reliably connects to Vodafone but I can't get the GPS to work.
    Device manager shows this port Enabled:-
    Ericsson E3507G Mobile Broadband MiniCard GPS Port (Com8)
    Driver Invogps.sys from Ericsson AB, Version 1.0.0.28  29/09/2008.
    Thinkvantage GPS version 2.50 is also installed and Lenovo System Update says everything is up to date.
    When I "Turn on GPS" or run 'Lenovs GPS"  I get this message:-
    The GPS NMEA COM port is not available. You need to check the following things.
    - Another GPS application is using the COM port.
    - COM ports is disabled. You can enable the COM port in the Device Manager.
    Location and Other Sensors shows nothing installed.
    I've tried deleting all the drivers and reinstalling but not luck.
    Has anyone else had the same problem and found a solution. I can't think of anything else to try.
    ThinkPad X200 7459-1P0

    If you are running a Windows 7 Weather Gadget on your desktop, try shutting it down entirely and see if that changes your GPS "in use" problem.
    Cheers,
    Bill
    I don't work for Lenovo

  • Problem removing bluetooth stack / hidden devices / COM ports not released

    Hi
    Having problem completely removing Toshiba Bluetooth stack / hidden devices / com ports not released
    I uninstalled Toshiba BT s/w...
    But:
    1) Toshiba BT hidden devices still appear and I can not remove (get error)
    2) COM ports occupied by Toshiba BT not released (so they cannot be used by another BT stack) and still appear in registry
    ex: friendly name Toshiba BT Port (COM4) still in registry
    3) These unreleased com ports do NOT appear in device manager
    Thanks

    It seems that you still have some configurations which were not removed during the uninstallation.
    This means that the resources can not be release, because those are still necessary in case of a
    new installation of the stack.
    The first I would try is the following:
    - Install the latest Toshiba Bluetooth stack.
    - Uninstall it. Ensure that you answer all questions with "yes" ! This means also the one which asks if all configurations should be removed.
    - Reboot
    - Check again

  • Exception while accessing com port from servlet

    I am trying to access communication port from a Servlet using java communications api's.
    But Following exception was thrown
    Caught java.lang.NullPointerException:name can't be null while loading driver com.sun.comm.Win32Driver
    The SecurityManager do not allow that opeartion.
    java.security AccessControlException:access denied (java.io.FilePermission c:\j2sdk1.4.1\jre\lib\javax.comm.properties delete)
    at java.security.AccessControlContext.java:270) at java.security.AccessController.checkPermission(SecurityManager.java)
    at java.lang.SecurityManager.checkDelete()
    at java.comm.CommPortIdentifier.getPortIdentifiers(CommportIdentifier.java)
    Please help me.Tell me what to do.how to successfully access a communication port from a Servlet.

    Hi there. I am also facing the problem accessing com port via servlet. if u have the solution, kindly forward to me at [email protected]
    many thanks

  • Problem with Com port

    Hi guys. I have written a driver to communicate with a COM port (FTDI serial adapter).  On the pc from which I'm writing now (windows XP) it works properly, but when I try to use the same driver on another pc (win 7) labview see the port but isn't able to comunicate . I tried also to use a software like Tera Term to see if the com works and trying the echo it works good...so I don't understand where the problem is on this w7 pc... 
    should I install some labview drivers on the w7 pc? I have already installed
    NI run time installer
    NI max
    NI Visa run time

    NI Serial won't help (its for NI serial cards not 3rd party USB-Serial bridges)
    LabVIEW sees the VCP in Win7 but does not communicate: Works on XP: "Something" happens with Echo on from teraterm.
    I'l guess either:
    Wrong serial cable or settings and you are fooling yourself with the tereterm app and are seeing the echo only.  With Echo on any character sent should be doubled.
    Outdated FTDI Driver that does not support Win7.
    Jeff

Maybe you are looking for

  • T-code WV31 create physical inventory for vendor consignment stock

    Hi all, I have some issue with T-code WV31i n Sap Retail. Even though it supposed to create physical inventory doc for unrestricted use stock, it also create physical inventory Docs for special stocks (vendor consignment stock). What could be the rea

  • How do I transfer music play list from one apple id account to another

    How do I transfer music playlist from one apple user Id to another

  • Filter measure column for current year

    Hi, I'm stuck up with issue, we have a report from three tables D1, D2 and F1. In which D1 is time dimension. Now we have report from D2 and F1 with measures, and the report is placed in Dashboard which is having year prompt. F1 is joined with D2 and

  • Camcorder Help Please

    Over the past few months I have graduated from Windows Movie Maker, to FCE to FCP Studio 2. As an edge of desk job I make DVDs for my employer. These have gone down so well that he paid for me to upgrade to FCP. Adding a bit of basic Motion etc to th

  • Data load error in 0EC_PCA_1

    Dear all, In the data source 0EC_PCA_1 during delta load, on one day the load has failed in the PSA due to TRFC connection problem. Subsequently loading on all other days had taken place.The load had failed on 17.04.2008 - subsequent load had been up