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. At the LAVA BBQ last night, I introduced the community to Songs For The LabVIEW Programmer, a little project I started in response to user requests at last year's LAVA BBQ. Admittedly, not all of the users were sober at the time they made the request for "some LabVIEW drinking songs", but I believe it is important for NI to be responsive to our users, even the inebriated ones. :-)

    The songs are now posted here on the NI Forums. There are some drinking songs and also some teaching songs if you have kids who are learning LabVIEW. I particularly recommend "The Execution Highlight Went Down The Wire Route." Very educational. And it has hand gestures. ;-)

    Missing from that list is a song for those not at NI Week or the one-man-shops based on the song "I'm so Lonely"

    :beer_mug:

    Ben

  2. Hi

    I using a musashi dispenser unit with Rs232 for controller pressure and dispense time. I want to write program in Labview for this. They protocol looklike

    DEFAULT is 19200bps.Data Length: 8 bit Start Bit: 1 bit Stop Bit: 1 bit Parity: None Flow Control: None

    the Dispense command is stx 04DI_ _(two space)CF etx

    the checksum of this command is CF, which is calculate is 00-30("0")-34("4")-44("D")-49("I")-20("SPACE")-20("SPACE")=CF

    can you guys help me calculate this in labview 8.6 VI

    thank you very much

    Duplicate post on the Dark side found here.

    http://forums.ni.com/t5/LabVIEW/checksum/m-p/1204899

    Ben

  3. Yeah, they are often used interchangably, especially by those of us who don't regularly do low level programming. Since that post I have come to understand what AQ was talking about. My confusion was based on mixing grammar. I used "pointer" and "reference" as adjectives, calling anything that points to something else a pointer, and anything that "refers to" something else a reference. "Points to" and "refers to" are mostly synonomous (afaik) in programming, so it follows that "pointer" and "reference" are synonomous. AQ was using "pointer" as a noun, and it has a more concrete meaning in programming than what I was using. Some of the subtle differences between them are:

    *All pointers are references. Not all references are pointers.

    *A pointer is a data structure that contains a memory address. They generally allow much lower level control over the contents of memory. For example, pointer arithmatic can be used to access memory registers near the one the pointer actually points to.

    *A reference is an abstraction that doesn't have any meaning in and of itself. It could be a memory address, it could be a key in lookup table, it could be an array index, etc. Because a reference has no inherent meaning, reference arithmatic is equally meaningless.

    *References often have additional protections built into them that aren't available to pointers, such as reference counting to prevent the memory from being deallocated or semaphores to lock a value during read-modify-write operations.

    So when AQ said, "We fully support references. We do not support pointers at all." I now know what he meant. My initial post used incorrect terminology.

    My first exposure to references was in OS theory for VMS. A File refernce is something we all use but there is a lot behind the file reference. The folowing may differn in Windows but this is how it went.

    When we open a file, the OS has to do a lot of work to get it open in our behalf. All of the details about that file are stored in a data struture defined by the OS that tells us where on the disk the file is, if it s open, how it is opened (write protect) etc. These where called a FAB File Atribute Block. Somewhere inside that structure was a pointer to another sturure called a RAB Record Attribute Block that would be used to map physical memory to the proper sectors on the disk.

    The pointer could take two forms dirrect or indirect. A dirrect pointer held the Virtual address of the first byte/word of of the FAB. An indirect pointer would hold the address where the address of the data structure was located.

    So as I understand them (just sharing notes) when a pointer (direct or indirect) is used to gain access to a resource (file I/O point, etc) it is commonly refered to as a reference.

    again, just my 2 cents,

    Ben

    • Like 1
  4. Hmm. I'm a member, but not a regular one. I hardly have time to keep up with LAVA.

    Well, I'm certainly not flying all the way to the one place in the nation that's hotter than DC to sit in a corner by myself. :) I'm on the waiting list to officially join you all.

    Thanks for the info! I'm looking forward to it (and I don't mean just lunch :P )

    I just got off the phone with Laura and there are no reservations required. Get your food wonder over and sit down.

    Ben

  5. Give me one good reason why the world needs more than 16 colors?

    [/Colour challenged]

    At least the queen Beatrix of the Netherlands agrees with you. (she made the Netherlands buy Victory Boogie Woogie)

    Ton

    Dilbert walks into Dogberts office and asks;

    "Do you notice anything differnt about me today"

    Dogbert replies;

    "Yes you have three pens instead of two, one of each of the primary colors."

    Dilbert replies;

    "There are secondary colors?"

    Original by Scott Adams of course and retold via the questionalbe memory of an old guy that wears a pocket protector.

    Ben

  6. If I can add a bit to what Paul said...

    Any two components that collaborate to achieve some goal are going to be dependent on (coupled to) each other somehow. Some types of coupling are strong; others are weak. (See here for a list of coupling types.) At the very least they have to agree on the shared data schema. What's it look like? How is it formatted? What does it mean?

    ...

    Thanks for that post.

    This is something that just sunk in with me this week-end. I managed to stumble into a messaging pattern but was troubled by the fact that the Messsaging Class only had a generic Class taht it passed around but I needed to slam other stuff into it depending on where it was being used in my grand scheme. I really did not want to cast the generic in the two classes that where using the messaging service because it seemd wrong somehow. I ended up convincing myself that cast the generic class recieved from the Messaging stuff into the class I waanted to share between the two interacting classes was OK.

    I tried it out with a couple of variations it worked beter than I expected since the messaging is completely decoupled now so I can re-use that class and scheme again.

    The actual message passed are special and unique to the interacting classes so having them both coupled to the class they use to comunicate is OK as well.

    So agian tahnks for the post. It is always nice to find you accidently stumbled in an accepable answer.

    Ben

  7. :yes:Agreed! That's why I had to modify it.

    Yes late to the game but for the sake of completness, all of the above can be done with a Waveform Chart except setting history legth at run time.

    See this thread on the dark-side for an example.

    http://forums.ni.com/t5/LabVIEW/How-can-I-update-the-x-axis-to-match-a-time-reading-in-a/m-p/160205#M95365

    The trick is to only have a single value in the "Y" array and the chart will plot the point determined by the t0 of the wf data type. updates do not have to be periodic but you can NOT plot backwards in time (all to's must be increains or the chart resets).

    Ben

    • Like 1
  8. Hi,

    I am currently working with LabVIEW 8.5 FPGA and PXI 7831R card for HDLC protocol Implementation.To start with I refered implemented code from NI site in the following link,

    http://zone.ni.com/d...a/epd/p/id/5339

    While I am running I am getting Received message Zero all the time irrespective of the Input command.If any of you worked with code please give input on this.

    Thanks,

    Nataraj.

    I have never used that approach to implement HDLC so I can't commnet dirrectly on that implementation.

    Please include some more detials of your test situation and exactly what you expect and what you are seeing.

    Ben

  9. ...

    hook up with a few LAVA members - we all know the good places. You'll know us as we always sit front-and-center at the keynotes (yes, we're geeks).

    ...

    My wife and I were sitting in the window seat of one of those eateries when my Wife nodded toward a group walking down the street and asked "What about them?" I looked up and saw Jim, Michael, and the JKI crew. But using the term to "geeks" to distinguish yourselves during NI week is like saying "Look for me at the prom, I'll be wearing a tuxedo."

    Ben

    • Like 1
  10. Were they allowed to look up the tests to see what is checked? I don't think I could name more than 5 of them from memory.

    "Ctrl-a followed by an allign left and then allign top" would generate a lot of violations. Same for the FP.

    Ben

  11. Here's what I'm seeing that makes me think you just can't avoid a buffer allocation on a dequeue - I don't know exactly how you could modify this to eliminate the allocation. But maybe I misunderstood the original question.

    Mark

    To avoids the extra data copy LV has to be able to "see" that the original data buffer is no longer required. In that example the data buffer being queued up is a constant in the code. If LV passed that buffer in-place and the consumer inverted all the bits, IN THE ORIGINAL BUFFER (sorry for yelling) then the next time you ran that code it would pass teh inverter version.

    I used queues to get data from my DAQ devices. The output from DAQmx is passed to the enqueue and since the wire is not branching, the data gets transfered in-place so the bufer from DAQmx read is the same buffer holding the data after the dequeue operation.

    Ben

  12. I don't think this is correct - the only wire I see branched is the queue ref, so this ensures you get a copy of the queue ref, not the queue element. I'm not privy to the internals of the queue implementation, but I think I do recall that I have read it is a protected implementation of shared memory. And I don't think the queues could execute at exactly the same time since a mutex or some such mechanism protects them so a queue read or write is always an atomic operation - that's the only way one could guarantee the FIFO behavior.

    Also, I built a simple example following the posted diagram - I get a buffer allocation on the dequeue if it wires to anything at all, even an array size function (which I'm pretty sure doesn't require a copy of the data to operate). And this is without even including the enqueue in the producer loop. So the buffer allocation seems to be part of the implementation of the queue and a DVR around the queue wouldn't help.

    I agree that the DVR would most likely be the most efficient way to go since as I understand it it could be thought of as a "safe" pointer. So you could write data to the DVR location in the producer and read it in the consumer and since the DVR is "safe" in the sense that you don't have to manage access and all operations are still atomic (I think) what you lose is the ability to use non-polling process in the consumer. Now, you'll have to poll the DVR and have some mechanism to determine if the data is fresh. Maybe just include an updated flag in a data structure that includes your array. Then you could operate on the array with an in-place structure and avoid making unnecessary copies.

    Mark

    Since the output of the init array is used for multiple iterations, that buffer can not be re-used because the consumer loop mod of that buffer could goof what get queued up next time.

    I'd expect an "always copy" in the wire after teh init but before the enqueue would let LV transfer the data 'in-place" and eliminate the buffer on the dequeue.

    Just my two cents,

    Ben

  13. Just curious what tools people have found useful for Designing State Diagrams.

    Remember the NI State Diagram Toolkit? I wonder if that will ever make a comeback.

    I found this free online tool which is pretty neat:

    http://www.gliffy.com/

    Last I checked the SDE was available as an add-on. I stopped using it because it turned my code into a white elephant since only my machine had it installed (Yes I know I can right-click disconnect but if I did that on-iste without the SDE, when I got back to the office, I could not "un-disconnect").

    THe Statchart was "supposed to be" the replacement but unless you where already familiar with all of the fancy words used the State Chart Toolkit, there was a steep learning curve. In early version it did not handle the local data (the stuff you would normally put in a SR) and would do buffer copies every time you looked. That would be very un-popular with my customers so I dropped learning that critter. since then I have been told that the data copies isue was fixed but I can not confirm.

    So for now, I draw them up on napkins or whatever and code em up manually.

    Just my two cents. Others taht have a differnet environment may have different opions.

    Ben

  14. Hello everyone,

    Here I am again.

    It a question regarding the property node.

    In the book "LabVIEW Graphical Programming, Fourth Edition " by Gary W. Johnson and Richard Jennigs, it's written that: Each item in the list can be either a read or a write, and execution order is sequential from top to bottom.

    But I implement an example with multiple access to property node, the data flow of course runs parallel to and reachs the property node simultaneously. So for me it seems that the execution order is not sequential from top to down but parallel. (And this is consistent to the underlying principle of Labview, a data flow language.)

    With great respect to the authors, I think I may misunderstand the meaning of the book. Or is it possible that the property node does excute all the accessing parallel?

    Best regards

    When you have a property node re-sized for multiple inputs , yes the required data may arrive at different times but one they are all there, the execution is from top to bottom, unless there is an error...

    Ben

  15. I have a string containing a task name that is serialized to file. I'm currently just casting it back to a task and all's well:

    post-11742-093212100 1277733197_thumb.pn

    But is there a better way to do this?

    Better?

    Just wire the string and let LV do the conversion? Everytime I benchmarked explicit coercion vs implied the implied wins.

    Ben

  16. Yes sure

    post-15713-006500600 1277468252_thumb.gi

    Such as you can see near the byte converter there is a watch.... what does it means? Why did it appar?

    The code is working correctly, I only want to know what that symbol means!

    I am sorry!

    The tickle in the back of my brains says I know the answer but ... ( Ithink it has something to do with CRIOs or FPGA but I will not put money on either).

    But with the image up somebody maybe be able to reply better than I.

    Ben

  17. Hello,

    thank you for your explanation.

    As I initially thought that the "buffer" was "on-board" I had set it's size to twice the data read/written in a loop cycle. My fear was that in the next loop cycle the buffer would be overwritten if it's size was too small.

    I think that is the origin of the problem.

    By setting the buffer to the size of the read data on a loop cycle, and delaying the write start to about half of the loop cycle time seems to solve the problem.

    With a 1 kHz read/write read, a cycle of 1 second and a buffer of 1000 points:

    - i=0. Read 1000 pts (the loop waits until all the data is available)

    - i=1. Write the previous read 1000 pts, wait about 0.5 seconds. Start AO write. Read 1000 pts (will wait about 0.5 more sec. until the data is available).

    - i=2 and next. Write 1000 pts. This operation will wait about 0.5 seconds until the AO buffer is empty. Read 1000 pts. (wait until the data is available).

    With this scheme, the "write" should always have data available.

    I still does not understand why with the increased buffer size the system crashed after a while instead of returning an error!

    Anyway I'm happy that for instance all seems to work as expected!

    Regards.

    I think Mark answered that question in his final line. answer the question "where does the hardware find the next sample to output when it gets to the end of the buffer?" If the next location in memory is not mapped to the hardware...

    crash.

    Ben

  18. I haven't used the scheme you came up with before, but I really like it. The only downside I can see is that without the context help open, you lose visibility. Even then, you'd have to mouse over each VI to check the terminal requirements. If you're just eye-balling a block diagram, especially a big one, that can be a bit unwieldy.

    In the past, I've followed NI's example of Invoke/Property Nodes and added a little red "?!" to the icon if my subVI is going to ignore error.

    post-13461-095246400 1277300099_thumb.pn

    There's no option to ignore incoming error, but obviously you can do whatever you want with your own subVI.

    Rep = rep + 1 for both for asking and answering.

    Thanks for letting me eaves drop,

    Ben

  19. The system crashes with a generic BSOD:

    *** Hardware MalfunctionCall your hardware vendor for support[b]NMI: Parity Check/Memory Parity Error[/b]*** The system has halted ***

    I haven't tried it in another PC yet. I wanted to understand before what was causing the problem: when disabling the Analog Output, it runs smoothly.

    I don't think is a bad memory sector or something like that because the PC is new!

    I continue investigating...

    Parity errors are gnerally a hardware issue. After seeing that error message I am leaning toward a hardware issue.

    You did not reply to my thought. If you are using hardware exteranlly clocked outputs, you have to make sure the data is ther when the clock clicks.

    Still betting hardware.

    Ben

  20. I'm not seeing anything obvious in the VI that you attached. You should stop the task before clearing it, though that's not causing your problem.

    I'd recommend eliminating as much as you can and then adding it back in one piece at a time if you are certain it's your program.

    You don't say what the message is when you get a system crash. Memory usage shouldn't cause XP to crash as XP will hard-kill any task that is taking 2 GB or more.

    Does your program have the same behavior on a different PC? Could you be running into, say, a bad memory sector?

    Tim

    It has been a while but ... Try cranking up the size of your output buffer to make sure there is enough data in it to fill any delays due to the OS going off into la-la-land.

    Ben

×
×
  • Create New...

Important Information

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