Jump to content

Grampa_of_Oliva_n_Eden

Members
  • Posts

    2,767
  • Joined

  • Last visited

  • Days Won

    17

Posts posted by Grampa_of_Oliva_n_Eden

  1. Ben - it's a pleasure to meet! Hoping my schedule will permit more time here!

    First, I'm thinking primarily about the basic native by-ref class (then I will extend my thoughts to wrapping that with a reference). And I must admit that I'm historically a by-Ref gal that is now digging by-Val.

    Let's consider two use cases: The first does not require this class global variable, the second does.

    Let's say that I have a parent class that is LogFile. The child classes could be TDMS LogFile or XML LogFile. In this case, the parent data could include the path for the directory to the files that will be logged. Yes each instance of the child would have a unique wire and each wire would contain a unique path.

    Now let's change the use case. Let's assume there is only the TDMS LogFile class and we have multiple instances of that class. However, there will always be one and only one path for the directory for all of the TDMS LogFile objects. And all objects will need to be able to read this information. This is the kind of data that might be stored in that static/class global variable. And the developer would simply create the method to set the value and that method would likely be called at the beginning of the application. And because the global variable is private to the class, it is protected from any spec of code, other than the associated method, being able to set it.

    Let me know if you are tracking with me here or if I need to clarify further, then let's wrap with references and chat more!

    Have YOU been looking at my Library? (Smiley-wink)

    I follow you right up until I have two seperate threads running that both try to set the method when they start. From what I read in your reply, the developer is responsible for ensuring only one entity tries to do use the Set method.

    I don't see how a global will protect against this issue without introducing semaphores etc, and by the time we go there we might as well use the SEQ.

    Thank you,

    Ben

  2. Don't know - we have to share time on that system and my time is in the morning. I'll give the queue a try tomorrow AM.

    Queues kick-arse particularly if you don't fork the wire fedding them. If you have to fork, let a down-stream thread do the forking.

    Watch your CPU load while testing. If you have a proccessor or two left over you may be able to "divide and conquer" routine or if all of the CPU is used, then we should turn our concern to making to consumers eat faster.

    Ben

  3. Gurus,

    I'm hoping someone here has some sage advice. Here's the situation:

    Running on a Core2 Duo (i.e. dual core processor)

    • VI A dynamically launches VI's B and C.
    • VI B runs in a continuous loop and manages a DMA from a 3rd-party DSP board. It puts a subset of the data into Named Queue 1 and all of the data into a LV2 global.
    • VI A reads the data from the LV2 global, processes it, and puts the results in Named Queue 2 in Loop1. Loop2 flushes Named Queue 2 and transmits the contents via TCP/IP on physical port 1.
    • VI C runs in a continuous loop, flushes Named Queue 1 and transmits the contents via TCP/IP on physical port 2.

    I am monitoring the intervals between VI C's outputs. Ideally, VI C should be putting out data every 15ms, regardless of what VI A is doing. In order to try to ensure this, I have done the following:
    • All shared VIs are reentrant
    • VIs A, B, and C are all assigned to different Execution Systems
    • VI's B and C are run without opening their front panel.

    I've observed that when I run things with a typical processing load, the time delta between VI C's outputs gets very noisy, with spikes up in the 100s of ms. I can confirm that the issue is not related to the input traffic by disabling the processing stage of VI A. When I do this, I do see VI C's output every 15ms +/- a couple ms. I see the same thing with the processing enabled if I give it a very small processing load (leading to a very low output load).

    To me, that points to two possible causes: 1) VI A's processing is monopolizing the system, preventing VI C's loop from running as often as I would like it to. 2) The fact that VI C and VI A are both using TCP/IP writes, although to different ports, is causing some sort of blocking.

    Slowing down Loop1 in VI A considerably is not an option.

    Any thoughts? Theoretically, What's going on in VI A should not affect timing of dataflow between VI's B and C, but that's what I'm seeing. Does anyone have any tricks they care to share?

    Thanks,

    Gary

    Quick check to ensure the LV2 is not a bottleneck. Get rid of teh call to the LV and replace it with data of the same size and type. If ther jitter goes down it may be the LV2 is a bottleneck. NOTE: If you set your LV2 to sub-routine priority, you will pick-up a new call option "skip if Busy" that is very helpful in preventing one thread from hanging waiting on a LV2.

    Ben

  4. I think the point is that each instance of the class would have access to that one "class" or "static" variable. Endevo has a "class attribute" which is scoped to all instances of the class. And I think that is the goal here as well.

    If my ears are working right this is the first time I have had a chance to speak with you. Nice to meet you and thanks for the reply.

    So these globals would be read-only? i can see how the single-element qeue has built-in protection but if I am crating two instances of the class at teh same time, SOMEBODY has to write to them and who will win with protecting the global with semaphores?

    Ben

  5. A topic that has never come up on LAVA or in any of the presentations/discussions I've been involved in in the last three years:

    ...But the argument from the other side is that

    1. global VIs are so easy to write compared to [insert alternate mechanism here]
    2. You can search and find all uses of a global VI, which you cannot do with Data Value Reference (DVR) and single-element queues (1EQ). You can search for all uses of LV2-style globals (LV2), but most of the time, those are written with a simple get/set, which means they have the same data copy and read-modify-write danger. So why not just use a global VI?

    ...

    1) Easy is not better.

    2) A simple get set does have the same trouble as globals, yes. This is why I recomend AEs since their structure brings with them implied resource locking. I would not use a simple get-set LV2 for the same reason i would not use a global.

    Add to your list of reasons to not use a global "Global use can thow off determinism!" See this thread.

    http://forums.ni.com...75255&jump=true

    where I swore off the globals once and for all.

    Regarding when it would be appropriate to use globals in LVOOP... Q

    Wouldn't a global restrict the proper operation of a class to single instance? If I wanted two instances of that class, isn't there a possiblity that the two instance could be hitting the same global in differnet ways?

    Ben

  6. What would be the best approach to design & write an application that need to control a device using multiple protocols via multiple interfaces (e.g. SCPI over GPIB and SNMP over ETH) ?

    Before anyone answers OO, I'd like to complicate this question by saying that it needs to work with LV 7.1.1 (aka not OO).

    Jakub

    I used to use VI Server to deploy a background process for each "plug-in" that could support the interface, and provided a generic interface so that all of the various plug-ins looked the same.

    Shane's Nugget found here

    http://forums.ni.com/ni/board/message?board.id=170&message.id=255002&query.id=917330#M255002

    maybe helpful.

    Ben

  7. Sorry, I'm sure this is covered somewhere, but a quick search didn't find it.

    I need to send data from one loop to another. I'm going to generate a user event so the second loop can use a dynamic event to respond to the incoming data. Is it better to send the actual data (which consists of a few clusters with about 10 components in them) or references to the clusters?

    George

    If by "references" you are refering to control references, then pass the data.

    Ben

  8. Yes, Ive tried that method.

    Problem is I need an example of how its supposed to be used. I couldnt get that to work.

    I would need a picture or a VI

    Im using LV 8.5.1

    J

    These threads on the Dark-Side may help.

    http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=394132#M394132

    http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=434723#M434723

    Ben

  9. ... (Besides, I hate Init methods. wink.gif )

    The Book by Craig larman (?) on UML and patterns is often referencing the creation (I still cal them Init) of objects and GRASP includes the "Creator" design pattern to aid in deciding who is invoking the Creation method. Is this expressed "hatred" a semantic issue (you don't like the word "Init") or the whole idea of a "Create" method something that has fructarted you?

    As it stand now I have accepted them (Create methods) as being part of the game and have been thinking about how to exploit them rather tahn avoid them.

    Like I said, I'm just trying to learn something.

    Thank you!

    Ben

  10. Be patient I am trying to learn LVOOP.

    Fro a set of plug-in classes the Init methods append their class name to an attribute of the of the top level class called "Type". The children all let their parents init run first so I end up with a name that is constructed based on the inheritance. Since access to that method is public, user of the class can determine the hiarchy of the classes found.

    Example Type

    PlugIn_Serial_Anemometer_3Axis

    PlugIn_Serial_Anemometer_2Axis

    PlugIn_DAQ_AI

    by stripping of the text following the final underscore, I can see the frist two are siblings while the third is not.

    Really trying hard to help,

    Ben

  11. Everything counts in large amounts...

    Ben puts his "Large Disk Specalist" Hat on.

    Fragmented drives slow down disk transfers because the read operations involve physicl movement of the heads or waiting for the sectore we want to pass under the R/W head. When a disk is not fragmented and is empty, data can be W/R as fast as the disk spins. This is common knowlege but I repeat it for the next ideas.

    When we write a file to disk we not only have to wait for the postioner to move and the disk to rotate, but we also have to allocate the space, and update directory information so the OS can find the file again latter. For large files that are growing the OS has to stop and maintain the file system while we are growing the file. This is very similar to the hits we take when building an array except the disk is orders of magnitude slower than RAM.

    Fast Disk Writing Trick!

    Whenever we can make an estimate about how large a file could be, we can "pre-write" a file that is twice as big as what we expect. The "pre-writting" moves all of the disk structure overhead to a set-up step and keeps these housekeeping tasks from slowing down the writes. After the data is collected, copy it to the final path and truncate the file for the actual amount of data.

    Ben

  12. We had a demo unit set up in the building I used to work in. I played around with it on a few occasions and while it is very cool technology it's practical applications are limited to certain types of scenarios. For a single user nothing beats a keyboard and mouse.

    I know this comment was made in jest, but Labview development doesn't translate well to any current touch platform. You can do it, but you'll likely get frustrated quickly.

    Refering back to the app I mentioned above...

    It only took about 30 seconds of trying to code using those toch panels to achieve a state of "frustration". All panel activity is assumed to be a left click unless you "stand on one foot and wave a ... when the moon is full" ... well maybe the phase of the moon is part is an exageration.

    Ben

  13. I was going to ask you if that's what you meant, but then I thought that wouldn't help any because I'd be making a copy (or more) for the array and a copy (or more) for the graph. At this point I'm not sure if that's not just going to make matters worse. But I can give it a try.

    If I do the read in a subvi and deallocate, that works fine (1 copy made), it's just when that output gets put into the control on the calling vi that extra copies are made.

    Hi Cat,

    Do you agree that Aristos has answered the mysterious parts fo the challenge and now you have to work with that limtiation?

    If yes, then you may want to concider Dr Damien paper on managing large data sets that can be found here.

    http://zone.ni.com/devzone/cda/tut/p/id/3625#toc2

    The section called "Fast Data Display with Decimation" may be useful.

    Ben

  14. 5 copies. Yeesh.

    I'm attaching a pic of an example BD. All it does is read a file (~150MBytes) and send it to a waveform graph. The loop is there to keep the vi "alive". The default of all controls/indicators is "empty". There have been no edits done since the last save (in fact, I've been editing, saving, exiting LV, and starting the vi clean, just to make sure there are no residual memory or undo issues).

    When the vi is opened, LabVIEW is showing 81MB of memory usage. After it runs and is in steady state, LabVIEW shows ~537MB of memory usage. This would be, I assume, three copies of the data. Where are they all coming from? I've got "Show Buffer Allocations" turned on for arrays in the pic, and there's only 1 little black box showing.

    I'm running 8.6.1, if that makes a difference.

    post-9165-125422352305_thumb.png

    If you drop an "deallocate" and let that code stop (to let the deallocate work), does the memory drop?

    I'm thinking the transfer buffer is the extra copy.

    Ben

  15. I have a vi that opens a file, reads it, and puts the data in a waveform graph. How many total copies of the data should be floating around after it does all that? I had thought it was 2, but it seems to be 3. This is not playing well with my Very Large data sets. And it's really bad when I need multiple data sets displayed at the same time.

    I tried moving the read to a subvi, deallocating memory (which actually seems to work), and then passing the data to the waveform on the main vi. Still 3 copies.

    Is my memory going along with my computer's?

    Cat

    What "2" are you thinking about?

    There is the data (1) and maybe the un-do buffer (2), and I would add in the default (3) but I suspect you know better than to save a large set as the default.

    Just asking because I'm not sure how to account for three.

    Ben

  16. Guys,

    I have checked, and the three enthernet ports are sitting on the PCIe x1- which should give me 250MB/s. I have never played with Jumbo Frames. Is that essentially a setting for each ethernet.

    I think its time to ping the mobo manufacturer.

    Peter

    Have you concidered using a Raid drive and forget about the server?

    SCRAMNet for Curtiss-Wright is another data path that alows for fast data transfers. Yse you have to write your own file transfer code to run on both nodes....

    Ben

  17. Functionally, they are the same. But the implementation is totally different. A property node will force the front panel to draw and will really slow down your program. Local Variable is faster, but not nearly as fast as a wire, shift register, or terminal.

    adding a little to the above....

    LV has a special back-door mechanism for updating via a local.

    A property node on the other hand uses the UI thread to do its work so there could be thread swapping issue if using this method.

    Ben

  18. ...

    PPS: I love this photo on the CBCNews.ca website:

    w-g20-cp-RTR287EJ.jpg

    That image of Gateway Center illustrates the state of the city durring the G20. My buddy that drive around a lot loved it because there were no cars on the road and he could drive 80 MPH and nobody cared.

    If the photographer of that photo had turned around and walked about 50 paces the image would have shown the fountain in Point State Park and the stadiums.

    I have heard of ants (in central america ?) that will invade a town and devour everything that is edible in site. The residents will clear out when this happens and when they return the town is complete spotless!

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

    While watching the activites on the local news and discussing same with my buddies we questioned a report that the deligates where learning about the local history. Since none of them came out my way we felt that they did not learn about the local history of South Park and the Whiskey Rebelion!

    Back when the US was young a group of Scotish settlers settled in the area just south of Pittsburgh (note "H" in spelling) in what was called Sleepy Hollow (walking distance from my house) and Loafers Hollow. The young congress had used their new powers to raise funds througha tax on whiskey. This was not recieved well by the locals who had settled here to avoid taxes and government. Before it was all over US federal troops were used against US citizen for the first time.

    I had thought Jefferson was the president at the time but my buddies insisted it was Washington that sent the troops.

    So with that little peice of questionable trivia, I will close out this series of reports from near ground zero.

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

    "The ants have just left the 'Burgh."

    Ben

  19. I heard that quote on the news last night.

    I was pleasantly surprised by how Pittsburgh looked. Maybe next time I'm flying thru there, I'll stop and tour around for awhile.

    Cat

    World class museum! Andrew Carnegie owned US Steel and used his money to buy up all of the dinosuar bones he could find.

    "Hell with the lid off"

    When I was a youth I followed my father around the world as an Air Force brat. We would visit my grand mother occationally. Since the air always smelled of sulphur back them it left a mark. I can't smell chocolate chip cookies or sulphur without thinking about my grand mother.

    Ben

  20. Just watched tonight ... pepper spray and sonic weapons blink.gif used to disperse an unruly crowd. Hope you are home safe and sound.

    A group a protesters attempted to turn a demonstration into a march on the convention center. They were well prepared with at least one participant was clad in chemical warfare gear (one of my apps may have been used to certify the SCBA!). They were assigned the duties of "Kick the can" everytime the pepper gas was used.

    Mounted police cleared that crowd. (apparently it is possible to heard cats, if you have enough horses)

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

    First use of tear gas in Pittsburgh in the last 20-30 years

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

    After re-grouping the Armoured car was brought out. It was equiped with a lod speaker system that sounded like it was stolen directly from the first RoboCop movie (D2 ?).

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

    A one man sit-in was cleared with little incident.

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

    Worst traffic jam in recent history here in Pgh. It consisted of all police cars, including some from the neighboring state of Ohio. I did not know that was lelgal.

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

    Over-night a Rite Aid pharmacy and a bank had windows and doors broken.

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

    The visitors were entrtained at Phips Conservatory which is where the annual garden show is held.

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

    Out of town visitor appear to be suprised that Pittsburgh is no longer "hell with the lid off".

    Ben

×
×
  • Create New...

Important Information

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