Jump to content

ShaunR

Members
  • Posts

    4,856
  • Joined

  • Days Won

    293

Posts posted by ShaunR

  1. Array of clusters is what I am using currently with 2D Array of 4 Rows and 4 Columns fixed. This holds good for 16 Channels.

    Suppose if I want to change the no of channels to say 8, then the array should resize to 2 rows 4 Columns (This is possible).

    For example: 4 Rows x 4 Cols will be my default array size, when it is changed to 2 Rows x 4 Columns, the size of the array element should increase to accommodate to 4 Rows x 4 Cols Size.....

    The "number of rows/columns" property nodes will enable you to display different numbers of rows and cols.

  2. I didn't explain it well...

    From the start. Sandbox has defined "scripts" directory which is scanned to find installed scripts (by script I mean a VI where Active VI data is passed to). There is "New Sandbox VI" option which automatically creates new script from the template. It is a new unsaved VI, just like after clicking vit file. After creating the script you want to save it, but by default save dialog starts at directory of previously saved VI (or sth like this). So you have to remember where your scripts directory is and search for it. It may be a pain when it is located somewhere deep, so it is in conflict with "quick&dirty" paradigm of Scripting Sandbox.

    Summarizing, I'm programatically creating new VI for edit and I want to have specified directory in save dialog when user presses Ctrl-S

    IC (I think tongue.gif)

    If you don't mind being platform dependent then you can use the windows SetCurrentDirectory function (LV example here). But your scripting thingy would still have to be running after they decided to save it. Other than that, I only think if saving a dummy VI after they have saved theirs (again your thingy needs to be running to monitor the memory list).

    But if your going the platform specific route I would suggest adding it to the places bar so they can always find it easily.

  3. Hi,

    How to read the files. When I try to read a 100 mb file using SQLite_Select, I get the memory full message.

    Thanks,

    Subhasis

    Not giving me much to go on here. ph34r.gif

    What gives you the message? Is it windows/linux? It can't be in the error cluster because there is no "Memory Full" error code. If it is in the error cluster, what number (code) is it?

    Are you trying to dump the whole 100MB contents into an array? (What is the SQL statement?) How much memory do you have and when you get the error, how much is LabVIEW using (you can see it in task manager)?blink.gif

  4. Thank you, shaunR!

    But I still have some confusion. For example, how does this line fitting algorithm find the initial subset of points to start, and use what method to fit a line to the subset of points. Strangely enough, if I set the iterations value to 0 or a number more than 1, this VI will return almost best fit line, but when I set this value to 1, it return a line that seems to be fitted by the standard fit method.

    (the red spots represent the original edge points, and the green line is the fit line returned by this VI)

    The main difference between the NI algorithm and most others is that it removes outliers. It calculates a "best fit" using the mean squared difference method and applies a score. If iterations is set to 0, it is finished and returns the line (as in your first image). If iterations are greater than "0" it removes an outlier and then re-calculates the MSD and re-calculates the score to see if the there is an improvement. It keeps iterating until it either reaches a certain score or until it reaches the iteration number

    So in your second case, if you set the iterations to >0, the final point will be eliminated and it will decide that the first two are the "best fit". You need to have more data points to use this function effectively - the more, the better.

  5. Hello,

    I try to detect the following action in edit mode:

    I took control and moves over an xcontrol and then I released.

    Note that in my program, it must be the Xcontrol that detects the action.

    So I tried with the mouse up event, but since it happens on the control moved, the mouseup event is not triggered.

    After trying several strategies that have not given the desired results.

    Jonathan

    Have you tried the Drag/Drop Events?

  6. The line fitting function in NI Vision uses a robust algorithm to find a line that best fits a set of points.Although I have read the description of this VI in the NI Vision concepts manual, I am still confused about the robust algorithm it uses. So does any one know this algorithm or help to provide some references? thank you!

    Making Measuremnet On An Image from the Vision Concepts Manual described it in detail.

    The images are broken on my browser. But it describes the NI method.

  7. I'm really weak on networking technologies and terminologies, but I agree PS is equivalent to broadcasting. "Publish-subscribe" appears to be the terminology favored by the software community. The stuff I've read uses "broadcast" to describe what the component does, not label the abstract interaction pattern.

    In general though, there's so much variability in what people mean when describing a component as "publish-subscribe" or "observer pattern" that it's hard to infer anything about the implementation other than, "the component sends out updates when something interesting happens."

    I think you're right that SO is a subset of PS. In Labview it's pretty straightforward to migrate from a general PS model to a SO model. If the component has been decoupled correctly the change can be made in the publisher/subject without touching the subscriber/observer code or any of the client code.

    Accroding to the producer-consumer wiki, "content-based" and "topic-based" refers to message filtering, or how the producer/subject exposes subsets of updates. It's a decision that can be made independently of the PS/SO decision. So while SO could be a particular flavor of generalized PS interactions, I view content/topic based filtering as chosing the topping to go on the ice cream.

    ------------------------------

    I wrote the previous post last night at home. When I got to work this morning I checked to see what GoF has to say about it:

    "A subject may have any number of dependent observers. All observers are notified whenever the subject undergoes a change in state. In response, each observer will query the subject ot synchronize its state with the subject's state.

    "This kindof interaction is also known as publish-subscribe. The subject is the publisher of notifications. It sends out these notifications without having to know who its observers are. Any number of observers can subscribe to receive notifications." (p 294)

    I thought it was interesting GoF has the observer invoking the Subject.Update method to get the new state information. My implementations have never required that much work from the observer. Instead I just pass the relevant data along with the notification. I can see how requiring observers to call Subject.Update is a more flexible general purpose solution for Labview. By giving observers more control over when they receive updated data you can reduce the number of data copies the subject creates. I haven't run into situations where I have enough observers or large enough data sets to have to worry about that, but it's nice to know what to do in case I ever do encounter that situation.

    Microsoft have quite a nice definition of the pub/subs (including observer). the main differences seems to be how the clients obtain their updates and methods of registration. I'm more familiar with the content and topic (list) based since that's basically what "Dispatcher" and RSS are. But I've only used them in context with networking so events weren't applicable. I could see a use for observer invocation in something like LV web-services where you basically want to poll updates of remote devices. But it can be a bit prone to server over-loading if there are many observers.

  8. Sorry, I think you mistaken when speaking about LabVIEW 8.6. What you are saying may be correct for LabVIEW 2010, but I don't know for sure. In LabVIEW 8.6, if you "inline" a subVI, the subVI's code is literally copied into a flat sequence structure on the parent VI while you watch. You get a choice to "hide" or "show" the code by allowing LabVIEW to shrink or expand your block diagram with the code from the subVI. If you choose to "hide" the code, you get a flat sequence structure that is approximatly the size of a subVI icon, if you choose to show the code, your diagram is expanded to hold a flat sequence structure with the code from the subVI.

    In LV2010 there is a checkbox on in the properties so you don't have to physically place the code in the diagram. That why I said there is no longer a code boundary (as if you had placed the code in the diagram) however it is still represented as a sub-vi.

  9. It looks like I'm getting about 7us per call. Still not sure if that's to slow or not.

    Well. I wouldn't be complaining about 7 us to calculate a formula node.

    Can inlining and subroutine priority really be combined?

    This would mean that the inlined code should run at another priority that the hosting VI.

    I have never tried so I don't know for sure.

    Sure it can. It has nothing to do with priorities. As I understand it, when a VI is set to subroutine it means it gets executed sequentiality within the VI so there is no chance that a task/thread switch can occur at the call boundary. As for in-line - in theory the code boundary shouldn't exist, but you can select both subroutine and in-line, so I'm not quite sure exactly what happens. Like I said. I haven't really played with in-line but the VI has to be re-entrant whereas for subroutine it doesn't have to be.

    1) 20k.

    2) Win7-64, although the code will eventually be deployed on Windows Embedded.

    Well. 7 us for 20k elements isn't bad. That's 0.35ns per element yes.gif Any faster and it would have calculated it before you ran the VI biggrin.gif

  10. Hello all!

    I'm a forth year computer engineering student. I'm currently taking an instrumentation lab, and I was assigned around 2 weeks to hand in an end of term project. I have to use the DAQ USB 6008 (I've gotten fully acquainted with it so that's now problem) The problem is I can't find any ideas! Most projects are either too advanced or too simple for me to do.

    I know this probably has been asked around 100 times here, and sorry for asking for the 101th time, but do you have any idea on what would be a good two week project for someone of my level?

    What about a "Ghost Busters" machine (temp, pressure, humidity, detect sudden changes etc)

  11. In a publish-subscribe system, the publisher doesn't know how many, or even *if* any, other components are receiving the updates. It just sends out messages for whoever happens to be listening. Subscribers attach and detatch at will without the publisher knowing or caring that these things are happening. It's a true 1-to-n broadcasting mechanism.

    In a subject-observer system the observers "registers" with the subject, who maintains an internal list of all observers. When the observer doesn't want to receive status updates anymore, it notifies the subject it wants to unregister and the subject removes it from the internal list. I think of it as n 1-to-1 links.

    I think your pub/sub definition is really a broadcast definition (like UDP Multicast). I think the observer pattern is just a particular flavour of pub/sub as is "content-based" and "topic based". But I've only ever heard the term in context to events. In other areas I think it's called "List-based" pub/sub.

  12. Right, but I still have the same basic problem. I have a small, but not insignificant block of code that will be used in several places. To me, that sounds like a textbook reason for making a subVI, but what I'm finding is that the actual calculations take about 0.03% of the time, and overhead associated with calling the subvi seems to take the other 99.97% of the time.

    I was wondering about any tricks to trim that 99.97% overhead load.

    I'll see what I can do with the inline subvi switch, but I was wondering what other methods might exist.

    Gary

    Making the VI a "subroutine" is the fastest call method (i haven't played with the in-line feature very much but inline+subroutine should be the fastest). What sort of execution times are you seeing? Even a normal call is only 10's of usecs.

×
×
  • Create New...

Important Information

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