Jump to content

code ferret

Members
  • Posts

    10
  • Joined

  • Last visited

Posts posted by code ferret

  1. One nice side effect of handling the "Instance close" event is that it provides a nice way to close certain types of aplications which are otherwise awkward. For instance, if you are working with a VI that has no title bar (for an embedded or kiosk UI application, for instance), but it also has no exit button or other UI control for exiting, how can you gracefully shut it down while working with it in development? There are any number of ways, but handling the "instance close" event provides a convenient way. Assuming you are using a project, you can close your VI by clicking on the LV project viewer's title bar close button (the "'X' in the upper right-hand corner) and it will close your VI, but not LV or the project viewer. Of course, if you build your VI into an executable, if you use the windows task manager "applications" tab to kill the VI, it will be handled "gracefully" as well.

  2. I'm using the oglib_variantconfig library successfully, but I'd like to format the floats. I've experimented with the 'float number format (optional)' input, but it always fails. I've looked at the documentation but haven't seen any examples or explanations. Can anyone tell me how to use this feature? My input is a cluster with booleans, integers, and floats; I wish to format the floats.

    here's a pseudo-code example:

    cluster{

    boolean one;

    boolean two;

    uint8 a;

    uint32 b;

    float c;

    float d;

    uint8 e;

    }

    I want to know how to tell "write section cluster" to format the two floats to 3 places. I've tried "%.3f" ".3", "3", ".3f", "%.3", etc. All cause errors.

    For reference, here's the documentation page: http://wiki.openg.or...Section_Cluster.

    I also found this page: http://opengtoolkit..../variantconfig/ which apears to be outdated.

  3. Hi all,

    i want to send a file of around 1MB from one PC to another using labview through serial port.im using Xmodem protocol for this application.

    my problem is how to detect the serial connection lost and give an interrupt to the sender saying there is an error on the link so that the transmission should freeze until the link get live.In this time both programs in the transmitter and the receiver should run even if the serial connection is broken.

    can anybody please help me regarding this matter?

    Regards,

    vattic

    Vattic,

    Off the top of my head, I would approach this problem using hardware flow control. You can watch the DTR/DCD lines, and use an event structure for control. If you do not have a 5-wire serial port, you could try watching your input buffer over time and change program state when the data isn't arriving. Just a thought.

  4. Hi

    Sometimes the response time when editing a large VI gets soooo long.

    I can easily see it on the mouse cursor when I move to different object and would expect the cursor to change, but it takes 3-5 second.

    Am I the only person to experience this?

    Mikael,

    I can't speak to your specific problem but no, you are not the only person to experience labview slowness. I am using 2009 SP1 and not only is it slow, but it is a little unstable. I frequently encounter strange problems that require not merely a labview restart, but a reboot - particularly regarding RT tools.

  5. Ooooh. Its all got very complicated, very quicky. Now we have variables, events AND notifiers :P

    True, it is complex! You may be right that using queues may be desirable when running software on only one machine or VI. But, I'm not ready to lower the shared variable battle standard :-) . The advantage of shared variables is that you can use them across PCS on a network.

  6. I don't believe they intrinsically suspend execution until an update is received. They also have huge caveates (e.g cannot be dynamically created at run-time). Its a bit of a sledgehammer to crack a nut IMHO.

    This is correct, but i think that creating this behavior is simple. You could use events to create this situation - for instance, use an event-driven loop to wait upon a variable change event and not allow any other code execution until the event takes place (say, by using a notifier to notify local VIs!).

  7. With a "Notifier with buffer" however, you would not need to change the code of the producer at all. You would just register a new subscription to "Notifier name" - and voila, your new code has a lossless stream of the data it needs. The fact that you do not need to edit the producer makes it possible to add such expansions to built applications, if you have given them a plugin architecture.

    Realising this idea would e.g. be possible by making a Que-manager that pipes data from incoming ques out to multiple subscriber ques. Whenever you have a producer of data - you create a que and give a reference to it to the que manager. If a VI wants to subscribe to the data, it aks the manager, using the name of the que used by the producer, for a reference. The que manager looks up its own list of ques - and when it finds it - it creates an outgoing que and gives the subscriber that reference. It also adds the subscriber to a list it gives to a dynamically created feeder. A feeder VI would be a VI that waits for data from a given incoming que (producer) - and then writes that data to its list of outgoing ques...

    So far I've only played with this idea..and perhaps I'm overlooking an already existing alternative, or a big flaw?

    I think that network shared variables do everything that you've requested.

    You can create a shared variable on machine 1, have machines 2 and 3 subscribe to it, and machines 2 and 3 will both get the same data.

    The queue manager that you have hypothesized about is the shared variable engine, which knows about all of the publishers and subscribers and buffers the data to make sure that all of the subscribers get the same data. You can set buffer lengths to arbitrary lengths.

    In a consumer VI you can watch for a change event for the shared variable in question, and your consumer VI will be able to act on the data as it changes without sucking data away from any other VI. Although shared variables cannot (yet) accept custom types, you can flatten custom types to a string, pass them into the variable, and unflatten them on the other side.

    Check out this link, which describes the entire process in detail: http://zone.ni.com/d...a/tut/p/id/4679

    My project is using shared variables in this way to do what you have described.

  8. All,

    I'm having an issue with the LabVIEW IDE crashing hard when I perform a certain sequence of operations using a DLL. I'mfairly certain that my DLL is faulty, but am wondering if there is some kind of debugging info I can get out of the IDE regarding the crash; when I restart the IDE after the crash, it does not know it crashed and doesn't ask me to investigate.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.