Jump to content

jgcode

LabVIEW Tools Network
  • Posts

    2,397
  • Joined

  • Last visited

  • Days Won

    66

Posts posted by jgcode

  1. Convert you program into two parts. Application and Scripting engine. Let the application be as exe and this exe will dynamically load scripting engine VI in LabVIEW application Instance using its Port and run the Scripting Engine with Required inputs. This the only way to do if you want to build a scripting based software product.

    Rajkumar

    If this is a route consider, then here is a link to a previous discussion with examples.

    Cheers

    JG

  2. If you look at the Code Capture Tool, you will see that the OpenG VIs are packed inside a support folder where all the files are renamed, this renaming is important and I think this is what Michael means.

    On the other side you see that the Code Capture Tool has a dependencie to the oglib_appcontrol library. This is only valid for the OGP file where I use some VIs from the oglib_appcontrol library in the post-install wizard.

    Ton

    Thanks for the example Ton.

    This is what I want to do, but was unsure of the context of the statement.

    Cheers :beer_mug:

  3. I know writing to ProgramFiles is not allowed in VISTA onwards, but was allowed in 2000/XP (only with admin installation, default user account - which is probably most cases)

    However, does anyone do any "read only" stuff in ProgramFiles?

    The 2009 Config API by default does not write to disk on Close anymore and the Read Text (but not Read Binary) when set with the Read Only permission works in ProgramFiles.

    Alot more application are "portable" these days - being able to run off USB etc.. or moved around in location.

    Does anyone utilize this for read-at-startup-only type configs?

    Or is it considered a big nono?

    Cheers

    JG

  4. Hi Crelf

    Thank you for replying.

    To clarify: I am chasing the definition of the word unpackaged in the context Do not include unpackaged OpenG code in relation to submitting LAVACR Certified code. For a library-type dist, I would definitely do what you are suggesting, but it is for a tool-type dist so I want to know that all the dependencies are definitely included at all times (so my tool will never be broken / and I never had to do any checking on launch aka OGPB APIs). Otherwise it is up the user to have everything correctly installed. I understand your point on server size, but for a small tool-type dist, it will only add a little size for a couple of VIs that I need to include (so server size consideration should not be a big issue in this case, LAVACR rules are).

    I understand if I threw some OpenG subVIs in a zip folder with my src than that would be bad for everyone.

    But I want to know if I create a dist with (e.g. OpenG) dependent VIs all saved in an llb (and namespaced inside) along with my other support subVIs that this will be ok

    I am worried that if it is out of its original package (.vip/ogp) then it is considered unpackaged meaning a llb type dist would not be LAVACR Certified.

    Another example is VIPM internal dependencies' are only included if they are linked in the dist (it is not the whole package) and those files (can) get renamed with the namespace as well, and stored in a llb. So that must be covered under the packages license to do this? Would this type of dist be LAVACR certified?

    On a side note I must say thanks, as I came across a post of yours a while back that suggested to include a .vipc file list (no physical packages) I didn't know you can do this! It is brilliant way to pass dependencies that are on the VI Package Network (i.e. Open G - so thanks) and keep the file size down. Esp with links to MGI monolithic library and a few large OpenG packages :beer_mug:

    • OpenG packages can be included in the zip file if they are required dependancies. You can also just list the package dependancies (names with version) in the description. Do not include unpackaged OpenG code.

    Dear Mod(s)

    Am I able to include OpenG or MGI VIs (renamed) in an llb for distribution along with my source code. Or does "not unpackaged" strictly refer to vip/ogp packages?

    For example, if I use VIPM and I want to include packages as internal dependencies is this a violation of the LAVA CR Certification?

    Thank you for your time

    Regards

    JG

  5. I found some examples with respect to the comment,but i still don't understand how to implement my use.

    Some people said using Queue Operations to implement it.

    I think you are still going to have trouble converting the data to a string like that unless you do it using chunking or something similar.

    You should be able to use the same example I have posted and stream the data to disk.

    Just wire in the SCOPE data to the for loop.

  6. Hello everyone!

    I am a beginner in Labview programming and I have question regarding analog and digital signals. I am going to make a Labview program that control a laboratory device (electrode). This electrode detects oxygen evolution. However, I want to use my Labview interface in order to record the signal and monitor values of the electrode generated signals. The problem is that I have a pc-computer card with a digital output signal (National instruments NI-PCI-6534 (Digital I/O)) whereas the output signal from the electrode is analog. I would like to know if it is possible to convert the analog electrode signal into a digital one? Are there any devises available that convert analog signals into digital signals? Another possibility is of course to use a card that accepts both types of ingoing signals (analog and digital). I wonder if anyone knows if there is such card available that are fairly cheap?

    I would be very grateful if someone could give me some tips and advises regarding my signal trouble.

    I am no electronics guy but I had a sensor this week that outputs e.g. 0-20mV that went through some amp and came out as 5V TTL. Sweet! It was a sensor for speed so the output got converted to pulses (RPM). It was gear from the manufacturer but I am sure you can do this.

    Anyways if you are after NI gear the Low Cost M Series DAQ is a great way to go e.g. 6221. If you need to go cheap as there is also USB 6008. Both of these have sibling devices worth checking out too. It depends on your specs (resolution, budget etc...)

  7. I think the memory crash arises when converting to string

    Yes the code originally failed on the string conversion.

    Having the array in memory would slow things down I would imagine.

    Probably because the 0 ms timeout. I would advise to use TDMS files

    Well I ran it without the 0 wait in with respect to that comment.

    It always worth adding a zero wait to free up the CPU with While Loops - nothing worse than an unthrottled loop.

    As it was quite resource intensive I thought it would be a good idea for the For Loop in this case.

    Great to see someone else recommending the TDMS format.

    The new TDMS 2.0 format in 2009 has some great improvements (support for scaling properties, streaming directly from DAQmx, faster - bypassing the TDMS and Windows buffer straight to HDD etc..)

    We use TDMS (or rather gTDMS) for embedded systems but I believe there is now VxWorks support for TDMS 2.0. :cool:

  8. I was reviewing this thread.

    And wanted to download the code from Jgcode, however when you click the image a nice web 2.0 hover java thingalingy comes up with the full-scale image.

    The window says 'Downloaded 2 times', but I cannot seem to download or drag and drop the image into LabVIEW 2009 to abuse the wonderfull snippet feature.

    Any chance to add a download button or let bigger images be directly in the HTML?

    EDIT: With IE I can right-click the image and select 'Download target' on Firefox the right-click acts just like a left-click. Ton

    I know this doesn't help:

    But I use Google Chrome and right click to select "Save Image As..." - so that browser works ok.

    <edit>

    Ton - can you drag and drop the image with FireFox?

    Chrome supports this

    </edit>

  9. I want to save the datas more than 20M Bytes. But when run the program,there is a dialog box showing as Not enough memory to complete this operation. The memory size of my pc is 2G. So,how to save large datas? Thanks.The version of lv is 8.6

    post-16776-125964534014_thumb.jpg

    Hi Simon

    I did the maths and you are definitely trying to save more than 20MB... 400MB in fact

    post-10325-125964920608_thumb.png

    My question to you is - do you need the entire array in memory? If not stream the data to the disk. Additionally may I suggest a binary file and not ASCII for such a large file? You will save a lot of space (and it will be faster as it does not have to convert binary to ASCII etc...).

    E.g.

    Binary DBL 3.14159265141592 = 8 bytes

    ASCII text 3.14159265141592 = 16 bytes

    post-10325-125964891543_thumb.png

    There maybe some LabVIEW guru's who can suggest a more optimized approach.

    The code worked on my PC - but it took a while!

    You may wish to span it when it reaches a certain size as well

  10. @jgcode

    re: sequence structures

    I've always been under the impression stacked sequence structures are considered bad style but flat sequence structures are okay, even when using multiple frames. Did I miss the announcement? ;)

    Well I am under the impression the flat sequence structures are better than stacked sequence structures, namely because all the code is visible, you don't need to use sequence locals to pass data and the data is available to other nodes after a frame executes rather than then entire structure. It still suffers from other things like rearranging frames, or cannot execute the same frame twice or stopping half way through.

    Oh yer and it this is another great use case too.

    post-10325-125962949679_thumb.png

    But there was no announcement, but I am sure if you have 20 frames strung out in a single structure you may get one from your co-worker ;)

  11. I'm attempting to figure out how having "Projects" is helping me...

    Today's question: I have The Big Project that has 15 or so executable builds under it and 1 installation to wrap all those up. I was coding up a tool that I wasn't sure if I was going to include in The Big Project installation, so I wrote and built it in a different project. Now I've decided that putting it into The Big Project installation would make it easier for my users. Is there some way to copy the build parameters for the tool executable from its project over to The Big Project, so the tool build can easily be added to The Big Project installation? Or do I just need to make sure all the right files get put in the right place manually?

    Cat

    The .lvproj file is xml, so it might be the easiest to cut and paste in a text editor.

    Otherwise I am sure there must be a way you could read it out programmatically using property nodes and add it to your project. I would be interested to see your example if you go that way.

  12. Ahem, I haven't bothered with error clusters in general so far, though I did use it once in the same manner as your first example (I was copying a labview example). Is the use of sequence structures as opposed to "data dependency" a purely stylistic choice or are there programmatic reasons (efficiency etc) for using data dependency?

    There are traditionally three ways to sequence nodes in LabVIEW

    1. Natural Data flow
    2. Artificial Data Flow
    3. Sequence Structures

    Natural data flow sequences nodes from the "natural flow of data" i.e. you wire up A + B = C and the "+" operation cannot execute until data has arrived at both it's terminals.

    Artificial data flow refers to the use of wires connected to nodes that are not required however, in connecting the nodes you have created a data flow dependency (albeit a fake or artificial one).

    Finally you can use sequence structures - stacked or flat - these can sequence nodes that are independent of each other. As each subsequent frame will not execute until the previous one has completed.

    You will find a plethora a reasons on why people consider the use of sequence structures to be bad style e.g:

    • Cannot change execution order with cutting and pasting code
    • Forced to wired from right to left when passing data between frames due to the use of sequence locals
    • Cannot run the same frame twice
    • Have to run the entire sequence from start to end - cannot conditionally abort half way through etc...
    • Cases are hidden

    Using error clusters and connecting them up is a great way not only to create a basic error handling scheme but to sequence nodes too.

    See attached example.

    post-10325-125956699658_thumb.png

  13. Hi friends :wub:,

    I am creating a VI where I have a lot of options to be used by the users. So, I want to use some kind of help menu - e.g when we move the mouse pointer over the controls , Labview automatically shows some hint -for t seconds and disappears or it should disappear when the mouse is moved from the object . :ph34r:(in the event structure(Mouse Move)?!)

    It is not a pop up menu, where the user needs to click something to close the menu..

    Now the question is - how to create/show 'hint' messages? :wacko:

    Thanks for your time....:worshippy:

    Sharon

    Hi Sharon

    One way to do this is to use the Description and Tip of a control.

    When the VI is running and the user hovers the mouse over the control the Tip Strip will appear. When the user open the Context Help and hovers over the control the Description will be updated.

    No need for events, as it all handled internally.

    post-10325-125955114719_thumb.png

  14. and summing up those last few points: I think that a smarter person than I would not need the 'fear-o-god' tactic to discourage poor techniques. Rather it would be much more classy and eloquent to give knowledge to them through some simple example programs demonstrating the bad aspects and demonstrations of better ways to do it.

    Agreed.

    While its nice, in this case, you have taken the time to go into detail, there is always more in-depth knowledge available out there, and can't you feed everyone.

    That is why I posted links to design patterns.

    I was also answering one of the topic starter's original questions:

    Thanks for the reply. Since I'm quite new in Labview, could you explain a little bit more what to do with the property node? And also can you give me some more info about the other methods you propose?

    And I did post this disclaimer:

    It is just another way to programmatically fire an event. It is the same as doing it registering an User Event (as jcarmody has posted) albeit most likely a little easier to start with, but not as flexible.

    Anyways, because they are not a basic topic, I am sure you can make a hell of a mess using dynamic events, the user could easily:

    E.g.

    • Pass the reference deeply into their app (like your control ref example) and fire them from anywhere in an application making it difficult to debug. As this would be down to having good programming style (or not). I actually can't see using a user event or Val(Sign) is any different is this case (aside from the point you mentioned of asynchronous firing of sequential Val(Sign) nodes)?
    • Branching the Event Registration Refnum and passing it into two Event Structures, causing missed events (when you should have branched the User Event Refnum and creating a second Event Registration Refnum).
    • Not understand when events go into memory - statically registered events go into memory when the top level VI goes into the reserved state and are removed when the top level VI finishes executing. Dynamic events have the ability to go into and out of memory meaning the user can control this, meaning there is more that could go wrong as they have the potential to destroy the queue and registered event.
    • etc...

    Additionally if an Event Case takes a longer time then human reaction time to complete, handling the event in the User Interface Event Structure may cause the front panel to lock up. Regardless of whether front panel locking is disabled (only for notify events), the UI will still be unresponsive. A PC-(Events) design pattern or similar would be required, or handling setting the cursor.

    Whilst everyone has an opinion based on their experiences etc... and yours is that you obviously detest the Val(Sign) to point where using one is very bad which is cool, mine include:

    • Everything has a place, I am not saying I use technique all throughout my code (in fact I rarely use it) - but it does have a use case, saying originally to never using it, IMHO is not that helpful.
    • You need to walk before you crawl - if you don't understand firing off an event, or basic design patterns, I am sure the use of a Val(Sign) property will not make or break your code. And while it is definitely less flexible, it may be much, much less complex and get the job done (especially if the software's lifespan is short (test stub or prototyping something), a high quality level is not a requirement, the user is completing an example project (e.g. assignment)...
    • Knowledge will increase through ones own trial and error, backed up an intermediate ability to search for resources and good comprehension skills of those resources (I find that this is a cycle as I get better at one, I get better at the other etc...).

    All in all nice posts, but I think bashing the Val(Sign) is a little harsh.

    My 2 cents

×
×
  • Create New...

Important Information

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