Choice of the COM ports without disturbing the user

I am writing a LabVIEW application that uses at least 2 COM ports.  It will compile to run on different computers.  Now, I expect that to any one machine COM ports will remain fixed, but there is no way I can wait devices series that I use to make it appear in the same COM port on all the different machines (especially since some will have legacy RS232 ports, any other USB RS232 converters).

It is a problem that I solved before when programming in 'C', by putting a text file on each PC, which, in the spirit of a name of INI file which COM port is used for each of the devices, I need.

It occurs to me that I can do exactly the same thing in LabVIEW, open a text file and parse to see which COM ports are named, then use the number that results as the selector of a structure of MATTER, in which each case has a constant (VISA resource) COM1, COM2, and so on.

It of crazy, or is there an easier way?

To try it out, a problem occurs, and it is that I can not create constants for ports that do not exist on the computer I developed it on (I use 2009).  Well, I can go in the WIndows Device Manager and do a reallocation to finally get a full set of COM ports for my CASE structure, but I can trust to LabVIEW to not change because ports disappear?

Thank you

p.s. I think that this is my first post, came here often before but always found the answer without affectation.  My apologies if this point is already covered, but it seems a little too "woolly" to lend itself to the research without getting tens of thousands of results.

You don't need a deal structure for each port.

You can use the variant data to convert a string into a VISA reference name.

Attached is an excerpt from one of my programs, I retrieve Comport settings from a configuration .ini file.

There are a few things of special on this subject.

1. I used a typedef had enum that designates each of my interest com ports.

2. I have stored reference to the port com VISA in a global variable functional so I can use them elsewhere.  Typedef enum is important as part of the selection to get the correct reference to the FGV.

3. I used a public OpenG function get strings to enum so that my string name that I use for the value of the key and enum are cross referenced.

Tags: NI Software

Similar Questions

  • How to distinguish between Save and throw the choice by the user?

    How in a Java application I distinguish the user on 'Save' or 'RID' choice (on screen closely)? Both super.onSavePrompt () super.onSave () return true for both choices. Any help is appreciated.

    'Save' calls onSave. 'Cancel' doesn't do nothing, just the guest closes. "Unravel" closes the screen without call onSave.

    Implement your own dialog box and take action based on the user's response.

  • Display image based on the value of the variable of the choice by the user

    Hi all, I hope someone can help with what I think is a simple request. Ive only been using Captivate 7 for a few days and still feeling my way around things.

    I installed a question multiple choice quiz that has 4 possible answers (correct 1: incorrect 3.)

    It works fine out of the box, and when a user presses the button send the response box appears showing if the user responded to this correctly or not.

    What I want to do, that is forward a bit, and if the user gets the answer wrong I would a small image of a check mark appears next to the correct answer.

    I have included my image on the stage, he gave an alpha of 0 to hide effectively.

    In interactions in advance, I created a variable called showImage with an initial value of 0

    What I am struggling with now is how to increase the value of the variable to 1 when a user selects a wrong answer and change the alpha of 0 to 100 for show the image illustrating the choice of the correct answer.

    I know that what I have described, is essentially what is happening at the end of the quiz, if a user has access to review their answers but I would like to be able to do as they progress through the questions.

    Thanks a lot for your help

    D

    Hi D,

    What you need to do is rather than make his alpha 0. It completely hide the scene until the user gives the correct answer.

    So, I want you.

    (1) insert a picture

    2) go to image and all properties panel up - untick 'Visible output.

    (3) open properties Quiz, select under Actions failure level 1/2/3

    (4) select 'Last attempt' as 'Show' and the image you you inserted

    This way the image will appear if the user selects an incorrect answer.

    I hope this helps.

    See you soon,.

    Anjaneai

  • Toggle the fields based on the choice of the user

    Hello!

    I need to create a form in which it fields should be enabled based on the user's choice in a previous question (with radio buttons).

    Please, where can I find the info to learn how do?

    Thak you responsible for any idea!

    Here's the Script Editor of screen capture...

    Once the script editor opens, then edit the event click in the menu on the left corner.

    Thank you

    Srini

  • Save the choice by the user in the menu drop-down

    Hey guys

    How is everyone today? I hope you are all okay

    I am facing a problem, I made a menu drop-down with 2 options, each option changes something in the way of the application of notification showing, once the application is closed, it returns by default (no selected value... which makes sense, because I do not know how to record yet)... so is there anyway to save the user's selection in the menu?

    Here is the code

         DropDown {
                id: drop
                enabled: false
                Option {
                    text: "Every 15 minutes"
                    value: 1
                }
    
                Option {
                    text: "Every 30 minutes"
                    value: 2
                }
                onSelectedValueChanged: {
                    if(selectedValue == 1){
                        //because it's milliseconds
                        timer.interval = 900000
                        timer.start();
                    }
                    if(selectedValue == 2){
                        //because it's milliseconds
                        timer.interval = 1800000
                        timer.start();
                    }
                }
            }
    

    Thanks a lot guys

    Hi Alem... from your code snippet:

    if (theOptions[count].value == settings.getUserSelectDrop)
    {
        drop.selectedIndex = count;
    }
    

    The problem I see here is that getUserSelectDrop is a function, not a variable, and so he needs parenthesis after it else Qt will stop execution of JavaScript as soon as he's trying to run it.

    Try this:

    if ( theOptions[count].value == settings.getUserSelectDrop() )
    {
        drop.selectedIndex = count;
    }
    

    The other thing I would say is that getUserSelectDrop() reads the value of the settings file every time through the loop, who has a bit of a drop in performance. I recommend to save the value of a local variable only once before the loop, then use for comparisons instead:

    var userSelectDrop = settings.getUserSelectDrop();
    for(var count = 0; count < theOptions.length; count++)
    {
        if (theOptions[count].value == userSelectDrop)
        {
            drop.selectedIndex = count;
            break;
        }
    }
    

    Note also in this last code that I added a break statement, if the value matches to avoid the loop to test all the values more unneccesarily.

  • Submit the email recipient of the choice of the user form and submit in pdf

    I was able to set up a "submit" button so that the user can select the email address, but I can't implement the presentation then the form is sent in pdf format. Can anyone help with this?

    Thank you

    M. dawn

    In all cases, the e-mail message outlook is displayed and the user can adjust any part of the email from there. You can choose one of the methods to send a PDF file instead of an XML file.

    Paul

  • Label of the choice of the user of an objectlistfield element control knob

    Hello

    I'm a beginner and this is my first BB app. I have a problem and I tried to do on my own, done quite a bit of research, but could not find any solution.

    The thing is, I have a button on the main screen, was added by clicking this button, I push a popupscreen at the top of the stack that contains an ObjectListField. Now, I want to put the label of the button on the screen as the name of the selected field in the ObjectListField. I have attached my code on which I am experimenting and trying to learn (really enthusiastic about it ), so would appreciate any help in this regard. Thanks a ton

    package mypackage;
    
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.FieldChangeListener;
    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.container.*;
    import net.rim.device.api.ui.component.*;
    
    public final class MyScreen extends MainScreen
    {
    
        ButtonField btn;
        public MyScreen()
        {
            // Set the displayed title of the screen
            super();
            setTitle("MyTitle");
    
            btn=new ButtonField("Label",ButtonField.CONSUME_CLICK);
            btn.setChangeListener(new FieldChangeListener()
            {
                public void fieldChanged(Field field,int context){
    
                    UiApplication.getUiApplication().pushScreen(new mypopup());
    
                }
            });
    
                    add(btn);
    
        }
    
                /*public void inval(String lbl){
    
                    this.btn.setLabel(lbl);
                    this.invalidate();
                } */
    
    }
    
    class mypopup extends PopupScreen implements FieldChangeListener{
    
        String it;
    
    ObjectListField obj=new ObjectListField(){
    
            public boolean navigationClick(int status,int time){
    
                int selectedindex=obj.getSelectedIndex();
                 it=(String)obj.get(obj, selectedindex);
    
                UiApplication.getUiApplication().popScreen(UiApplication.getUiApplication().getActiveScreen());
    
            MyScreen my=new MyScreen();
                 my.btn.setLabel(it);
                my.invalidate();
    
        UiApplication.getUiApplication().invokeLater(new Runnable()
                {
                    public void run(){
    
                        Dialog.alert(it);
    
                    }
                });
    
                return true;        
    
            }
        };
    
         public mypopup() {
    
             super(new VerticalFieldManager(VerticalFieldManager.VERTICAL_SCROLL|VerticalFieldManager.VERTICAL_SCROLLBAR), Field.FOCUSABLE);
    
             String[] type=new String[] {"a","b","c","d"};
                obj.set(type);
                add(obj);
    
         }
    
        public void fieldChanged(Field field, int context) {
            // TODO Auto-generated method stub
    
        }
    
    }
    

    Hi Simon, first of all thanks a ton for the answer.

    I learned a lot by reading the documentation and links that you gave me.

    But the thing is, I really want to use the class popupscreen instead of the dialog box. So (with assistance), I made small changes in my code, and it seems to work now.

    I write changes in my code for other users who might have the same problem...

    I created a setlabel method (* not to be confused with setLabel), in the class MyScreen and right where I implement anti-pop mypopup class, I did...

    Scr Screen = UiApplication.getUiApplication () .getActiveScreen ();
    If (instanceof MyScreen scr) {}
    MyScreen my scr = (MyScreen);
    My.setLabel (IT);
    My.Invalidate ();

    Finally, it seems to work now.

    See you soon

  • Assignment of a USB port to a COM Port.

    I am running Windows XP Professional I have software that uses COM ports in the settings.  You can use my USB devices.  My computer only has USB ports. How can I redirect say COM 5 to a USB port or a device?  Can I connect a USB device to a specific COM port?  I know that if I use a USB series adapter it gives me a virtual com port is it possible to assign USB to a virtual com port without the adapter?

    As I pointed to a poster earlier in this thread, there is no way to make a USB port to simulate a COM port in the software.  Necessary pins simply do not exist.  You need a USB adaptor to series which is located practically in the world of computers and their accessories are sold.

  • Run each VI but then show after a different action by the user

    Hello everyone,

    Sorry for my English in advance, you will see some errors probably: 3 I hope you understand anyway!

    Well, I am a beginner with labview and I work in a project on a system that may take measures of speed and strength.

    I have already created several VI:

    -One for speed

    -One for the force

    -One to make a report

    - and another at the choice of the type of the event.

    To summarize, the system having to control 2 types of measures: 24 mph and 28 mph and we must conform to this 2 different tests, obviously.

    The goal is:

    (1) see the first VI: type of measure and leave the choice to the user about 24 or 28 miles an hour and then Labview tell if it complies or not after the measurement.

    (2) display the VI that show measures speed for users;

    (3) display the VI that show measures of force;

    (4) and finally the last VI to carry out the report: I have integrated checkbox, etc..

    I would like to help users switch in this VI through the buttons "previous" or "next".

    I already write a 'hand '. If I run the main I had a first push button to go in a VI, and then I had a few 'next' buttons to display the next VI.

    But now I have different problem and even if I try to tackle him I really don't understand how...

    I will develop my problems:

    -The main problem is execution of these screws: the test is in the 0, 6s. So I would run each VI during the test, record data and only then to show different for users through these VI data as I explained before. For the moment, as I understand it, my work just run different Vi when I click on the 'Next' button and finally I don't want to do that.

    -Another problem is that, in fact, the user can navigate between different VI, but they are not yet delete when the user clicks 'next' Finally it does nothing actually. In the example, I want the user to look at the speed of data, write them on another file, and then click Next, sign before removal and next show, write to another file, click Next, etc... and I do not understand how it is possible...

    -Finally, I think it's possible, but the best thing for me would be that different data stored in a file, with everything which is located on the front panel. If I had a graph, I would like the graph in a file, etc. And in the example for my last VI, the report, thanks to the box. If something is check, writing to a file, and if it didn't ignore it.

    Sorry for this very long text and my bad English. I hope you understand my problem... I really need help-_ - I am disappointed, this is an important project for me (learning) and I tried a lot last week, but I ask you cause now I have really idea more...

    Thank you in advance,

    I join my project to receive a little help and explanations for this problem

    Hello

    With your architecture, it is obvious that you can't go back.

    I would be more appropriate to have a main.vi with a State for example machine calling Subvi through sub - VI supanel controls front themain.vi.

    Here are a few documents:
    http://digital.NI.com/public.nsf/allkb/D587067E18E0E70186256D44007B91FE

    http://zone.NI.com/reference/en-XX/help/371361J-01/lvhowto/loading_panel_in_subpanel/

    Adrien

  • WIN8 cannot select the user when connecting more

    I used to have the option to select the user to connect as but now I have a screen that says:

    Press Ctrl + Alt + Delete or use the Windows Security button to unlock

    When I hit Ctrl + Alt + Delete I get only the most recent user login.  If I hit the left arrow right top left of the image, I must return to the Ctrl + Alt + Delete screen.  There is no way I can see to select another user.

    If the current user remembers actually disconnect from the screen Ctrl + Alt + Delete I am taken to a login with a choice of the users screen.

    This used to work and I don't know if my 5 yo changed something or if a updated Windows did something.  But my wife and son both need to use this notebook so I really need separate accounts.

    I found a few long really complex stuff on the ' net on the definition of the strategy group and fiddle with the registry but I know my 5 yo did nothing like that.

    How do I change back?

    Dennis

    PS what is the "Windows Security button" anyway?

    I realized that I had recently installed Cisco AnyConnect VPN software to connect to the work.  Which of - installed and now life is still happy.  I will contact Cisco.

    Sorry for the short reply above.  Validation has been broken here earlier today and several machines at the same time making a response and a new post, I didn't type a bunch just to get the "Oops, something went wrong" again.

    Dennis

  • How to display a drop-down menu when the user clicks on a point on lineseries?

    Hi all

    I am new to flex development.

    I watch the series online on the Board, I would like to give a response when the user clicks on the "point" on the line, I want to display a menu drop down and react to the choice of the user on the menu item.

    Is this feasible? Any sample or reference?

    Thanks in advance.

    Jack

    I prefer to use itemClick localX or stageX, according to me, one of these will help you get what you want.

  • Exception BAM-00404, authentication failed. The user is marked inactive

    Hi guys,.

    Recently, I had import users from the Active Directory (AD) in Weblogic. He has completed successfully. But, my BAM users, have been disabled automatically. After reading this forum and documentation of BAM and remove these users from the administrator of BAM, it was great! My users have reactivated, BUT after a few minutes of this (even if I was on an active session) my users have been disabled! I know there is a problem between BAM and LDAP, but I don't know, the problem is in BAM, because other apps, working properly, even using the same user I always use in BAM.

    Can someone help me, please?

    Kind regards

    Imene

    BAM done periodically a list of choices for the user using / API user role and is not found in the security provider that JPS/OPSS investigates. What version do you use?
    You should not see this problem in 11.1.1.2.0 version. Move AD security provider to the top in the list of the auth provider in WLS console. Or you can disable this periodic check in 11.1.1.2.0 version affecting false in the BAM configuration file server.

  • Output Multipal Modem and Ports Com Usbs without deleting the driver...

    In my laptop I don't connect to many cell phones, now my problem is my Ports none is going too far and I do not use affected old Ports so I tried to find Solution on Web... I Manage to find Solution but I stuck when it comes to too many Ports... I want to release too many Ports in a short way.

    What I find Solution on the Web...

    Run elevated command line Device Manager:

    > set DEVMGR_SHOW_NONPRESENT_DEVICES=1
    > devmgmt.msc
    
    

    Turn on "Show hidden devices" in the menu and uninstall gray COM ports.

    After the display of hidden devices, it's hard to uninstall devices one by one... I want to erase a single Type of devices in a single order without deleting driver device because my goal is to free Ports as much as Possible without removing the device driver...

    Hello

    Currently, removing the devices in the Device Manager is possible, one device at a time. This is because each device has its own corresponding entries in the system files and registry.

    Kind regards.

  • The COM Ports on Satellite P10 do not work after the conversion to the WXP Pro

    I have a P10 (PSP13E-0372V) that I have upgraded from XP Home to XP Pro. Everything went very well and then I discovered that I don't have a COM port or at least Device Manager shows no COM port.

    If I try to dial, I get "Error 633 the modem is in use or not configured properly". Back to Bishop device to watch the modem which, it says, works very well. If I query the modem (Diagnostics) told me 'port that the modem is attached could not be opened. "
    Also, it is said it is attached to COM3 but I can choose any port and get the same result. (When I change the port I get the message "the port has been opened by another application. Renaming the port may have an unpredictable effect on the other applications")
    I tried to remove the modem and restart but no change.

    If anyone any ideas how I can get the modem to work.
    TFAI

    So any ideas on how

    Hello

    Usually WXP Home, Pro should work without any problem because all the drivers, tools and utilities can be used for the two operating systems. I just hope that you have preinstalled all things in order of good facilities.

    Have you installed the driver chipset from Toshiba download page right?

  • How to change the settings of the BT COM port with the Toshiba BT stack?

    I have a Tecra S11 with Windows7 64 bit and I need to connect via Bluetooth to a remote the BT series device. I want to use the BT interface on board.

    The BT remote appliance 38400,8, N-2 (stop to the most common place 1 2 bits). Problem: I find nowhere to change local BT Com port settings.

    The physical port HW parameters can be changed. See:
    HW COM1 with the port settings: http://i42.tinypic.com/epg5qr.jpg

    But I don't get the same tab for the port of BT:
    BT COM40 without port settings: http://i40.tinypic.com/24mcduw.jpg

    Not even the BACK order 'mode' allows me to modify the ports of BT

    Curiously, if I have the COM40 to a virtual machine on the same S11-tunnel (virtualbox), the machine virtual XP * can * change settings and communicate correctly with the remote device. How is that?

    Can _How Yes, I change the port COM BT with the Toshiba BT stack settings? _ my version is 8.00.12 (T), which should be the most recent available. I also updated the BIOS.

    Thank you
    Paolo

    Additional details.

    I tried to run the application as Administrator: still does not work.

    I crossed Win registry with regedit and gave all permissions to all users: still does not work.

    With the registry editor, I forced the port in 38400,8, N, 2 in 'HKEY_LOCAL_MACHINE NT\CurrentVersion\Ports': still does not work.

    Note that not only the application target complains, but also does not work the PuTTY used as a terminal series.

    The Toshiba BT application see the remote device were undetermined, serial port, Dev.B. No provider.

    I'm lost and stuck. Advice greatly appreciated.
    Paolo

Maybe you are looking for