Jump to content

LAVA 1.0 Content

Members
  • Posts

    2,739
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by LAVA 1.0 Content

  1. Thanks again - what is the difference between your 2 examples? I couldn;t spot it?

    Apparently the only difference is in the file names. I messed up somehow when saving it in 7.1, and I can't find my modified code. I don't have time to redo now, maybe at lunchtime, I will get it out today.

  2. Thanks for the example - some questions though - how is it that you can put both the state name and the message into the queue? What is you have a message which inludes by chance,one of the state names - won't it force the machine to change state? Don;t you need separate queues for state, send and receive messages?

    unless you are enqueuing into the same queue from multiple parallel VI's you should be able to confidently control the order of elements in the queue, which means you can be confident that if you enqueue two elements at once they will come out in that order. However when enqueing from multiple parrelel VI's it can cause a problem if your not careful. Another way of doing it is creating your own enque protocol i.e <state case>:<data>

    Also I need to have a watchdog message sender which sends out a message every 10 secs or so, is it ok to have a seperate timed loop which jcust generates this message and adds it to the message queue?

    I would make a seperate VI with its own queued message state machine, and a reference to the main Queue. I would keep track of the time not in a while loop, but by enqueing back to the same case, when time expired enque to "send watch dog" which would enque into mains, perhaps send:<message>. I also would spawn this VI from main. Perhaps this seems to complex, but it leaves you with a lot of flexibility to grow the app. I attached a modified version of the last example that illustrates some of these points, it is by no means comprehensive, but it should get you started.

    hope this helps

    Cheers,

    Phil

    Download File:post-3882-1142948761.vi

  3. Thanks for the replies all round - changing the tiimeout solved the immediate problem.

    My application is actually much more complex than this - it's a messaging system and dialler that runs on a PDA communicating with the outside world via serial port or bluetooth to a modem.

    I originally wrote it as a demo using parallel timed loops communicating via queues - one for serial, one for each aspect of the UI system that required different timing, but the delay thru the app was horrible and unpredictable, sometimes up to 30s between when you pushed the button and when it came out the serial port. It was my first serious LV app (this is my second!) so I'm sure there are heaps of mistakes.

    I decided to rewrite it using Events for the UI inside a State Machine, with queues to handle the comms between processes, notably the serial port and the UI / message handlers.

    However the serial will not run inside the state machine becuase the Event structure for the UI locks the machine until an event happens (I think?), so I put a timed loop outiside to handle the serial comms, and another which needs to generate data for the serial port and deal with data from it in nreal time, independent of the UI - see the attached.

    Any useful comments appreciated - I'm demonstrating it tomorrow at a trade show and it's far from finished since I decided on the complete rewrite only a couple of days ago.

    Thanks,

    Phil

    post-3994-1142861627.jpg?width=400

    post-3994-1142861689.jpg?width=400

    post-3994-1142861745.jpg?width=400

    post-3994-1142861801.jpg?width=400

    post-3994-1142861838.jpg?width=400

    post-3994-1142861881.jpg?width=400

    post-3994-1142861917.jpg?width=400

    You are definetly moving in the right direction. I have attached a simple example VI that illustrates a more flexible frame work. Hopefully this will give you some ideas, if not for this project than your next. The event structure has a timeout much like the queue, I pointed it out to you in the example, along with some other insights. Good luck, and keep at it :thumbup:

    Download File:post-3882-1142874382.vi

  4. Hey Todd,

    It's really analogous to proxying method calls for GOOP objects between PCs on a network.

    Dave.

    I would agree totally with your analogy. Further more, Global VI's (not that I use them) and VIG (labview 2.0 globals) do not work either, queues do however. I have attached an example to illustrate my point. If you open both projects, and run send and recieve VI's, the VIG and global won't work nor would goop, the queue will. If you than open one project and than open the other main VI directly it will work. I also believe that any VI's in common between the two projects will open seperate coppies of the VI in memory. If any one from NI is monitoring this thread, I would be very intrested in hearing from you on this subject.

    Download File:post-3882-1142868285.zip

  5. Maybe I've just been at this too long for one day, but I have 2 loops running in parallel and they have a timing dependency which I don't think should be there.

    The top one contains serial read / write (not using VISA becaase it's going to run on a PDA eventually)

    The lower one contains a simple generator to send periodic commands to the serial port (now just wired to the loop iteration counter).

    The generator send data to the serial loop using queues.

    Problem - the serial loop should just free run accoring to it's timed wait, as it has done in other VIs I've written, and 5x the speed of the Generator loop.

    BUT it doesn't! It only runs after each completion of the generator loop.

    What am I missing - probably something very simple!

    BTW I'm using LV 7.1

    Thanks,

    Phil

    post-3994-1142781960.jpg?width=400

    The dequeue element by default will wait untill it has somthing in its queue before it continues execution. Since you are enqueueing at a rate of 500 ms in your generator loop your serial loop can only dequeu at that rate, thus the dependency. The timeout in ms terminal on the dequeue element vi determines how long it will wait, before continuing execution. For example, if you wire 10ms to that terminal, the dequeue will wait untill somthing is in the queue or 10 ms, which ever comes first. A few other observations; you obtain the send message queue 3 times but you only release it once, so every time you start and stop this application you are leaving two references to the send message queue in memory, this may or may not cause you a problem. There is three solutions for you 1. only obtain the queue once and pass out its reference to the enques and deques and release queue. 2. relese the queue three times then it will be destroyed. 2. there is an optional boolean terminal on the release queue, if you make this true it will destroy the queue. I see no use for the recieve queue in the application, unless there is another VI runinng in parrelle that obtains a reference to the recieve queue. Also, I would consider using a state machine for this, it will make it easier to modify the code moving forward, and has many other benifits. I have never written code for a PDA perhaps you are aware of a reasons to use the sequence that I am not, but as a general rule it is never recommended to use a sequence. Hope this helps :thumbup:

  6. <Shameless Commercial Plug> ;)

    There is such a tool available: The VISTA Documentation Manager and Documentation Generator - check out the links on the left side of the page. I have the luxury (and it is a luxury) of working for V I Engineering, so I get to use these tools (and more) internally for free, but even if I worked somewhere else, I would still certainly use these tools. From our website:

    <Shameless Commercial Endorsement> :2cents:

    I have been using these tools for a few years, I would not say that knowing I have these tools makes me excited about documenting my code :rolleyes: . However, when forced to document these tools certainly make it less painfull.

  7. I am working on a application involving three major components, each component is assigned to a different programmer, and each programmer has created there own labview 8 projects. We use GOOP (Endevo flavor) and carefully planned all the classes needed, defined the prototypes for all the methods and went on a merry ways to right code. Another point worth mentioning, we use Microsoft Source Safe for source code control. We created a master GOOP create VI, for lack of better term, that insantiates all the classes we will be using in the Application. The objects created were named objects with the create or look up option selected. The output of the VI is a named cluster with the references to all the objects, the cluster is fed into a shift register in the lower loop of a master slave event queued message state machine ( that was clear :wacko: ).

    Here is the problem, when it came time to start integrating the components, the projects were opened as needed (all on the same machine), but the goop objects were not communicating to each other. Further investigation uncovered that if multiple projects are opene, at the same time, the files under that project are on different execution targets. This is evident also by viewing the lower left corner of the VI instead of just "My Computer" it is "<project name>.lvproj/My Computer". The ramification of this is any techniques used to pass information between VI's running on the same machine (GOOP references) won't work. While I can see situations were this would be desireable, I can see many more were this is a problem. This leaves to options, open all VIs from windows explorer or put all components in the same project. The problem with the later is if all developers use the same project file you will be forced to check in and out .lvproj and the .lvib every time you do anything to the project. The problem with explorer is per NI recomendations I am doing most of my file organazation in the project, not on the hard drive, so things arent easy to find, besides, having all the files at your fingertip in the project explorer is part of its supossed charm.

    A solution to this would be the option to enable or disable creating seperate execution targets for each opened project or being able to add a project to a project. I have not found either of these options. Has anybody else come across this, and if so how did you get around it?

    Thanks in advance for any and all help provided.

  8. hi sir

    When I run the program it gives me PROGRAM ERROR (LABVIEW.exe has generated error and will be closed by windows. You will need to restart the program. An error log is being created>and the window log off.

    I have no idea why you are getting a labview exe error. I have attaced a vi that illustrates how to buil the array and use a shift regester to keep a running max value. This is basiclly what I added to your code. I am simulating the equipment output array with for loops. Another point, you have defined your array as 3 deminsional in the spreadsheet to string array, I have not seen very many device that output the data in a manner that would require 3 dimension. Also are you sure your format string is correct? None of these things should cause an exe error.

    Download File:post-3882-1142349127.vi

  9. I am reading an instruemnt and I am getting a value that I want, but I would like to read the instrument again with the same setting and get another value so that I can compare the two values and find the higher value because the value is always changing a little. Is it possible to save the first value for a little while so that I can get another value and compare them and the higher value will be sent automaticly in the table to be print. I used the array to do that but I am not sure if it right. I did not test it because I am away from uni for a week and I do not have the equipments to do it.

    NB: the subVI's did not not included because these are spectrum analyser drivers downloader from ni.com. I do not know how to sent them to u.

    I enclose the modify program with the array for u to see. so I can get help thanks

    I modified the VI for you, this I belive is what you are asking for. Again I strongly suggest you read up on while loops, for that matter Labview basic fundementals. Also, the analyzer will do this for you, Max peak hold continuous sweep or somthing similar, read the operators manual :book: Hope this helps :thumbup:

    Download File:post-3882-1142040524.vi

  10. The manufacture and model number of the spectrum is ROHDE&SCHWARZ FSP R&S 9kHZ~40GHz. As I explained above the program is working I can read the max amplitude or max freq value but what I want, is to put the read max value so I can it in spreadsheet and print them (see above the first post for more explaination) see also the figure

    I am still confused as to what you are trying to do, and you did not include any of the sub VI's. The simple answer to your question is you need to read up on while loops :book: , the only value you will get in the Max Value indicator is the last value output from the instrument read VI before stoping the application. I have no idea what the three array controls are for, and if you are reading the whole array from the analyzer to display on the graph, why use the markers to get the max value, just get the Y values from the read spectrum VI and get the max. Also, the shift regesters in your while loop serves no purpose ;) . You refer to setting diferent freqs and measuring amplitudes, I don't get it, unless you are seting the center freq with O span, you have a range of frequencies based on the start, stop and number of data points. Here is my advice based on a lot of assumptions and very little information. Manually set up the analyzer for the frequency range of intrest, put it in MAX peak hold and continuous sweep, measure what ever it is you are measuring. Once you no longer see the plot on the analyzer changing, assume you have captured the highest amplitude at each frequncy, and stop the measurement. Run the spectrum VI, from its output, with a little code, you should beable to write it to a spreadsheet and save as a file. Just keep runing the VI with whatever frequncy range you are intrested in.

  11. hi all

    I made a program that can read RF amplitude and freq from the spectrum analyser. Now I want take several amplitude mesurements with the same freq value and put the high value in the table so I can print it later.

    NB: I have to set different freq value and take their max amplitude values and put these value in the table as spreadsheet so I can print them later. These max value must be display on the front panel. let say for freq=4GHz, 1e mesurement = -22dB, 2e = -34dB, 3e = -12dB this mesurement must be put in array so it can sent the max value (-12dB) in the spreadsheet. Set another freq value take amp value and put the max value in the same table. At the end I can print all these max value.

    I need help to build these array because I am new in labview and this for my project.

    Thanhs

    What is the manufacture and model number of your spectrum analyzer? Give some more details of the task you are trying to accomplish. Typicaly you would set the analyzer up with a start and stop freq, sweep time and other important settings in the spectrum analyzer. once you have the analyzer setup, start your sweep in continuous mode with MAX peak hold. Once you are satisfied you have captured the maximums at each freq, you can retrieve the entire array from the analyer. There are Labview drivers for most of the Agilent/HP Spectrum analyzers at NI website.

  12. HELP!

    I have been using LV 8.0 since the day it was downloadable, and although there are bugs, it has been functioning, until today. When I go into MAX I have the following lines; Data Neighbor hood, Device inerfaces, Scales, Software and remote systems, with nothing under any of them. I read some post at NI boards with various suggestions, tried all, none worked. Called NI and they sent me an app called msiblast.exe which should have allowed me to remove everthing NI. It did not however remove LabView RuntimeEngine 7.1.1. it reported it could not remove (I am paraphrasing). Removed all reference to NI IN regestry, but still runtime 7.1.1 showed up in msiblast, but not add remove programs. Installed Labview 8.0 and device drivers, and to my suprise nothing changed in MAX. Any ideas? NI and myself are all out of them.

  13. Hi,

    I have a while loop and I from some iterations (depending on a condition) I want to launch a "one button dialog" to notify the user about something.

    The problem is that I want that the main VI to continue the execution and not to wait until the user presses the button. In case the condition is true once again, a new dialog should appear, and so on.

    If this is not possible with one button dialogs, is it possible to launch programmatically several instances of the same VI simultaneously?

    thanks

    Use VI server to open the VI then use the Run VI method (invoke node) wire a false to the wait untill done method then add a property node, select the FP.Open property and wire a true. I would create my own little dialog VI first, just a while loop with a delay in the loop and a boolean to the conditional for your ok button. Put a string control on the front panel, and type your message. This will accomplish what you want, you can even pass a value to the string control to have a different message depending on the situation. Hope this helps, I am on my way out the door or I would send you the code. Here is somthing I already had, does a little morre than you need and wont run for you , but should illustrate the concept.

    Download File:post-3882-1140123201.vi

  14. Is it possible to run a LabView VI or an .exe automaticlly when Launching Labview. I do not want it dependent on the shortcut that is used to launch LabView. The use case is for sychronizing may reuse librarys with my source code control. Using the SCC VI's in Labview 8.0 I have writen code that will do the sync., I just want it to run automaticalyy when LV is launched, so I know I am working with the latest and greatest reuse VI's. I was thinking maybe somthing in the LabView ini.

  15. I recently posted a LV 8.0 VI on another board, it was just a bundle by name example. Problem was they needed it in 7.1, so I did a save to previous version and reposted the VI. When reading over the thread I noticed the 8.0 VI was about 13 k and the 7.1 was about 23k. Anybody no why, just curious?

  16. <-- version 7.0, not 8 ;) but yes, I follow what you're saying. Last week was the first time I did what you just said with the cluster constant labeling. I'm thinking about using that for the configure part of of my program only I don't like the idea of having a configure.vi that requires passing a huge cluster to write but then when reading, having to read the WHOLE cluster (over 40 elements) just to read 1. This is why I'm still using local variables and sequence structuring to initially read the cfg file in, update the controls, then read them all over the program using local variables. Do you think I should use a seperate configure vi with a functional/LV2 global? These user configurables are read relatively often and relatively fast ~10 get read in different locations of the program >17Hz. It would really clean up the main vi if I did go to clustering and a seperate config vi but I don't want to do it if it'll hurt performance any (suporting slow ~400Mhz machines).

    Thanks again for that reminder about labeling... I still wish it was easier to label wires. Like a right-click shortcut label feature :2cents: .

    Sorry about that, here it is in 7.1. In my opinion there is nothing wrong with a subVI that reads in a config file and parses it to build a big bundle by name cluster to pass out. 40 elements in a cluster is not bad, you start taking performance hits with an array of clusters or even worse, an array of clusters with an array as one of the elements of the cluster.

    Download File:post-3882-1140048702.vi

  17. Labeling an indexed array item... notice how it has no name is defaulted to "numeric" for every item. Only if I wire it to an indicator does it get a name :( .

    I think I understan what you are asking, see attached VI. Create a constant on the middle node of the bundle by name, add what ever data tpes you want to the constant and lable them. Than wire what ever data you want into the cluster elements. I think maybe the problem is you are used to defining the name of your cluster elements by wireing a control to the elements and letting the cluster element name take on that of the control lable.

    Download File:post-3882-1140044855.vi

  18. You can re-take the exam after a certain time period has passed (a couple of days I think?)

    I can only speak from my personal experince, but it would appear that you can never take the exam again!! I took the exam before I took the developer certification test over 2 years ago, I had to recertify in december 2005, so I went to take the Free online test. I was prevented from doing so with the following explanation "You cannot login now. You have already taken the exam and you passed it. Click the Close button to close this window".

    I promptly created a half dozen e-mail accounts on my mail server, created NI accounts for each, and took the test 6 times. That'll show m. That was in December, I just tried taking the test after reading this post and was denied for all the accounts I created in December, and for the one I used over two years ago.

    Also, here is an idea, while taking the test after making my selection I did a Alt-Prnt Scrn, pasted into paint and printed it out, I only did this for the ones I was not 100 % on. After getting my results I researched the ones I printed out, usually I would find that I had printed out all the ones I got wrong ( never more than 6).

    I could not agree more that they should tell you what you got wrong. Last year I took the Architect test for Labview, it was 10 questions, three questions required writing relatively easy code snipets, the other 6 were essay type questions. The questions were in the line of "If you are in charge of a large Labview project with multiple programmers involved explain everything that is important" go! I am somewhat exaggerating, but they were very broad questions.

    I thought I did well, and I eagerly awaited my results, several weeks later I recieved an E-mail stating I had failed the test. :thumbdown: I am OK now, don't be sad. The point is, that is all it said, There were points awarded for the questions, and a certain number of points are required to pass, but that is all the E-mail said. I called NI to find out how close I came, and or what questions was I weak in, something more than FAILED. They would not tell me anything, they said they did not want to "compromise the integrity of the test"

    I do not see how telling an indvidual if they missed by a mile or an inch, "compromise the integrity of the test", but that is all I got. I even used my considerable pull with my NI sales guy, and got nothing. I don't get it.

    I choose not to take the test again, I found it very subjective, and got no feedback from taking it the first time. In fact the only they I got from the first test was a little more room in my wallet.

    Sorry about the rant, guess I am still alittle bitter. To end on a happy note, I passed my recertification with 38 out of 40 :thumbup: .

    P.S. I hope none of the information in this E-mail "compromise the integrity of the test"

  19. I have been using NI's Database Conectivity tools with Sybase and Access database for years, with no problems. I recently have been investegating using PostgreSQL for windows, I did the full windows msi install package downloaded from postgresql.org, and installed with no problems. The pqAdmin III was very intutive and I was able to create a database with a few tables, and insert data into the tables, relativly easy. I created a udl link for the database using the PostgreSQL OLE DB Provider that was part of the MSI install, and was able to open a conection in LabView. Every thing was going well untill I tried a parameterized query, this is were things took a turn for the worst. The following error occured "Error -2147217887 occurred at Conn Get Properties.vi->DB Tools Create Parameterized Query.vi->". The cause of this is, after some investegation, due to the request for the "defaultdatabase" property node. I can easily fix this by modifying the NI VI's either in VI.lib or my own reuse, but I do not like these options. Inside the block diagram of the get DB properties is this comment "DefaultDatabase is not supported (fires an error) for all providers. mspersist is one of these...maybe check provider to filter out these cases. NI did not know what was ment by this note, and there suggestion, (contradicting previous NI good practices recommendations) was to modify there VI's. That was a lot to ask this question; "is there something I can change in the PostgreSQL database configuration, or the OLE DB Provider to fix this error"? I am not a "database guy" I use databases with labview because I found it easier then a lot of ini files.

  20. Hello,

    is it possble to insert a pull-down-menue in the fields of a listbox? That means, that the user has the possibility to click in the field and then gets an pull-down-menu?

    Thanks

    Christian

    Often when I am using a multi column listbox I put a row of pull down menus across the bottom of the listbox, sized to the same width of the columns. Usually I dynamically stuff these pulldowns from a database or something, the user selects the row of intrest in the listbox, makes whatever selections he wants in the pulldowns, and the hits the update button, which then stuffs the pulldown values into the row of the listbox that is selected, each pulldown value into the column it is beneath. Sounds a little confusing, if your intrested I can send you an example.

  21. Hi everybody,

    I'm looking for the best way using LabVIEW to get the PC informations (drives sn, processor id, etc) so that my application is only runnable on a machine (which info is in the LabVIEW source). If possible, to have an application that only runs on a unique cd-rom for example

    I've already found code that calls vbs script or execute ipconfig command to get computer info, but these solutions don't seem safe enought.

    Can anyone tell me which solution is the best to use or in which way I have to go?

    Thank you in advance.

    Bim

    Assuming that you want this information to prevent piracy, another option is a USB dongle. This gives the customer the flexibility to install the application on other machines, but only run it on one machine at a time (The machine that has the dongle on it) I get my dongles at MAI Digital Security, they are only 20 dollars, and come with LabView VI

×
×
  • Create New...

Important Information

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