Jump to content

ned

Members
  • Posts

    571
  • Joined

  • Last visited

  • Days Won

    14

Posts posted by ned

  1. QUOTE (X_DOT @ Dec 12 2008, 07:11 AM)

    I need to subtract 2 timestamp strings and get the difference between them. how do I do this?

    I have attach'd af screenshot of my block diagram and hope you can help me.

    You can also use "Scan from String" with the appropriate format specifier to convert a string to a timestamp.

  2. QUOTE (xilverbolt @ Dec 8 2008, 05:27 PM)

    I'm a n00b.

    Let's say you create a SubVI and then want to add another output to it... how does one do this? I've made the SubVI Expandable and clicked Insert Input/Output but that only lists an input or output that I already have wired up. Thanks.

    We know you're a n00b if you use the phrase "Expandable" in reference to a subvi... :P

    (I might be wrong - does anyone actually use that style of subVI, or are we all too set in our ways from before that was even an option?)

    Right click on the icon in the upper right corner of your front panel, choose "Show Connector". Click on any empty (white) terminal, then click on the front panel item to which you'd like to link it. If there are no free terminals, you can add one by right-clicking and choosing Add Terminal.

  3. QUOTE (Callista @ Dec 3 2008, 03:20 PM)

    i'm having a hard time with the current time..i'm not visually seeing the tanks rise..what should I do? I'm pretty new to this so any help would be greatly appreciated!

    It looks like you've made a good start on this assignment and you just need to spend more time learning how to debug LabVIEW code so that you can find your error(s). Try using execution highlighting (the light bulb icon in the toolbar) and probes (right-click on a wire and choose probe) to follow the values on your wires as the program runs. It will also help if you clean up your wires and make sure they don't overlap. Right-click on your tanks and set the digital display to visible so that you can see the actual numeric value that your code is computing.

    There are a few style issues - there's no need for sequence structures nor property nodes and you could move some of your calculations outside the while loop to reduce redundant computation - but focus first on getting your existing program working.

  4. QUOTE (subasa @ Nov 24 2008, 08:18 AM)

    Hi every one

    I am in a process of converting some C code to LabView. The problem is that my C programming is poor so I am having some problem in translating the C code to LabView. There are no comments available on the program. If any one can help me and convert it for me to LabView, it would be greatly appreciated.

    Thank you in advance

    I don't think your problem is your skill in C programming, since the code you posted appears to be VisualBasic.

  5. I have a cluster containing two identical child clusters. At runtime I want to unbundle one of those child clusters, do some work on it, and bundle it back into the parent cluster. Is it possible to do this in-place? Even with the new memory management structures I can't figure out how one would accomplish this without using a case structure and creating one case for each child cluster. Am I missing some good explanation as to why this isn't possible? This is mostly curiosity, as my child clusters are small enough that creating a copy isn't a problem.

  6. QUOTE (ned @ Nov 9 2008, 09:36 AM)

    In case anyone else takes this approach, I just learned something from experimenting with it a bit more - the user data type does not need to match the actual event data type exactly. The user event data cluster can contain only a subset of the elements in the real event data, in which case LabVIEW will only allow you to access the ones that overlap. In my example above I could leave out "CtlRef" in which case the value change event would no longer have access to the control reference but the rest of the data will still be available.

  7. QUOTE (ned @ Nov 7 2008, 10:18 AM)

    Open the Example Finder and search for PID; there are several DAQmx PID examples that don't require the PID toolkit.

    Oops, my apologies. While there are several DAQmx examples with "PID" in the name that show up in a search, it turns out that none of them actually contain a PID implementation, they all only implement proportional control.

  8. QUOTE (baseballjunkie @ Nov 4 2008, 07:13 PM)

    Hello everyone.

    I am currently a senior engineering student and quite new to the program. I have created an excel file (90x4) with column headings of Mach, "a", velocity, and RPM. I would like to have a user specify a certain Mach number, and then have LabVIEW interpolate out a value for "a" and RPM for this Mach number. I assume this function is done with the array commands in Labview, but not sure exactly where to start.

    Thanks for the help

    You'll probably find that it's a lot easier to work with text files than with Excel spreadsheets; fortunately you can save your Excel file to text. It's then easy to read that file into LabVIEW (look at the file operations palette for "Read From Spreadsheet File"). As for interpolation, there are two functions in the array palette that will help you here: Interpolate 1D Array and Threshold 1D Array. Start writing some code, and if you need more help, post the code that you've already written first.

  9. QUOTE (jithesh @ Nov 3 2008, 09:16 AM)

    Hi , I'm new to Labview and knows few basic things on it.I need to develop a labview driver for a bar code reader(MS9520 Voyager® and MS9540 VoyagerCG®).

    In their site they had provided windows drivers(http://www.metrologic.com/northamerica/products/pos/MS9520/), from this which one i need to install and how to develop a labview driver using that.

    I only want is to get the bar code readings to VI from the scanner.

    Thanks in advance... :)

    I haven't used this particular barcode reader, but it appears (according to the manual) that like most barcode readers this one can act as a keyboard or a serial device. No special driver is necessary. You can either use the keyboard emulation and read the barcode directly into a string control, or set it to serial mode and use LabVIEW's VISA commands to read from the serial port.

  10. QUOTE (Michael_Aivaliotis @ Mar 13 2008, 07:06 PM)

    I'm not sure of what the problem is. However, I upgraded many components on the site over the past few days. It's possible that one of the upgrades changed the behavior of this. Lets monitor this for a week or so to see how it really works.

    One thing I noticed is that if you set the menu at the bottom right to "today", and click "GO" it shows only todays posts. However it doesn't keep this after you close your browser and come back.

    Another thing I noticed is that as long as you are logged in (and keep yourself logged in), you will see the bahavior you describe. Then the only indication of new posts is the tiny orange squares. However if you log off (by clicking the log off button), you reset this and then you list will be empty when you log back in.

    Maybe this was an intentional change, but is it possible that at some point this will go back to the old system where you didn't have to click "Mark all forums as read" in the "View New Posts" list? Related to this would be having the count of new posts on the front page also reset, so I don't have to click "View New Posts" to see how many new posts there have actually been since my last visit. I don't usually log out so the system now thinks there are several thousand new posts.

  11. It sounds like a good start for you would be to break down the parts of your program into small tasks that are reasonably easily achievable and will allow you to learn LabVIEW in steps. Look at some of the many examples provided with LabVIEW and try to find a book on LabVIEW at your university library. You might start with a simple program that only runs the motor back and forth; or, put off the hardware until later and write a simple LabVIEW program that handles your interface and accepts simulated inputs. Once you have some LabVIEW code written, if you post it here and explain the specific errors that you're seeing, there will probably be someone happy to try to help you out.

  12. QUOTE (km4hr @ Oct 21 2008, 03:19 PM)

    No - your observations are incorrect. Many (most?) of us use the application builder (which is not part of the Student edition of LabVIEW) to build compiled applications, thus allowing us to distribute applications to users without any of the issues you're having and without requiring users to have LabVIEW installed. The Student edition is designed to allow students to learn LabVIEW inexpensively, but for real projects you want to be using at least the Full development system.

    QUOTE (km4hr @ Oct 21 2008, 03:19 PM)

    Nearly every tutorial I've seen shows how to create a Stop button. Usually by breaking out for a "while loop". But I haven't seen any tutorial on how to create a Start/Re-start button. Apparently there's no way to re-start a VI from inside the "program".

    Normally you would instead design the "Start/Stop" as part of your overall program, so that there's never any need to have LabVIEW stop running the program at all. Instead if your user clicks a "Stop" button it simply stops whatever action the program was executing, but the program itself continues to run so that it can start again when the user clicks the "Start" button.

  13. QUOTE (NeilA @ Oct 20 2008, 01:36 PM)

    My guess, based on that error, is that you're almost there. In Open VI Reference, if you don't specify a path to the VI, you need to have the VI you want to call already loaded into memory (as per the documentation). Just double-click it in the project explorer so the front panel is open, and then try the web service again. A better long-term solution is to place a Static VI Reference to Queue Item.vi on the block diagram of the the test executive so that you can be certain that anytime the test executive is running, Queue Item.vi will be loaded into memory and available through VI Server.

  14. QUOTE (NeilA @ Oct 20 2008, 11:39 AM)

    I have had some trouble getting this to work. I have made the changes to my code to get it using the same VI Server functions. The problem is if I run the VI I get an error 63 from Open Application Reference VI. Is it totally necessary to have the open application function in the program? Is this due to the firewall on my machine? Unfortunately I have no control over my firewall settings its a corporate IM Support thing.

    I have made other little web service VI's that work, like the example add program etc. These use localhost but dont specify a port number or anything.

    Could I be doing something else wrong now?

    Thanks for your help.

    Neil.

    If you use the approach that Nathan suggested you can avoid the Open App Reference. Your problem here might be due to your corporate firewall (although if it's just communication from the local machine to itself I can't see why the firewall would block it). Before assuming it's the firewall, make sure you've allowed access through TCP - right click "My Computer" in the project explorer, select "VI Server: Machine Access", enter "localhost" in "Machine name/address", select "Allow Access" and click add. You can also enter "*" as the machine name to allow access from any computer. Similarly, under "VI Server: Exported VIs" make sure that the VI you want to run through VI server is accessible.

    A quick explanation here about Application Instances, and the difference between using TCP (as I did it) or ActiveX (as Nathan suggests). Each LabVIEW project executes independently of any other projects that might be running on the same machine - each project has its own instance. There is also a main LabVIEW instance, for VIs that don't belong to a project. Web Method VIs appear to execute in a their own instance as well. Queues and other reference data types are not shared between application instances, which is why your web method can't communicate directly with your main application just by opening a queue with the same name as the one used by your test executive. Instead, you obtain a reference to that specific application instance, and run a VI inside of it, permitting it to share data. By default, Open Application Reference connects you to the main application instance. There are a few ways to get access to a specific application instance. One is the way I did it, by assigning it a unique TCP/IP port and then using Open Application Reference on that port. Another is the way Nathan did it, getting an array of all the available instances and then selecting the one you want. In Nathan's approach you already have the Application reference, so there's no need to open it - you can pass that application reference directly to Open VI Reference.

  15. Nathan - thanks, that's very helpful. I see now that I did not completely understand application instances, and so in order to get access to the one I wanted I just assigned it its own VI server port. I didn't realize that each application instance has its own application reference, and that "Open VI reference" connects to the main instance by default.

    Neil - here's the code that my quick test uses. I, like Nathan, used a call by reference node, which I think is preferable to your Invoke node.

    post-3989-1224262026.png?width=400

    post-3989-1224261894.png?width=400

  16. I set up a quick test project to make sure this works, and ran into some difficulties using VI server through ActiveX due to what seemed to be problems with application instances or my inability to determine the correct "full delimited name of the VI". The VI would run properly through VI Server but not in the same application instance as the test executive, so it would create its own new queue rather than using the existing one. Here's what I had to do.

    Set up VI server through TCP/IP. In the project explorer, right click my computer -> properties and select the VI server options (note that this is a project-specific setting). Enable TCP/IP on some non-standard port (the LabVIEW default is 3363, so try perhaps 13363). Then make sure your local machine is allowed to access the necessary VI. In your web method VI, open your application reference to that port on "localhost" (the local machine) so that it will use TCP/IP, not ActiveX. Finally, open the VI reference by name (the simple VI name is sufficient). This should get you a reference to the VI, in the correct application instance, so that it will get a reference to the correct queue.

    As you have probably already have figured out, you can add a string output terminal to your web method that contains the error status message; that way if the web method does generate an error you'll be able to see it easily. I found this to be very helpful in debugging a web method.

  17. QUOTE (NeilA @ Oct 15 2008, 12:44 PM)

    Another quick question then, of the examples you gave for variables etc which would be best to use in an event driven system like a QSM or AE.

    I need to build this based on a slick GUI for local use to automate testing but with probably 50% remote use also. So I thought that the base of a QSM-PC form would be best so that I can have a few parallel queues for test data, status of testing etc. So it is important to pick an adequate variable type.

    As you may be able to tell I am on a very sharp learning curve at the moment. I realise I am asking akward questions when you dont really have much of a clue what I am doing so thanks in again for any help!!

    Neil.

    Without a lot of information about what you're doing, here's my suggestion: use your queue-based system, and allow the web service to insert items into your queue. You can do this by creating a VI that executes in the same instance as your test executive that simply obtains a reference to the queue (named queues make this easier), places an item into it, and then releases the queue reference. Enable VI server and allow access to that VI. In your web method, open a reference to that VI through VI server and run that VI by reference, passing it whatever values need to be inserted into the queue. You may have to experiment with VI server for a while to get this to work - I suggest enabling TCP/IP specifically for your project (right-click on My Computer in the project explorer) and assigning it a unique port.

  18. QUOTE (NeilA @ Oct 15 2008, 11:42 AM)

    I have a need to have an executive program which will be fed by a web service. For example I will have a remote computer running a sequencer that calls for example an execute method on my machine that will start a test on RF equipment based on a test number. Now my first problem is that my company is already getting some one to develop a SOAP to Restful service converter so that the services can be called in my program.

    I have read and read through info on the net and tried examples etc and cant work this out.

    What I cant fathom in my stupidity is how do you get the VI to run within my executive VI. From what I can tell from what I have played with so far, the VI doesn't seem to execute it just executes the method called and gives you the output vi HTML in the web client you make the request from. I need the outputs to be passed on to the later items in my executiv VI.

    The idea of using web methods is so that the system is effectively idling while no messages are sent so I don't want to be pollonig outputs of a VI etc. like using event structures instead of timed while loops.

    I may be being totally silly but I cant figure this out.

    I am having to figure out lots of things I don't know anything about in my new job and I think I have stewed my brain.

    Many thanks in advance.

    Neil.

    Hi Neil - NI doesn't make this as clear as they could in their documentation, but a web service VI executes independently of other VIs. For example, if you build a web service into an executable, you'll have one VI that runs as your application (in your case, the "executive") and another web method VI, and even though they're part of the same application they run separately. You'll need to implement the communication mechanism between the two of them yourself, using shared variables, VI server, shared files, etc. I don't understand exactly what you meant by "the VI doesn't seem to execute it just executes the method called" but if you provide a more detailed explanation or screenshots of your code, someone here can probably help you determine the best way to set this up.

×
×
  • Create New...

Important Information

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