-
Posts
4,881 -
Joined
-
Days Won
296
Content Type
Profiles
Forums
Downloads
Gallery
Everything posted by ShaunR
-
Producer/consumer and processing loads
ShaunR replied to Gary Rubin's topic in Application Design & Architecture
So does it work better now? -
Producer/consumer and processing loads
ShaunR replied to Gary Rubin's topic in Application Design & Architecture
Only if set to clone! Oh. And if Labview decided to do a context switch because its run out of threads in that execution system The downside is all the dataspace allocated for each clone. You've bought it? No printer then ...lol. -
Producer/consumer and processing loads
ShaunR replied to Gary Rubin's topic in Application Design & Architecture
Not at all. Marking a vi as re-entrant means that a full copy of the "executing" code is instantiated in the calling process. This is for both types of re-entrant vi ("clone" and "same copy"). Since copies of the code exisit in the calling processes address space they can be run in parallel. The difference between "clone" and "same copy" is the datapsace. A re-entrant vi marked a "clone" has its own dataspace for every instance you lay down in a diagram. If marked as "same" then all the instancies have only 1 dataspace shared between them. In the case of a LV2 global. If you mark it as "clone" then if you call it from one location it will not contain the same data as if you call it from another, therefore it will only function as required when marked as "Same". However, in doing this you may cross execution system (ES) boundaries if the calling vis are in separate ones (if it is set to "same as caller") or you give it its own ES. And crossing an ES WILL cause a context switch. By the way, this is all a bit moot if it doesn't resolve you problem -
Producer/consumer and processing loads
ShaunR replied to Gary Rubin's topic in Application Design & Architecture
Have a read of this.... http://books.google....itching&f=false In particular 9.2.3 and (replace the word "Process" with "Execution System") and ask me again. -
Producer/consumer and processing loads
ShaunR replied to Gary Rubin's topic in Application Design & Architecture
Its not so much waiting for it to become available, it more to do with the CPU having to save state information between switching from the global in one context or another. Have a Google for "context switch" its a big subject. But suffice to say, the least, the better. With what I have described above, you will never lose data. But the downside of that is that if vi B is producing faster than you are consuming then your queues will grow until you run out of memory. If this is a possibility (and undesirable) then all you need to do is "pause" vi B populating one or both of the queues when the queues are full (fixed length queues) and resume when A or B have caught up. Or (as you rightly say) use a lossy queue. The choice is really if you require sequential losses or random losses. But he above will enable you to easily change how you manage your processes with minimum effort and run most effeciently. -
Producer/consumer and processing loads
ShaunR replied to Gary Rubin's topic in Application Design & Architecture
What execution system is the LV2 global assigned to (same as caller???). There's probably a lot of context switching going on since you cannot encapsulate the global in a single execution system. You basically have a one to many architecture and I would partition it slightly different to take advantage of the execution systems. 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 ALL of the data into Named Queue 1 and Named Queue 2. VI C runs in a continuous loop, flushes Named Queue 1, Extracts the bits it needs, then and transmits the contents via TCP/IP on physical port 2. VI A reads the data from Named Queue 2,Extracts the bits it needs, processes it, then flushes Named Queue 2 and transmits the contents via TCP/IP on physical port 1. VI B would run in (say) "Data Aquisition" at "High" Priority. VI C would run in (say) "Other 1" at "Above Normal" priority. VI A would run in (say) "Other 2" at" Normal" Priority. This way you can give your vis hierarchical priorities to determine their reposivenes under loading. You could also get vi B to extract the bits and only put what is required for A and C on the queues (therefore simplifying A and C and reducing memory requirements at the expense of speed) if it has a light loading (if you want). The way described just makes vi B simple and very fast and context switching won't be an issue. -
Multiple protocols and interfaces
ShaunR replied to jcz's topic in Application Design & Architecture
I my bluetooth stuff somewhere on this site, I address multiple transport layers. It'd be worth taking a look to see how its implemented but basically it makes the interface (TCPIP, UDP, IRDA, Buetooth in the example) transparent to the protocol. Might be a way forward for you to simplify your low level stuff. -
Multiple protocols and interfaces
ShaunR replied to jcz's topic in Application Design & Architecture
Are you describing a single device on multiple interfaces an protocols (e.g a dvm that has gpib eternet and rs232 interfaces that you want to test) or is it multiple devices on multiple interfaces such as motors on rs485, dvms on gpib and digitalio on ethernet that are used in conjunction? -
didn't see this thread. Why did you start a new one? I wasn't refering to static VI refs. Indeed. Constants are, well, constant Immutable, unchangeable! If you can change it is not a constant, its a variable. Indeed. Constants are very often used for type information especially with polymorphic vis. I looked at your "confusion" image and it seemed to me to be syntactically identical to: So I didn't think it unusual or erroneous since I use something similar with self initialising functional globals.
-
Probe Watch Window usability issue
ShaunR replied to PJM_labview's topic in Development Environment (IDE)
Woohooo. Next question. When can I download 2009.1.....tomorrow? -
Thats because the number of format specifiers have to be exactly the same as the fields you are trying to extract. From your last example, the last digit is 1. If you are viewing the value in a digital indicator and "hide trailing 0" is set, you will only see the decimal places IF the digits are non-zero. If thats not the reason and you want that to be 1.00 I would suggest using %.2f as the format specifier.
-
Well. There are a few ways. If the message string is always in a fixed order and fixed length and messages are not concatenated, you can use the "Scan From String" which will give you the results straight away in the format you require. If its not, then you can use the "Spreadsheet String To Array" to break up the string at the delimiters then convert to whatever formats you like.
-
When you use the port write, the number you wire represents the bit pattern of individual DOs. So "1" would turn on DO 0 and turn off all others, "2" Turns on DO 1 (all others off) and "3" turns on DO 0 AND 1 etc since 3 (in binary) is 00000011.
-
Do you have the "Database Connectivity Toolkit"? Have you done the following? <h3 id="tocHeadRef">Create a System DSN in Windows</h3> Click Start, point to Control Panel, double-click Administrative Tools, and then double-click Data Sources(ODBC). Click the System DSN tab, and then click Add. Click the database driver that corresponds with the database type to which you are connecting, and then click Finish. Type the data source name. Make sure that you choose a name that you can remember. You will need to use this name later. Click Select. Click the correct database, and then click OK. Click OK, and then click OK. Original Article.
-
Name: Passa Mak Submitter: ShaunR Submitted: 11 Oct 2009 File Updated: 25 Oct 2009 Category: LabVIEW IDE Version: 2.0.0.0 LabVIEW Version: 2009 License Type: Creative Commons Attribution-Noncommercial-Share Alike 3.0 PassaMak is an API for realising multi-lingual user interfaces in labview. Overview: PassaMak is an alternative to the established methods of creating multi-lingual user interfaces that attempts to simplify both their creation and use. It is a wholely Labview native API (with source) that can scan either a directory of files or vis in memory and create language files that (using the same API) can then be used to translate the user interface at run-time. It is a text file (Excel compatible) translation tool, therefore it doesn't require compiling or special proprietry editors to translate. How It Works: The API can scan a directory (or memory) and extracts the label (tags), captions, tip strips and any ancillary text (such as graph axis, plot names etc) of all controls and indicators on the front panels and any string diagram constants that have their captions (or labels for digrams) visible to a number of language files. These files are in a bar "|" delimited spreadsheet format so they can be sent to translation services where they can easily be edited in a text editor or spreadsheet program. Once the language files have been translated, they can be loaded dynamically at run-time to change all the captions and strings in the application on-the-fly. One, easy to use, vi in your application does all this and supports translations for most complex controls/indicators such as clusters, graphs, booleans, ring controls and many more. Installation. Unzip to a directory of your choice. Do not unzip to the vi.lib directory. Dependencies: Labview 9.0 Find Files (Included) Top Level Vi (Included) Tick Count+ (Included) Cut Array Blanks (Included) LabVIEW Versions: Created with LabVIEW 9.0 Limitations. Unicode not supported. Enumerations not supported. Known Issues: None. License: Distributed under Creative Commons Attribution-Non-Commercial-Share Alike See http://creativecommons.org/ for more information Support: If you have any problems with this code or want to suggest features: please go to www.lavag.org and navigate to the discussion page. Distribution: Full source including examples is available at www.lavag.org Contact: PM ShaunR on www.lava.org Revision History. ----------------------- Version 2.0 Added exectable build example. Added support for Tip Strips. Added support for diagram scanning. Fixed bug #PM-00001 in Top Vi's Path.vi preventing correct identifaction of files when built into executable and no path defined. Version 1.0 Initial Release. Click here to download this file
-
Try this http://zone.ni.com/devzone/cda/epd/p/id/3491
-
It is. But it keeps it simple, easy to understand and trivial to migrate to the "proper" way (using stored procs) once a little more experience is gained. PostgreSQL has variable length array datatypes (and then you could use the correct datatype) but MySQL doesn't. These are very, very important considierations.
-
Indeed. But for an introduction to DBs and SQL it will be perfectly adequate and acheive what is required. You gotta open the door before running through it
-
SQL is all string manipulation e.g INSERT INTO TestDB (Fixture, Employee, Serial) VALUES ('No1', 'Brown','12345'). Will insert a new entry and populate the "fields" Fixture, Employee and Serial number with the values No1, Brown and 12345. (See its not that hard ) For the data, I would use a TEXT field (65,536 chars max should be plenty for most apps) and format my array to colon delimited floating point values. This makes it much easier to get back out and much, much easier to debug. e.g INSERT INTO TestDB (RawData) VALUES ('10.123456,3.1212134,12.11223344') If any calculations are to be made on the data (eg mean values, standard deviation, noise, max-min etc) you can iether post process it in the report query (harder) or save it to the DB as a separate field (easy).
-
Problem running under operating systems of different languages
ShaunR replied to bimbone's topic in LabVIEW General
Another little snippet that you may find useful. -
I had to make this dicision a while ago...and never looked back. I set up my own "Test" network which I got IT to link to so that anyone with a browser and login on thier network could view test results and other test information. This is still in use and is incredibaly scaleable. I set up an old PC with a webserver using Xampp. Its a fully functioning webserver including Apache, PHP, CGI, SQL,mail SSL and well, everything. But more importantly it is really easy to install and FREE. About 10 minutes and your up and running. Part of the Xampp installation is an SQL server. I set up a set of "Test" databases (we had 3 product lines at the time so I decided to have a different one for each...personal choice to partition the data better. You could have one or you could have one for each station..its up to you how you set it up). The test stations (18 of them, 6 per line) all pushed thier test data into the various databases using the Labview SQL toolkit. I just made a drop in module for the existing test stations so that instead of writing the results to a file, they wrote it to the database. I then wrote a few webpages (started as two, is now about 80 and quite sophisticated with graphs, process capabilities, searchable queries etc) that queried the databases so that any user could view the results in a web browser. The thing about this setup was that it operated perfectly fine on its own as a standalone system, but once it was up and running, IT really took an interest (especially after the big guns wanted to see the pretty graphs on their laptops in the office ) and they have now taken the responsibility of managing and updating the webserver. From my point of view (and ITs) it creates a defineable partition between the test network and thiers and it is a technology they understand. The big guns loved it because there was no captital cost (well, apart from the SQL) although I did persuade them that they should make a donation.