Jump to content

jgcode

LabVIEW Tools Network
  • Posts

    2,397
  • Joined

  • Last visited

  • Days Won

    66

Posts posted by jgcode

  1. Well I am stoked with LV8+

    Having to program in LV5 on a recent job and that my friends.. suck...

    Anyway one thing from me....

    I would like a "remember last selection on cancel".

    E.g. I pick a while loop and accidently place it in the wrong spot (e.g. miss encapsulating VIs).

    I want to hit undo but for the cursor to "hold onto" that structure.

    If I still do not want the structure I can just hit escape.

    9 times out of 10 I will want to use it again and have to go through all the palettes.

    Ok for a while loop but annoying when there is many layers to get to a structure from the Functions palettes.

    JG

  2. post-10325-1213851869.png?width=400



    Question: When I close a VI with the Window Close method what actually happens in the background?
    It seems that the VI front panel closes but the VI is still running even if I handle application close event.
    It doesn't finish off it code?

    I did a search so I know for an Executable I get handle this for the top level VI by tweaking the .ini to do a cleaner shutdown.
    And EyesOnVis talks about execution relative to top level vi in code.

    Cheers
    JG
  3. QUOTE (crelf @ Jun 17 2008, 01:02 AM)

    Wow - so your flight is even cheaper! Maybe you could get a reverse return and spend some time over here? ;)

    Bugger about the wedding date :(

    Yes mine would be a cheaper flight :)

    Have been to the West Coast and the East Coast.

    Would love to do the middle.

    Hmmm... maybe NI Week 09!

    Hope the above deals run again!

    I am sure that would be a big one too..LabVIEW 9 for 09.... ??

  4. QUOTE (Eugen Graf @ Jun 13 2008, 08:08 AM)

    FGV is really a good container for references! :thumbup:

    What do you do if your application should connect more computers e.g. over ethernet? I mean you can't use one FGV on more than on PCs.

    Ok - my answer was relating to single Computer.

    There are network version producer consumer using TCP/IP VIs.

    We usually do embedded to PC and make use of NI-PSP protocol and use shared variables alot for network comms.

    There is no reason you couldn't take a standard producer-consumer and create a proxy wrapper for it that does all the networking.

    So you would still queue events from all the producers like before, but replace the consumer loop with TCP/IP comms.

    Cut and paste your old consumer loop to a new PC and build a TCP/IP loop that reads in commands/data over the network and passes that to the old consumer.

    A bit more overhead, but the TCP/IP would be loosely coupled, (basically your old PC would not have to know its there) so you could still reuse your old code!

  5. QUOTE (Eugen Graf @ Jun 13 2008, 05:29 AM)

    Hello, this Question in not easy, but:

    which programm architecture do you use in your projects if you use very much parallel loops, which communicates with syncronisation tools (Queues, Notifiers, User Events and so on)?

    Thank you, Eugen

    For parallel loop I use what NI label advanced producer consumer (events) a lot.

    If the VI is a GUI then normally I run an event loop, main loop and a gui loop at a minimum.

    If I have DAQ then I might have another control loop and sometimes a process loop if I want to pipeline my processes.

    I use queues with an enum (state) and variant (data) as the datatype.

    If I use anything less (e.g. notifier, single datatype, single loop event state machine), the program always grows and I have to upgrade it to this so most of the time.

    So I start with this template even if it is overkill to begin with.

    I also like to create FGV wrappers to manage the queues in which the refnum persists, so its neater, easier to manage all the queues and I can call them from anywhere.

    Each queue has its own manager so its not a large shared resource.

    I use User Events to communicate back to the Event structure if I need it e.g. on error or when I want a force closed etc...

    If I ever want to create a resource that sits in the background (no UI) then its the above with the event stucture and the gui loop.

    I like having muliple loops as it loosely couples everything (logging, DAQ, control, processing, GUI updates, plugins) etc.. this allows me to reuse code alot.

    Using a templates its not much work tho to set it up. So if it was a small app and I could do stuff in one loop, I can, as quickly, build up the same thing with templates and I have a more scalable piece of code if required for the future.

  6. QUOTE (SciWare @ Jun 12 2008, 07:24 PM)

    No problem mate

    Does the code I posted work on your laptop?

    At the moment I'm not sure what the issue could be, could you post that code you displayed?

    Well, I have explicitly not put it on my laptop as I want to discover the problem (but I am sure if I do it will work).

    Funny thing is after I ran your code a few times, my refs that didn't work - worked! :headbang:

    My code was exactly like yours.

    <edit>

    I have seen weirder things.

    I am going with bug?

    Have just ran 8.5.1 in VMWare - works fine no problems.

    Looks like I will upgrade methinks.

    Now I can finally play with Active that works!!

    :beer: dude

    </edit>

  7. Thanks Kurt - bloody ripper.

    Due to an error I couldn't get past the Automation Open VI when I linked the _Application ref.

    I thought I was doing something wrong i.e. maybe due to the object I was linking to!

    But your ref is the same and I ran your code and it worked fine!

    post-10325-1213262591.png?width=400

    I have seen this before - I copied an Active X example and their ref worked, I tried to generate one in the same VI and it wouldn't work.

    Funnily enough - I can now create a ref that works! :throwpc:

    But my lappy still has the same problem!

    I am coding in 8.5, but I just ran a VMWare 8.2 copy and it has the same problem.

    1) Has anyone else seen this?

    2) Am i doing something wrong?

    3) Is there anything I have to do (refresh type library)?

    Cheers

    JG

  8. QUOTE (menghuihantang @ Jun 12 2008, 12:56 AM)

    Actually the data returned is in Event Data out. User parameter is optional, I did try wiring something to it. It doesn't work. I didn't get anything except empty string from the event.

    This may help?

    QUOTE (NI)

    You must create a callback VI to handle events from Active X controls when the controls generate the registered event. The callback VI runs when the event occurs. To create the callback VI, right click the VI Ref input of the Register Event Callback function and select Create Callback VI form the shortcut menu. LabVIEW creates a reentrant VI. Open the VI end edit the BD to handle the event.

  9. QUOTE (Aristos Queue @ Jun 9 2008, 07:45 AM)

    No. Although LV will let you typecast one into another, you'll find that it doesn't work as you would expect it to work. When you open a strongly-typed VI reference, the VI is actually reserved for running. Just typecasting will not do this reservation, and trying to use such a refnum with the CBR node will just give you an error.

    No problem at all. Open the weak ref first, do your edits, then open the strong ref to do the CBR.

    Thanks heaps AQ! :beer:

  10. Hi

    I want to open a ref to a VI, make changes to the front panel, launch the VI in a subpanel, then close the VI and do not need to save changes. I want to open a weakly typed reference to make the FP changes (for reuseable subVIs) and I need a strictly typed to use the call by reference node.

    My questions are:

    1) Can I coerce between the weakly typed and strictly typed refs?

    2) Is there any problems with having two refs open at the same time as I launch the plugin - should I clean up my refs a different way? (NB: I have to keep the VI in memory to keep the changes or I will lose them).

    post-10325-1212937387.png?width=400

    For Q1 I thought maybe something like this may work? But not.

    post-10325-1212937989.png?width=400

    Cheers

    JG

  11. QUOTE (hakannn @ Jun 6 2008, 07:37 PM)

    hi jgcode,

    thanks for your reply.

    i tryied your solution but i couldn't managed it. ( The next step is to build a circular buffer" i couldn't understand, what does it means "circular buffer"?? :s )

    after i tryied other solution and i saw signals.

    the last problem about program,

    The program can't save the "coefficent" and "plus" number. can i save this number. i don't want to write it everytime when i open the program

    Making a 2D array is a solution for a waveform GRAPH

    Another solution is to use the waveform CHART like you have done and let the chart handle buffering (which is statically set).

    You may find handling your own buffer is more flexible, but if you are after a quick solution the chart is actually probably the easiest.

    If you need to save your scale and offset and the values do not change per collection then convert them to a string and write them to disk as a header in your collection file is an option.Do this before you enter the loop. If the values do not change there is no point continually polling the FP panel every time you do a read.

  12. Hi crelf

    I came across the same thing when I wanted to design polymorhpic "tool" VIs and distribrute them in .lvlib but keep the internals private as the point was to encapsulate using polymorphism.

    As it kept breaking my code, which I thought was unintuitive, I haven't gone back for a second try.

    Maybe there is a reason for it?

    But if anyone knows a work around - I am keen to know!

    Especially now NI have starred using lvlib, I bet we see them around more and more in the future.

    The ability you described would sure be handy for source distribution.

×
×
  • Create New...

Important Information

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