Jump to content

jpdrolet

Members
  • Posts

    367
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by jpdrolet

  1. I think that the attached VI is still a better implementation, getting the name as the port is known in the OS using the Interface Description property. The property node reports strings like "ASRL19 (COM17 - EdgePort [i40300200-0] Serial Port - 1)" (from a USB serial device) where one can scan for the real port name COM17 instead of COM19. It also lists the ports shared by other computers using VISA Server.

    Edit: I disconnected typedefs and included Convert to VISA Rsrc.vi

    Download File:post-447-1148580610.vi

    Download File:post-447-1148580635.vi

  2. Hallo everybody,

    As it's monday I'm back to work and I can send you the VI with the data I use to load. I dysplayed in the front pannel the result of division, x*y and x+y and the only problem comes from the division, I wish someone can understand the problem,

    Thank you very much

    pesce

    That VI works. You should have posted the VI with the formula node that doesn't work. Please help us to help you.

  3. Waiting for the solution

    :laugh: :laugh: :laugh:

    In the mean time you could read LabVIEW help on arrays, For Loops, auto-indexing and related examples. :book:

    You want to learn LabVIEW don't you?

    Or use your math skills to factor these summations into a squared double summation?

  4. No, neither the warning text. I think it wouldn't be difficult, but would add more properties and my aim was a code as simple as could be ;-).

    Saludos,

    Aitor

    Now I just add a Run VI method as the last node and I hit the Run Arro(&(*&!@HJ(*&47_)(* :( --- DISCONNECTED

  5. I use a strict typedef cluster (call it StorageTypeDef) to define the structure of the data written to a binary file.

    The nice thing here is that if I want to change the format of the data, I just modify the cluster typedef StorageTypeDef, and all referencing vi's gets updated. Unfortunate one of the elements is a string. This has a varying length and thus the size of the cluster changes.

    I deal with this by limiting the string size to a maximum. This maximum value is a constant which I would like to be coded into the cluster type def.

    So at all times, my cluster typedef contains ALL the information necessary to encode and decode the cluster from binary image. In this way I have concentrated my information at one location, and management is simpler.

    Problem is however to make this constant number a value in the cluster typedef.

    Its simple to add a variable, call it MAX_STRING_LENGTH in the StorageTypeDef cluster and give it a default value.

    Problem with this soultion is that if I change the typedef's MAX_STRING_LENGTH default value at a later stage, this information does NOT get propagated to the VI's instantiating the cluster.

    Neither does it work to apply Right click->Data operations->Reiniz to default value at the callers.

    Inserting a new instance of the contol StorageTypeDef works, in the sense that it grabs the latest (correct)default value from the tyoedef, but it requires rewirering in all user-vi's.

    Replace of the control does unfortunately not propagate default values from the typedef.

    Any ideas how to pack this constant information into a strict typedef cluster?

    /henning

    Instances of a typedef are not perfect clones of the typedef. The instance can have a different label, description and default values. Default values is a data related, not type related and in the majority of cases, it is a very good thing (if not mandatory) that default values are not updated with the typedef.

    If I recall correctly, there is a trick you can use to force the default values to propagate: change the numeric to a string, apply changes, change back the string to a numeric, change the default value, apply changes. Then the default values are propagated with the type change. I'm not 100% sure it works but have no time to test it now.

  6. After some more research, it seems that you *can* have multiple levels of folders with subVIs all over the place - the problem is that the links between VIs and their subVIs is absolute, not relative. So what's the problem you ask? This screws everything up if you create an installer and bundle your plugins and their subVIs with it (thus moving the VIs from their original locations) - even if you preserve the relative struture, any dynamically called VIs will not be able to find any of it's subVIs unless they are in the same directory as the caller. Please please please - does anyone know how to force the links between a VI and its' subVI to be relative (am I going to need to hack the VI's binary here? :ninja: )

    But they actually are relative. If they were absolute, you wouldn't be able to move a project directory without breaking all links to subVIs.

    How did you come to the conclusion they were absolute?

    Edit: unless there is a major change of behavior in LV8...

  7. LabVIEW knows where vi.lib, user.lib and instr.lib are located but the executable does not. It expects these folders to be in its own application folder. A VI that opens fine in LabVIEW will be broken in your application when subVIs are located in these special folders. They are special in the sense that the path of subVIs located there are stored as symbolic path ( e.g. <userlib>\path\to\sub.vi ) so subVIs are found wherever these libs are located in a particular installation. Other subVIs paths are stored in the caller as relative paths so any changes in relative paths to subVIs will also break the VI. When the VI is opened in an application, all subVIs must be at the symbolic/relative path they are expected or the VI is broken.

    That's why saving for application distribution solves the path problems, saving the whole hierarchy at the same place and relinking VIs to the new location.

    Since the process might duplicate subVIs (both in application and plugin llb) now when the application opens the plugin VI where the subVIs be loaded from?

    First the memory is looked for a VI with the same name. If not found there the internal LLB of the apllication is searched for a VI with the same name. If found there the actual path of the subVIs is ignored and the internal VI has the precedence to be opened. If not found in the internal LLB, the subVIs is looked at the stored relative/symbolic path. Finally, when the subVI is not found, the search paths specified in the search path list (in the options) are searched (the seaurch path can be stored in the app ini file)

    Indeed in my first post I didn't mean that the plugin VI to be distributed with the application and its installer but just dropped in a folder where the application will look for plugins.

  8. I use the plug-in architecture with executables and it works as expected. It is important that the whole hierachy of the VI be accessible and that the executable installer has correctly installed the required resources (serial, math lib, etc.) I usually do that by Save with option>Application distribution. It saves a lot a VIs that may already be in the app.exe but it is harmless.

    If you can give more details on how you proceed maybe we might find the source of the problem... :)

  9. Sorry about the lack of picture. I didn't really try to post a screen shot at first.

    post-3022-1145566289.png?width=400

    GL

    Is there a really easy way to get a picture of the block diagram from within labview? something easier than printing to HTML, that is...

    Look at this NI Forum thread. There is a tool to save a picture of the diagram and copy its path to the clipboard, ready to paste in the File Attachment field. Check also for the hack needed to make it work in LV8. :thumbup:

    In the VI you could expand Replace Array Subset to two inputs instead of using two nodes.

  10. If you randomly select only one of the two elements, everything will be fine.

    1. Select first element with the loop counter

    2. Select second element randomly

    3. Swap them.

    Works with no extra buffer allocation!

    Download File:post-3022-1145556103.vi

    I would think that this is equivalent to the "cluster shuffle", but I don't really want to try and prove it...

    Guillaume Lessard

    P.S. this tends to be the algorithm you find upon googling "array shuffle"...

    I think that this shuffling is biased. There is a random number generation between 0 and N-1 but because of rounding the elements 0 and N-1 have half the probability to be picked than other numbers. It should be a random number between 0 and N then floored to integer. The index N won't be picked because the random number function is always lower than 1.0

    Edit: it is based on the picture posted, I can't see Guillaume Leassard's VI since it is in 8.0

  11. That because using a quasi-random method to select which ones are going to be moved means that some won't be moved at all, some will be moved once, others will be moved twice, etc... I wouldn't call this a "margin of error" - just because a number remains in its' original location doesn't mean that it's an error at all. It's more of a ratio of the quasi-random nature of the process relative to a true random process, which by its' very nature doesn't exist, and you can't test for it anyway :D

    That said, I like the "cluster random" method of assigning a quasi-random number with each of those in your sample set - at least this means that the position of your samples has less (sort of) effect on where they'll end up - I think this is probably as good as you'll get.

    Well if I measure the Cosmic Background Radiation and shuflle that with the particle count/s of a radioactive substance and XOR with alfa's posts, I'll get data with no discernable pattern for sure... :laugh:

  12. very interesting thought!

    So if we drank enough beer fast enough could we abosrb so much light that it no longer reflects and we just appear to be a shadow or a type of "walking black hole"?

    There may be some truth in this. From my personal observations, it appears that the enlightenment derived from a conversation seems to be inversely proportional to the amount of BEER consumed. Another is that bars (in the US) are generally rather dark and get darker as the night goes on. I had thought this was due to a lack of lighting sources, and never stoped to concider that the light may be getting consumed. ;)

    Ben

    Strangely the effect is much less pronounced when the subject drinks light beer...

    The "walking black hole" is only observed by the drinker after he reaches "extinction". The subject has no recollection of the events past the event horizon that occurs on extinction. Observer from outside can only see a collapsed inert mass.

  13. I am trying to send some streaming data from my Microcontroller to LabVIEW (through Serial port) and draw a waveform graph. In this case a send a string from A-Z and so on. It works (even though i have to make sure the LV run first and then the uC, this is to avoid wrong frame reading) . But a strange thing happen when i disconnect the uC. The VI still reading (from A to Z as normal). I try to stop and run it again but it still reading (and so does the graph). I close the VI and open it again, oh no, still running like hell :blink: . The whole thing only stop only after i open Hyperterminal or Basic_read_and_write.vi and read something. By the way, this problem does not occur on Hyperteminal or other reading application. What was happen with my program?

    As you can see below, i tried to use whileloop to do this, is this the right structure?. And how can i get rid of the wrong frame reading problem. I am thinking of sending some command from LV to uC to have it start sending data. How can i do it. Thank you alot for any helping. :headbang:

    In your VI you read only 10 bytes/s. My bet is that the uC sends data at much higher rate and fills the input buffer that the VI continues to read even when the uC is disconnected. When you swap to HT the serial port is reinitialized and the input buffer flushed.

    As for the framing problem, indeed it is the solution that the uC sends data only after a command or that to use some HW handshaking.

  14. I would highly recommend not using LabVIEW's support for SCC API. It is a real pain to use, since it assumes a single repository per LabVIEW installation. Unfortunately, this only reflects reality for the LabVIEW R&D team at NI :P . For those of us on the outside, we typically have different repositories for each project, not to mention the possibility of different repository types (CVS, SVN, ClearCase, VSS) for each project.

    I don't know about 8.0 but in previous versions you indeed can have different SCC settings per project, provided you set a different default(home) directory for each project. The file scccfg.ini is stored in the default directory which defaults to LabVIEW directory.

    Having distinct project default directories is conveniently done using a labview.ini file per project and start LabVIEW for a given project using a shortcut with the -pref switch setting the ini file.

    Personally I use custom file extensions to LabVIEW pref files ( *.lv7ini, *.lv71ini) so I can start a project with the right pref file and LabVIEW version with a double-click on the pref file.

  15. I have to admit that my first reaction when reading this post was, shit this can't be! But above mentioned statement about deleting any posts about deficiencies in LabVIEW 8 made me lough and check for the date of the post :)

    Still I think it is quite a good April fools joke and without that statement about deficiencies I could have probably went through the entire post and still believed it at the end.

    Sounds like you still have the blue eagle tatooed on your chest, Rolf... ;) :laugh: or for sure the yellow adder.

  16. Which 3D are we talking about here?

    3D picture controls or graphs allow to display a and rotate objects as 3D objects projections but it is not 3D stereo vision where you need some way to send two different images one to each eye.

    In the former case we see a flat image and the brain figures depth from perspectives and relative sizes. You see the same thing even with poor eyesight on one eye.

    In the latter case the brain receives two images and then it can figure depth with its hardwired ability to integrate these two images into a 3D representation.

  17. Hi all,

    I connected two windows 2000 computers via a crossover cable, they can see each other fine in windows explorer with the netbios over tcp protocol. Now if I run the "simple data client/server" examples then sometimes the response is instant, sometimes it takes 10 to 15 seconds before the client does anything (I set the timeout to infinite). If anyone has seen this kind of behavior before then it would be great to hear an explanation.

    Oh yeah, I'm using Labview 7.1.1.

    Cheers,

    Ralf

    It might be a DNS lookup issue. Try to set

    DNSLookupEnabled= FALSE

    in the LabVIEW.ini file

  18. It is easy to travel thru time, here is a quote of a message I'll write later:

    This is a quoted message

    Note to self: Do not forget to post the above message to prevent a time paradox and the destruction of the Universe.

×
×
  • Create New...

Important Information

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