-
Posts
5,039 -
Joined
-
Days Won
313
Content Type
Profiles
Forums
Downloads
Gallery
Everything posted by ShaunR
-
QUOTE (Mark Yedinak @ Apr 21 2009, 12:45 AM) Done. QUOTE (Mark Yedinak @ Apr 21 2009, 12:45 AM) Creating parallel tasks in C or C++ is not a trivial task. You have to manually create your processes and threads. In LabVIEW this is all done for you. Drop two loops next to each other and you have parallel code. It is as simple as that. I will concede Labview "parallelism" but I I think we are talking about concurrency and I would wholeheartedly agree that labview runs concurrent tasks but not parallel code. But it's not an area I'm an expert in and perhaps I'm being too pedantic (I don't really care how it works as long as it does...lol). You are right though multithreading in C++ is not trivial. It is in Delphi though QUOTE (Mark Yedinak @ Apr 21 2009, 12:45 AM) No, queues are event driven. While waiting on a queue (or a notifier) your code does nothing. It is waiting for an event to trigger indicating that either an element has been queued or you have a timeout. Event driven means that your code is doing nothing until some event occurs. The code will effectively be using zero CPU cycles. (LabVIEW's scheduler will consume a few CPU cycles but the higher level code in your application will do nothing.) Notifiers are nothing more than a queue of size one. A notifier can only have one element "queued" at a time. Queues simply allow more elements to be placed on the stack. Event structures and VISA events are just different event types. Regardless, when using queues or notifiers you are writing event driven code. As for your disembodied code I suggest you try http://Network-Queue-t11048.html&p=46805' rel='nofollow' target="_blank">network based queues. Since you already use notifiers it shouldn't be too difficult for you to use queues. I see events rather differently. Events (to me) are analogous to interrupts. Events can occur in any order and at any time and, on invocation, handler code is executed. A queue in Labview, however, does not generate events rather (from what you have described) you are taking the presence of data to mean that an event has occurred. You don't know what event has occurred until you have popped the element and decoded it The order is fixed (the position in the queue) and presumably, while this is happening, no other "events" can be processed so they cannot occur at any time (well perhaps they can occur at any time, but not be acted upon). The major difference between notifiers and queues is that notifiers can occur in any order and at any time and the "handler" (the section of code waiting) will be invoked. I would be interested to see how you handle priorities with a queue. Lets say (for example) Event 1 must always be executed straight away (user presses Emergency Stop) but event 2 can wait (acquisition data available. And just to be annoying, lets say processing the acquisition data takes 10 minutes and you've got 100 of them in the queue when the e-stop comes in ;P ). In an event driven environment, when Event 1 comes in its handler can check if the Event 2 is running and stop/pause it or postpone it (cut power and gracefully shut down acquisition).
-
Not wisihing to hijack this thread (perhapse start a new one? This could go on a while...lol)....but! QUOTE (Mark Yedinak @ Apr 20 2009, 11:20 PM) Well. It was a while ago (I weened on version 2.0...it came on floppies...lol). But I seem to remember creating monolithic executables. Deployment was a doddle QUOTE Since LabVIEW is inherently parallel in nature you always need some mechanism to pass data between parallel tasks and to synchronize them as well. Queues naturally do this. Unlike a global variable queues provide synchronization as well. In addition they are event drvien so you can avoid polling local or LV2 style globals. They are also very efficient with respect to performance. Actually Labview is inherently serial in nature (left to right). That is why you have to resort to other techniques to manage parallelism. I also fail to see how they are event driven given that you put something in the queue and take things out...nothing more. It is a serial buffer with access to only the first and/or last entry in the buffer. I don't tend to use queues much, but I do extensively use notifiers for passing data and synchronising, which aren't really event driven either in so much you can wait for a notifier and it will get triggered. The only truely event driven features in Labview are the Event Structure and VISA Event. But linking events programmatically accross disembodied vi's (which I use far too often); I've always found troublesome.
-
Am I right in thinking you would still have to have all the "NI stuff" anyway? (i.e the run-time engine). Oh for the days of standalone executables ! And what is this obsession with queues on this site?
-
Looking for ethernet 16AI DAQ solution
ShaunR replied to hfettig's topic in Remote Control, Monitoring and the Internet
QUOTE Sure there is. Current Loop -
Hi Peeps. I thought I'd put this out into the wild before completion because I'm not going to get around to it again for another few months and as I've not seen anything else around; thought it might be useful. It's a partial implementation of the OBEX protocol with an example of the OBEX Object Push Profile over bluetooth for sending files to mobile devices (vards,vcalendars, images,music etc). Load up the BT Push File.vi (top directory) and set the address and you should be good to go to send files to your mobile phone. The example has been tested on both the Microsoft and Widcomm stack to send files to samsung (U600, i8510) and nokia (N95,N81) phones without any problems, but (as with any new software) I am expecting a few teething problems so let me know and (no promises) I'll see what I can do. If you are using the Widcomm stack. I would suggest pairing first because Widomm requires authentication and the authentication manager takes quite a while to pair so you will time out. The Microsoft stack doesn't require authentication first so need to pair at all. Download File:post-15232-1240155321.zip
-
Changing control typedef at runtime
ShaunR replied to jabson's topic in Application Design & Architecture
OK. I understand. I would be very tempted to just make your display a 2D array of strings (first column can be a label if you want). Then regardless of what data it is you can just format it in whatever manner you think is fit and append it. If it doesn't exist it will just appear as a blank (or you can insert N/A or whatever). If you hide the fact that it is an array, it will just look like a multi-line label. If you add more fields later, just make more elements visible. if you redefine fields , just change the labels (if you have any). The question I haven't asked properly is this. Is your problem just a method to display the info, or is it some intermediate stage that the data in your fields will be processed later? -
QUOTE (Val Brown @ Apr 17 2009, 04:44 PM) Because our IT is analy retentive.If I connect it to "THEIR" network then they have to have ownership which means the following: 1. Cannot take the lid off to install cards. Have to send a support request to get the card installed which may be in 2-3 days time if I'm lucky. If found "tamperig with company property"....written warning 2. No administrator priveleges. If software needs to be installed...Yup..you guessed it..Support ticket...2-3 days. 3. Must have a defacto desktop/laptop PC with all the their crap and must use XP even if the customer wants Vista. 4. The licence would have to be in one of their names (as you know...NI only supply support to the name on the license) so they can provide me with support <img> which means that yet again I would have to send a support ticket to get them to phone NI to asks a question which they know didly squat about. I will just point out though that I do have number 3 also. They decided that a dual core (not even core2) 1.6 GHz Toshba laptop with 512MB ram and a 20 Gig hard-drive is an adequate Labview development platform. It takes 20 minutes to boot in the morning if connected to the network because of their policies. Because of that, I run Labview, labwindows, test stand and all the toolkits on an industrial PC on it's own network where I can do what needs to be done. When it needs to be done. We actually rate our IT department as a project risk. The less involvement...the better. So. It is a real pain but the alternative is worse!
-
Any Active Computer/Embedded Design Forums?
ShaunR replied to Justin Reina's topic in Site Feedback & Support
Chatty embedded engineers? That's an oxymoron isn't it? -
Diogenes of Sinope. Because we are all a bunch of cynics and perceived as criminals by text programmers.
-
Changing control typedef at runtime
ShaunR replied to jabson's topic in Application Design & Architecture
Everyone will have their own methods and solutions to this one. It's an old problem with many equally correct solutions. If you give an example stream and header structure we would probably be able to justify each approach better and you could pick the solution that best fits your preferences. I find, generally, the best option, if possible, is to find the super set of the protocols and choose a display method that can cope with all of them. what do I mean by this...Well... Lets say your devices both send a header consisting of a command byte, a length byte and the payload (nice and simple). In device 1 the length byte is 2bytes long but in device 2 it is 4 bytes long. The length byte of both devices can be represented as a 32 bit number so you would choose that to display the length. Just in case the hardware engineers decide to use a bigger length in the future you could even go for 64 bit integer. Now. slightly different (but following the same approach). Lets say we want to represent the command byte with human readable strings. We could use a menu ring (since arbitrary and non consecutive values can be assigned to its strings). We could then assign each string with the value directly from the command byte - job done for device 1. Now there are two ways of coping with device 2 depending on how much similarity there is. 1. If most of command bytes are exactly the same and the extra ones are just extensions to the original protocol (device 1, MkII) then we have already done most of the work and we only need to add the extra values to the menu ring. 2. If the command byte of device 2 use the same values as device 1 but mean completely different things (usually different devices) then add...say 100 to the command byte and assign the menu ring strings for that device command byte +100. So. 2 devices, 2 different headers and we display a menu ring and a U64. If they add more commands...we just add to our menu ring. If they change the number of bytes (up to 8 anyway), we don't need to change anything. You can extend this for the payload too (up to a point ) -
Perhaps the mods can re-title this for me then. OBEX FTP, Looking for a FREE protocol spec.
-
Nope. It's not online.
-
shift register in sequence structure
ShaunR replied to psychomanu's topic in Development Environment (IDE)
QUOTE (crelf @ Apr 17 2009, 06:16 AM) The same people who pay you for the time you spend posting on this forum -
Oh. And just remembered! there's a login example in the examples directory :;
-
shift register in sequence structure
ShaunR replied to psychomanu's topic in Development Environment (IDE)
QUOTE (crelf @ Apr 6 2009, 09:05 PM) Go on then Here's a more up to date conundrum in a similar vein (everyone says sequence structure are bad...but everyone uses them...even NI) Of the following two methods to build a vi global. Which is better? http://lavag.org/old_files/monthly_04_2009/post-15232-1239919373.jpg' target="_blank"> -
And when I post the result in the code repository, I'll remember to charge you if you download it!
-
Hmm. Not sure about getting screwed (it's not that expensive) but I have complained many times - every time I upgrade in fact. That said, I'm not talking about the Serial Key (I've got one of those that covers everything) I'm talking about the activation codes since the development PC isn't connected to the internet I have to phone up NI and (always seems to be a girl called Sam.....lol) they look my details up and maybe a day later 25 e-mails come through with the activation codes which I then have to get to the other machine. Real pain in the proverbial 2-3 times a year especially if they miss hear the computer ID or I haven't upgraded all the items!
-
Can anyone give me a link to OBEX FTP protocol spec or a list/description of the headers (like the OPP 0x02 for put). I've been looking high and low and can only find API references.
-
this will help with the IP address: IP And try this: Name
