Jump to content

bbean

Members
  • Posts

    258
  • Joined

  • Last visited

  • Days Won

    10

Posts posted by bbean

  1. I have an instrument class that uses serial comm to talk to a single instrument. Lets call it Instr. I created another class that has multiple instances of Instr. Lets call it Group. Each of the methods in Instr is duplicated in Group. I need to execute the methods for each Instr in the Group at roughly the same time in parallel.

    Currently all the methods of instument are re-entrant (preallocate) and also some of the subvis like "serial packet send receive.vi", "wait for operation complete.vi",etc . The problem I'm seeing now is that there are hundreds of "serial packet send receive.vi" instances and lots of instances of the method vis.

    None of the reentrant VIs maintain state so I'm going to try to switch to shared reentrancy and see if there are any improvements. But I was wondering, does shared reentrancy create a "pool" of instances where it only opens up as many as are needed for parallel execution at one point in time or does an instance get allocated every time the VI is executed.

    For instance, say in my Instr class i have a method called "eject" (set as reentrant shared) and in the Group "eject" method the vi executes 8 instrument "ejects" in parallel. If i also call the Group "eject" in multiple places is:

    # of Inst "eject" instances = 8

    or

    # of Inst "eject" instances = n x Group "eject"s x 8

    Is there a better way to do this. I really only need one "serial packet send receive.vi" per Instr since all communication is executed serially. One thought I had was to open a reference to the "serial packet send receive.vi" and store the reference in the class, then just call this referenced VI every time. The other thought i had would be to move all of the method executions into the process vi for the class.

    thanks for any help.

  2. People have been going through the code found in the hacked files and have found numerous examples of "tricks" to manipulate the data. Granted the people looking over the files are climate change "deniers" but if you look at the examples they present from a programming standpoint something smells fishy.

    http://www.americant...mategate_r.html

    Example 2

    In two other programs, briffa_Sep98_d.pro and briffa_Sep98_e.pro, the "correction" is bolder by far. The programmer (Keith Briffa?) entitled the "adjustment" routine “Apply a VERY ARTIFICAL correction for decline!!” And he or she wasn't kidding. Now IDL is not a native language of mine, but its syntax is similar enough to others I'm familiar with, so please bear with me while I get a tad techie on you. Here's the "fudge factor" (notice the brash SOB actually called it that in his REM statement):

    yrloc=[1400,findgen(19)*5.+1904]

    valadj=[0.,0.,0.,0.,0.,-0.1,-0.25,-0.3,0.,-0.1,0.3,0.8,1.2,1.7,2.5,2.6,2.6,2.6,2.6,2.6]*0.75 ; fudge factor

    These two lines of code establish a twenty-element array (yrloc) comprising the year 1400 (base year, but not sure why needed here) and nineteen years between 1904 and 1994 in half-decade increments. Then the corresponding "fudge factor" (from the valadj matrix) is applied to each interval. As you can see, not only are temperatures biased to the upside later in the century (though certainly prior to 1960), but a few mid-century intervals are being biased slightly lower. That, coupled with the post-1930 restatement we encountered earlier, would imply that in addition to an embarrassing false decline experienced with their MXD after 1960 (or earlier), CRU's "divergence problem" also includes a minor false incline after 1930. And the former apparently wasn't a particularly well-guarded secret, although the actual adjustment period remained buried beneath the surface.

    Plotting programs such as data4alps.pro print this reminder to the user prior to rendering the chart:

    IMPORTANT NOTE:
    The data after 1960 should not be used. The tree-ring density records tend to show a decline after 1960 relative to the summer temperature in many high-latitude locations. In this data set this "decline" has been artificially removed in an ad-hoc way, and this means that data after 1960 no longer represent tree-ring density variations, but have been modified to look more like the observed temperatures.

    Others, such as mxdgrid2ascii.pro, issue this warning:

    NOTE
    : recent decline in tree-ring density has been ARTIFICIALLY REMOVED to facilitate calibration. THEREFORE, post-1960 values will be much closer to observed temperatures then (sic) they should be which will incorrectly imply the reconstruction is more skilful than it actually is. See Osborn et al. (2004).
    • Like 1
  3. QUOTE (postformac @ Apr 7 2009, 06:28 PM)

    For example if I want to write a hex number 0x05 (which would be interpreted in ASCII as an ENQ) it gets sent out as ASCII "5" (ie. 35 in hex). My hardware is looking for a hex value of 0x05 to come in the serial port which it then never gets (as obviously it receives 0x35 instead). Is there any way to get my LV serial write to just write a specific byte without applying the ASCII conversion?

    Thanks

    Right click on the string constant you are using and select "display as hex" then type 05. If you are using "scan from string" do the same thing on the format string.

  4. QUOTE (Neville D @ Aug 6 2008, 06:50 PM)

    Interesting. Thanks for the tip. I wonder what the command line uses. I guess I could check it out with wireshark. I'm getting a little over 300ms but thats much better than before and acceptable for a user interface.

    QUOTE (Phillip Brooks @ Aug 7 2008, 08:21 AM)

    Here is an example of what I use. I wanted to be able to test the ability to connect to the FTP server independent of LabVIEW, so I created a wrapper for the function "FTP Put Multiple Files and Buffers.vi"
    that parses an RFC-1738 FTP URL.

    I can check for access to the server using the exact same string from IE or FireFox. If it doesn't work from those, then I might have a firewall or proxy problem.

    (
    LV
    7.0)

    Interesting. I shouldn't have any security issues because its just a local machine going to cRIO. I'll check out your example. Thanks for the link

  5. Hi all is there a way to get a quick directory listing from an ftp path. Tried the FTP VIs in the Internet toolkit and it took around 2 - 3 seconds to return a directory. That seems a little slow.

    Using the windows command line, I can speed it up a bit (see attached LV8.5 example), but that is kind of a cheezy/non Native LabVIEW way to do it. Was wondering if there was a way with Datasocket or something else I'm missing.

    B

  6. I found the design pattern for a LV RT Local Machine on the website that looks promising (although its a b@#$h to get set up because they don't provide all the links / dependencies on one page). Part of the design pattern uses a Current Value Table (CVT) that facilitates storing, tagging and passing different type data points between the RT target and the host. Essentially you set up all your variables for the application with another NI tool called the Tag Configuration Editor (TCE) and save them to a .tcf file. The RT Target and Host read this file to set everything up. The attached CVT Double shows how the data is stored for single point double tags.

    However, the TCE currently doesn't look like it has support for arrays of each data type. Under the hood in the LabVIEW code the Tag Configuration cluster has a flag for array and an array size integer, but tagged arrays aren't implemented anywhere else.

    So... I was going to create an current value table for arrays of data. I would like to keep the CVT for arrays generic so that I can store all tags that have an array data type in one shift register (even if they are different sized arrays). I thought of using a shift register with an array of variants. Each variant in the array would hold an array of say doubles as shown in the attached method 1. The thing I'm worried about is memory allocation in RT on the "read" since the Variant to array conversion won't be able to use the replace array and have a preallocated array size. :wacko:

    So the only thing I can think of is to use method 3 and build a specific shift LV2 style VI for EACH tag that has an array data type. This does not seem very flexible though. I would prefer to use Method 2. Any suggestions?

  7. QUOTE (Yen @ Jun 19 2008, 02:38 PM)

    Thanks for the link. I guess thats what I was wondering, are strings just like arrays in terms of replacing vs building in LV RT. In other words can you preallocate them to a fixed length and then use the replace substring like you said to avoid memory allocation everytime you update.

    QUOTE (neB @ Jun 19 2008, 09:03 AM)

    Thanks for the tips. I'm also looking at this reference app from the ni website for architecture ideas:

    http://zone.ni.com/devzone/cda/epd/p/id/5336#0requirements

  8. QUOTE (Neville D @ Jun 18 2008, 06:26 PM)

    You could use shared variables to write info to a Host PC, and then display any kind of history you want.

    You could also use shared variables to write values to controls on the remote RT application.

    there are a number of such examples on the NI site zone.ni.com.

    Neville.

    I guess I'm lazy and would like to avoid writing a client LV app if we could use a web browser. Don't know if I'm trying to fit a round peg into a square hole, but wanted to get feedback from others. Wouldn't I have some of the same issues with memory/buffer allocations using a shared variable string? I realize they would help with "keeping it real time" because they have a lower priority.

    thanks

  9. QUOTE (neB @ Jun 18 2008, 04:04 PM)

    I and my customers have been burned by strings in RT apps running of FP units.

    Try to avoid strings completely. If you have code that always returns the same string, concider using an enum to display those strings.

    I have used LV2's set-up as round-robin buffers to do what you are attempting.

    AS you are developing watch your memory usage over extended periods of time. THe run out of memory issue will sneak up on you if you don't.

    Ben

    Thanks Ben. Good to know about your experience with strings. I'm using cRIO. Not sure if that makes a difference one way or another.

    What has your experience been with Remote Front Panels (RFPs)?

    I guess I'm trying to avoid making a custom client application to communicate with the cRIO app. I'd like to keep the architecture simple if possible. And since RFPs handle all the dirty work of connection management and display, I thought it be easiest to use them. But the event log (and data log) presents a memory / keeping it Real...Time issue.

    I guess another option would be to do a LV client app with a RFP on the front panel of the diagram for the user to change setpoints/monitor current analog values and additional charts, graphs, strings to display RT unfriendly data. These indicators would then be populated, by reading the log / data files on the cRIO filesystem via FTP.

  10. I have to provide a list of events that have occurred during execution of my run-time application to the user. The user will access the RT app via Remote Front Panels. The events are described by a timestamp and a string. And don't occur that frequently (once a minute) For example:

    10:30:04 - TEMP ALARM - ZONE 1 - TEMPC = 30

    10:31:04 - POSITION MOVE - 33 mm

    etc

    etc

    I'm trying to determine the best method to store and display the data in LV RT. Here are the options I've thought of:

    Datatype / Storage Method / Display Method

    1) string / FIFO string buffer of 100 lines LV2 global / string indicator on FP (limited to 100 lines) (I know there really isn't a front panel in LV RT)

    2) Cluster of timestamp & string / 100 element queue / array of datatype on front panel

    3) string / event file / string indicator on FP (limited to 100 lines)

    If I use 1 and (a string indicator), I'm worried about it sucking up CPU resources and memory to limit the size of the string to 100 lines.

    For option 3, I thought I would read the last 100 lines into the string indicator on the FP everytime a new event occurred (it has to be written to the file anyway).

    Any suggestions?

  11. QUOTE (achates @ Jun 17 2008, 06:16 AM)

    As per your suggestions, I am reattaching the code. In the code, the samples are being compressed with the last sample being written to the file. My question ultimately boils down to ' how can we write dynamic data values after compression along with the date and time at which each was sampled in the same xl file'?

    here's one way to do it.

  12. QUOTE(Aristos Queue @ Dec 12 2007, 12:51 PM)

    An element is an independent item and gets copied out of the array. If the output of the first Index Array was an array data type, we could have a subarray of a single element, but it isn't an array output -- it is an element.

    Thanks for the description.

    Whats the point of using the waveform datatype (when you have multiple channels) then? If everytime you need to look at the data for an individual channel, a copy of the data is made (even if you are not altering the data). The LabVIEW compiler isn't smart enough to deal with this issue? :thumbdown:

    Does anyone have tricks for using waveform arrays or should I go and convert all my DAQ code to 2D arrays? :throwpc:

  13. Is this happening on the server side? Are there any LabVIEW applications on the server?

    Many Database Servers, MS SQL Server for example, will hog memory up as they go. The memory won't be released by the DB until another application requests it. I believe they do this so they can store queries and frequently executed statements in memory for faster exection. Check to see if the Oracle DB has some way of limiting the maximum amount of memory it uses.

    Regards

×
×
  • Create New...

Important Information

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