Reading of RS232 event structure

Hello

I use the Write.vi to read RS232 attached as a starting point and do RS232 - help.vi him. successfully, the original written 1 posts, then wait a little, then reads 1 message. What I'm trying to do is to be able to read several messages. So I would write 1 message and I would read 1, 2 or 3 messages back or however many messages to ever come back, I guess that.

Here is how I modified the original vi to get where I am now:

I tried to add a structure of the event around half 'read' RS232 program. My structure of event triggers when the bytes to read the changes, this value can range from 0 to several bytes to be read, or muliple bytes to read 0. Up to half of the time I would trigger and not need, so I then added the accession of case which only works when the bytes to read the value is not 0, which means that it must be something waiting to be read whenever the program inserts this box. (I hope that's clear).

At the moment, my program will not read and I don't know why. Through the program of first base, I can read and write properly. (I just hooked pins 2 and 3 on my cable so I read everything I write for testing purposes). So I know that the problem is spoil me the 2nd joint program

Any help would be appreciated! Thank you.

EDIT: I added 2 .jpgs incase you are on an different labview version.

Better.

But I don't think that permutation of the structure of the event for the structure of the case actually has really helped what.  In fact he madet worse.  You had the case of locking Panel event before the value until the end of the event.  But with the structure of the event within the structure of the case, there is a chance that the structure of the event will never run and therefore the façade will be locked up forever.

1. you want to only 1 VISA close.

2. event structure has been set.  I also added an event for writing switch is restored.  So now, it'll write if you change the channel or when you turn the switch to True.  (Note, you will not be able to always send the same string as in the original example because you must press the power button or change the channel.

3. I used the structure of the event to stop the loop of both Scripture by trigger on the event that the button is pressed.

4. I don't know what you mean by a «black» read

Tags: NI Software

Similar Questions

  • How to merge the event structures?

    I have a program of VI script that reads a text file of records and displays a structure of the event.  It works very well because it creates all the controls and indicators I need associated with the defined registry and code backend (i.e. the structure of the event).

    After I generated all this code, I copy and paste in the main VI I develop.  Everything works very well.  The only problem is that there are 100 text files from separate registry.  This means that I end up with 100 separate event structures.  Although it works, it takes a lot of space and I prefer to combine them.  However, each event structure has anywhere from 15 to 75 entries, so to do this manually is not an option.

    Is it possible to selectively merge the event automatically structures?

    I guess I could write a labview scripting routine that could get a reference to the structure of the event in VI, then merge... but part of the problem there is that there are a handful of structures of event I want to separate them just because they are not associated with the set of registers, that I mentioned.


  • Clear VISA with event structure

    Hello

    I have a number of virtual serial ports of bluetooth as stream very quickly as soon as you open them with VISA configures port. I have set up/open these ports one after the other and it takes a lot of time (2 min), I think it's because they are com ports virtual bluetooth.  However, as soon as a single port is open, the data streams in and fills the buffer (eventually crashing the program), while I open other ports. I was invisioning something similar to an interrupt driven microprocessor to erase the buffer whenver it exceeds 2000 bytes to the port, my friend told me about event structures is similar to interrrupts. So, ideally, I would like to create a user event customized, defined by the property (bytes to the port) of a VISA com port node when it exceeds 2000 bytes. I would like just to run code that was going to free the buffer when occurs the same. Seems like a simple idea, I searched and did not find what I wanted to do.  Any help would be appreciated

    Thank you

    Chris

    Its delicate, but I think it would work.

    LV allows multithreading, so you can certainly run screws in parallel which are completely independent of each other.  But the challenge is that your code cannot access the same COM port simultaneously.  But the way you described the problem, which could be circumvented.  I think your 'COMPortMonitor' could sit and wait for each port to open before their follow-up... so that your main loop before opening the following COM port.

    Here's what the flow would look like:

    VI of HAND PORTMONITOR.VI                                      

    0 Begin execution of this

    1 separate launch PORTMONITOR.VI

    2 open COM1 begin implementation of this loop

    3 tell PORTMONITOR COM1 is open

    4 begin to monitor COM1

    5 open COM1 empty COM2 buffer when it becomes large

    7 tell PORTMONITOR COM2 is open

    8. start monitoring COM2

    9 empty COM1 & COM2 when they become large

    10 stop this loop when last COM is open

    11 more...

    In step 5, your parallel loop will work with COM1... so that your main loop is busy opening COM2.  In theory, I expect to run independently.  And you can try to put them in separate threads, too.  This links talking about parallel loops in series:

    http://forums.NI.com/T5/LabVIEW/multiple-parallel-asynchronous-continuous-serial-visa-reads/m-p/8090...

    BTW: I think that you must ensure that your VISA application is asynchronous to operate (right-click on them).

  • Cases of event structure do not work (probably façade is disabled

    Please find the attached VI, I tried the update feature and inlcude a new code. And it ends in a non-responsive event structure.

    Is this a bug (related to the definition of property of "Windows run in a transparent manner") or am I missing something...?

    You have your events to lock the front until full.  If you have a keydown event, the structure of the event 2nd he also captures and locks the front panel.  You might think that you have a timeout, but this loop does not receive the value of timeout until the first so that the loop ends.  Your second loop depends on the completion of the first loop.

    If you do not hit the combination just with a keydown event (or leave of mouse or mouse enter and other events that would lock the front) which causes also this first loop to stop.  You have locked your program.

    As Mike said, have 2 structures of event on a diagram when you do not understand how to work the event structures.

    I recommend reading warnings and recommendations when using events in LabVIEW.    This document has a little more items that I think should be mentioned.  But it's a good start.

  • Event Structure/AC help

    Hello

    I'm stuck... I have some difficulty to find out how to make my VI attached to behave according to the needs. The highest level 'EventStructure.vi' VI is an interface user of façade to a printing application label (using ActiveX). Loading the VI he sits in internally while loop until printing or buttons on front of output. If the product "select" drop-down has a change of value I love out to the special label for this product file and read a serial number from the label file variable and indicate the serial number on the front. I wish I had the façade VI keep this serial number that there is another change of the value on "Select Product" but right now it only he holds on the front panel so that the next time through the whole loop. Also, the string containing the path to the file of labels only holds in memory until the next time through the whole loop where it is cleared. Is it possible to have these values stored in memory and only change when there is a change in value on the drop-down list box "Select Product"? I do not understand that this behavior is the General event Structures work, but I am unable to find a better way to do it without using a Structure of the event. The sub - vi 'GetNextSerialNumber' calls to an external application using ActiveX and it takes a while (4-5 seconds) so that the application load and process the ActiveX controls so I want to just call the external application when there is a value change on the drop-down list box "Select Product".

    You need to store values that you want to keep in the shift registers. This will allow you to pass the value from one iteration of the loop to the other.

  • Sending data to LabVIEW via TCP to read in a C Structure

    I want to send the data TCP for applications written in C. The Application in C, intends to read this as a structure "srvResponse". The receiver C structure code is represented below:

    MAXDATA 128 #define
    #define DATALEN 64
    #define MSGLEN 128

    #pragma pack(push,1)

    typedef struct _srv_RespAlarm {}
    ID of the abstract;
    short level;
    Description Char [MSGLEN];
    } _srv_RespAlarm;

    typedef struct _srv_DataPkt {}
    short numpkt;
    char prmname [MAXDATA] [DATALEN];
    char prmvalue [MAXDATA] [DATALEN];
    } _srv_DataPkt;

    typedef struct _srv_BasicFlds {}
    follow int.
    version of float;
    short priority;
    short timeout;

    char subsysid [DATALEN];
    char cmdname [DATALEN];
    char timestamp [DATALEN];
    char ID [8];
    } _srv_BasicFlds;
     
    typedef struct srvResponse {}
    SpeedDial;
    short event;
    char message [MSGLEN];
    _srv_RespAlarm alarm;
    _srv_DataPkt data;
    _srv_BasicFlds cmdelem;
    } srvResponse;

    I tried with the LabVIEW code attached, but it does not work. Any suggestions?


  • Event structure/state machine

    Here's the scenario.

    I use the buttons controlled by the user in an event structure to control a state machine. Currently, I have a different State for each button. However, 4 or 5 of these buttons could ideally correspond to the State, which is what I would like to get... Each of these 4 or 5 buttons causes flow data and the results are stored in a table, but listened data are different for each button! Therefore, if each of those 4 or 5 buttons caused the same condition occur how I could decipher what button was pushed? Ideally, I would have 4 or 5 different paintings once all the buttons are out of the same State.

    Is there anyway that I can achieve this?

    Hi the shots.

    you have access to the refnum of the element inside the event. With the Ref, you can simply get the name or any other property of the control to distinguish them.

    Mike

  • Structure of the event in the event structure

    Is it possible that I can have a structure of the event, which is in another structure of the event? When I run the code, I can't use other buttons. (See chart for details)

    Do not put the event structures in the structures of the event! There is never any reason to do so.

    Redefine architecture your code in a correct state machine.

    (By default, events lock the façade until the event ends and if you raise the event internal or external, first of all, the other event can never fire because the current event can never accomplish or is inaccessible by data stream.)

  • mouse event structure entrance decoration

    I want one of my events in my event structure to detect my mouse entering a specific decoration that surrounds a control. I used the property pane to find what decoration is # but now I don't know how to call this specific décor as one of my events.

    The goal is that I want the user to have pushed a button to make a data folder before hitting to start generating data. I need the user to get an error message that they did not create the folder if they get even close to the Start button. I don't want to get the error after what they already hit early, because my Start button is linked to the data to a network variable that will get the ready message even if my host program has generated an error.

    Decorations of the façade are not the type of objects that can be associated with events.

    I think you have several options.

    1. follow the mouse move event and to compare the coordinates of the mouse with a few constants that you set that based on the location of the decoration.  This seems to be a large number of polling stations.

    2. not to associate your button start a dependent shared variable in the network.  When you press the Start button, make your comparison, if that's OK, and if not, the error.  If it is allowed, activate another hidden Boot button that is associated with your shared variable.

    3. use the mouse down? event on the Start button.  If you find that it is not a valid time press the button, ignore the event.

    4. use the event mouse input on on the button itself.

    5. use the event mouse entry on another button, which is located behind the actual button.  It could be transparent, or disabled, or disabled and greyed.

    6. If the button get press, the program automatically creates the folder for them instead to raise a dialog box and forcing them to manually.

    I think #6 or #2 would be the best option.  As a user, I would find it quite annoying that whenever I swept the mouse over an area of the screen especially involuntarily to have a pop up dialog box.

  • Output of the application using the event structures

    Hello

    In my project I used event structure that works well.

    Now I want to exit (close) demand when I press the EXIT button on the front.

    Here, I joined my project as an indication.

    Concerning

    Hari

    Hi thinnker,

    You must change the configuration of node Sub VI for this... This, then it will open whenever you call...

  • Which situations give an event structure do not capture a Boolean value changes?

    LabVIEW 9 x 86

    Windows 7 x 64

    I have an event structure that works very well.  It has 5 cases, each triggered by a change in value of various indicators.

    I added another case of event, I'm trying to raise the case of the event with the express control "Out of time", I made a deal to raise when the Boolean value "out of time".  The structure of the event does not run when the value changes.

    In addition, once figured out how to make this indicator to trigger structure of the event, I would like to only trigger when the value goes from 0 to 1 and not from 1 to 0

    Search the forums for "event to change value" and "value traffic".

    The value (I guess you have on the structure of your event, bar header you seems to miss information.) the change is triggered only when the user enters new data in a control, or you write a new value programmatically by using the Value property node (signaling).  Completed just by a program written for a local variable, or do not ' value' property node.

    To trigger that in a sense, you can put the code in the event of a case within a case structure so that it runs only when it it True (or False, if that's what it takes.)

  • How to read the windows event in labview

    I want to read the windows event viewer. Evt file to get information on the windows stop, start, restart... etc.

    and save it in my database.

    You might also take a peek at Microsoft LogParser. You can call the executable from the command line using System Exec. Supposedly, it also has an ActiveX interface.

  • Two loops of event Structure: hang

    Hello

    I have a wired problem when I try to use two loops with two event structures (see VI below).

    The problem is that you can stop the measurement and close the VI with X but not to stop it only with STOP button: this would lock the façade.

    Here my (rather long and perhaps not quite understandable) description of VI:

    A structure must respond on the user interface and the other a certain action. The first uses only user events: change value button START, PANEL NARROW? and the value enum STATE changes. The second event structure uses those registered dynamically: start the event user & user close event. Action when the STATE changes from button should always be done. When you press start the startup user event disables the START button and activates a loop in the second structure that should make continuous measurement. Now, we can always change the STATUS button and information (this works). The measurement loop should stop if the STOP button is true. Later START is enabled again and we should be able to press START again. It does not work as the front panel is locked. Curiously the last implemented user action works very well: by pressing X of VI, the PANEL CLOSE? is called in the first loop and should stop the two loops: If the measurement loop is running, STOP is True first, stop the loop measurement. Then a secondary structure event waits until the JUDGMENT is again set to False. If the measure is not in the process of running the first loop stops. In both cases, the event close user is sent to the second loop, successfully stop.

    I'm really confused, because I have no idea what is wrong. I would greatly appreciate any help on this.

    Best regards

    Daniel

    Thank you very much! This solves the problem. I did not understand that structures of events queued events even if they are not "active".

    (Finally there is even no need one notifier, you can just change the value of the real STOP button and will raise the event close user, comapare attached, work VI)

    Thanks again,

    Daniel

  • The quit event structure works when I switch the cdaq to crio

    I changed my structure of producer of written consumer 2009 for use crio in 2010 and my event structure enough work. The event source is the same.

    Panel controls raise no events on targets in real time as the cRIO, as these systems have not really accessible facades by the user.  When they do not display a façade, it runs on the separate development of the cRIO system; LabVIEW just give a homogeneous appearance.

  • Event Structure Weirdness

    Last night, SAP posted an interesting question on his blog (The Daily CLAD).

    In short, we create a dynamic event, enter it and generate two events with the data being 1 and 2.  Then we travel a structure of the event that is registered for the dynamic event.  Inside of the event is another structure of event which is also on the dynamic event inside a loop set FOR to run twice.  The data of the event was autoindexed and went straight to the final output.  Now logic would state that the output should be {1,2}.  But when I run it, I get {1,1}.  I thought it was really strange.  So of course, I got to play.

    I changed the buckle FOR to run 3 times.  Oh, it is here and waiting for another event.  If it is to see two events, as it should be.  It's just that for the second event data is not transmitted correctly.

    But let's play others.  I put another LOOP around the external event structure and did run twice.  He does not see the second event at all (that is to say, is there and waiting for another event on the second iteration).  Why not?  It is registered for it?  He saw the first event?  Why wouldn't it the second event in its queue?

    Now if I remove the inside OF the loop and let my loop FOR external, everything works perfectly as I expect.

    Now, it becomes even more strange.  I added a button and changing the value for the button of my external event structure (the two structures event with loops to go twice).  The structure of the external event is also ignorant of my button value change event.

    OR, what the #* $& @* is happening here?

    The problem is not with nested structures event, but with the shared record refnum. An event record refnum should belong only to a single event structure. As soon as share you, you get undefined behavior. It could work very well, he might behave in a totally random way.

    Example of David is wrong for the same reason. He may have worked when he ran, but it is not something that must be invoked. The structure of substantive event should have a separate record node.

Maybe you are looking for