Jump to content

Neville D

Members
  • Posts

    752
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by Neville D

  1. OK another question, this one is probably also really easy to answer, but for some reason I can't figure it out.

    In the picture below you can see that i'm getting data from the serial port and building an array with said data. I want to do other things with this array (I have another case structure connected to a different button, that I want to write this array to an Excel file with). But since the array "exists" within the True case of the structure below, as soon as the button goes off again we're in the False case where i'm forced to wire an empty array, which the rest of the program effectively sees all the time.

    How do I fix this? Thanks.

    post-5323-1150814125.jpg?width=400

    EDIT: Creating a Local Variable in the False case linked to the array in the True case and wiring it to the output, works. Is there a better/more widely accepted practice?

    Avoid using Local variables with arrays. Every local variable forms a copy of the data, and large arrays means lots of copies, and lots of calls to the Memory manager which can slow things down.

    You can also get race conditions if you have locals littered all over the code with multiple reads and writes occuring in different loops.

    Use a shift register that is intialized to an empty array to carry your data from the true case through the false case.

    Neville.

  2. Recently I created a vi to make window semi/full transparent. I don't know if this function already exists somewhere, but anyway it's free. And I post here now.

    Irene

    Hi Irene,

    there is a new VI 'transparency' property node in LabVIEW 8.0 to do just that.

    See: Examples>New for LV 8>TransparentVI.vi

    Neville.

  3. Basically almost every LabVIEW application I have written so far spends probably about 99% of its CPU time waiting for user input events and in doing so causes a real CPU load even on lower end machines of a few %.

    And there are similar other applications. I really seldom have seen any of these applications peak even a single time close to 100% CPU time other than when switching from a different application to that application on older low end machines when all the user interfaces need to completely be redrawn.

    Rolf Kalbermatter

    I agree, but one area that requires every bit of speed and optimization is image processing. The CVS is woefully underpowered for all but the simplest of vision applications and even with a PXI chassis or desktop PC, speed is always a concern.

    It is these applications that can benefit from tweaking of the LV code, or sometimes even a transfer of key parts of the code to a dll seems to speed things up by factors of 20-40%.

    It would be nice if NI got LabVIEW RT to work with the new INTEL dual-core processors.. <sigh..>

    Another area of improvement would be the screen redraws that you mentioned. Hardware acceleration support for a few graphics cards would really help with graphically intense panels that are sometimes required.. I once had a monitoring app that had about 15 tab sheets with 45 plots all told! All at customer request. The app once slowed dramatically because I put a decoration box around some plots but forgot to "move to back" and that transparent redraw was the final straw on the camel's back.

    Neville.

  4. program works only on some computers and the others is not working....I dont have any idea where is the problem...Is a simpe vi program that read from a files some data and realise some graphs..(sine,cos, FFT, WignerVille Transform,Wavelet transform of that data input from that files...)

    Thanks a lot and i Hope you can help me....

    Are you loading the exact same version of labview? If you have developed the VI with the Full Development System, and are opening it with the LabVIEW Base version installed some of the additional functions won't be there. I think FFT is not part of the Base version (I may be wrong).

    Else you might not have installed the additional toolkits (Wavelet Transform DEFINITELY needs the advanced signal processing toolkit) which are on a different CD.

    Neville.

  5. Yes thats how I've been doing it. Unfortunately, it doesn't work. All the error messages from post 1, were under those circumstances (post publishing+attempting to view VI from server machine)

    What version of LV are you using? What Browser? What URL were you typing in? What error message if any were you getting?

    You might try:

    from another PC that has LV loaded on it, try to see if you can connect to the remote panel of the VI on the server. Remote panels use the LV Web Server as well. If it doesn't work, it implies some IT settings are incorrect on your network.

    Neville.

  6. Hi,

    I have designed a VI for a LAB. Now I need to enable it to be accessible on the network, so as to control it remotely. Here comes the problem, I have enabled the server, selected my VI under embedded viewing mode, when I try to preview it in the browser I get "This page cannot be displayed". If I save it and then try using the network URL, still the same error. Then If I even try to access it manually from the directory, I get an error of a different nature: Invalid Server IP address.

    That is very strange, as I checked the computer IP address (ipconfig) and it is the same as the one in the options ( labview automatically detects it ). As for other options such as TCP/Ip I checked the enabled button and entered the port 3333 ( as a random number ), on machine access I have a *, on exported VI's I have a *, in configuration I have enable web server checked, with default http port 80, under visible Vi's i have a *, and under browser access I too have a *.

    I also tried unplugging the computer from the Uni network and plugging it into a linksys router, but no luck.

    I don't understand why I cant' resolve the error and move any further ? Help would be most certainly appreciated.

    Andalusian

    Did you first publish the VI's using the web publishing tool? This creates the html document on the Server which can then be viewed/controlled by a client.

    Use Tools>>Web Publishing Tool to first create the html document of your VI.

    also, as a troubleshooting tool, try to access the front panel of the VI from the local (server) machine itself via a web browser. If this works, then its probably some configuration settings on your intranet, and your IT person might be able to help.

    Neville.

  7. He he :D

    I see the point about the C compiler. It will make labview something it is not supposed to be (although the point is more of a religious one than a practical one :) ) But then again, whats the point of a matlab clone (mathScript)? I would think that this is an even greater undertaking and is certainly making LV something it is not :laugh:

    The idea with the mathscript node is if you have a few functions already written in Matlab, you don't need $5k Matlab licence to run on multiple machines; just cut and paste the matlab code into the mathscript node.

    I like it.. its like having Matlab for free on your PC!

    Neville.

  8. Only to be able to modify the images associated with about 200 customized buttons of one vi automaticaly. Then if I modify my images (that are also automatically generated by other means), I'm not to modify each control manually wich is certainly a good wrist exercise, but not very interesting.

    I'm ok if you have any solution with or without scripting.

    Salutations

    Are the 200 buttons the same or different? If the same, replace them all with a strict type def button, and then any changes you make to the typ-def'ed button will propagate to all of them.

    Neville.

  9. Hello Didierj,

    At first, thank you for your fast reply! :worship:

    Regarding the PID task which should running at 150 Hz is not a big issue because the output (DAQ OUT) is forwarded to a servo controller which has a much faster PID controller by itself. Some tests already show me that the PID task is "very" stable.

    I was more curious about the fact how people deal with "communicating" between the different processes (DAQ reading, PID controlling, DAQ writing, etc.).

    In LV there are a lot of possible solutions for that kind of projects I think, but maybe people have some good experiences with a certain approach? Maybe someone has some examples of similar projects?

    Thanks in advance.

    Regards,

    Maarten

    Just to simplify matters, I would sample everything at the highest rate required, and reduce the sampling rate when either writing to file, or displaying on a plot. There is a decimate array function that you can use to display/write every 10th (or whatever you choose..) point. You anyway won't be able to sample at different rates on channels if you are using the same DAQ card, since they use the same scan clock.

    Synchronizing data from different sample rates and writing them to files is quite difficult and ultimately not worth the effort. Write everything at a high sample rate to start with, figure out what is the lowest sample rate you can live with and write all data at this rate to 1 file.

    Make the PID loop a timed loop that wakes up when data is ready for it to process.

    Read and write data in chunks of 500 to 1000 pts instead of trying to read points individually and writing to file.

    I think you will be ok with windows; no need for any RT hardware, so long as you don't try to use excel, check your email and browse the web at the same time.

    In the past, I have written a sort of DAQ daemon. It is a separate simple VI that just reads the AI channels at a fast rate, and writes averaged data to a Q. You can call this VI in a sub-panel (so you can see its working). The main app reads the DAQ data from Q and processes it.

    Analog Output is best used software timed. Read AI, process, spit out AO value, within a timed loop or regular loop with a wait until next ms multiple block.

    Neville.

  10. Does the Advanced PID block in the PID Control Toolkit (v8.0) come with external reset as promised? I can't find any way to make it work. I get problem with reset wind-up using two PID Controllers in cascading loop.

    I'm not sure if this will help, but according to the PID User Manual, the anti-windup is already built in to the PID vi's.

    Neville.

  11. Hi all,

    I have been following this forum for quite some time now. This is my first post though.

    I have a front panel with some string controls. I would like to restrict the user from entering some special characters in them. I would like to know if I can display him the tip strip programmatically whenever a special character is entered. I can show him a dialog box but its really annoying.

    Justin

    Hi Justin,

    Use the event structure to find when a control is being updated, check the input string and then write your warning message to the property node>tip strip of the control.

    Keep checking with the event structure, to clear the tip strip (write an empty string to the tip strip property) when the user adjusts the input again.

    You know, this is the perfect use-case to implement an X-Control! then just propagate your X-control for the number of string controls you have on your panel.

    Neville.

  12. Dear Alex,

    Can you tell me which update I need to install to prevend that Inport or Outport problem???

    I am using the Outport and when I install my application + labview runtime 7.1 I get the error "error 25 occured at outport32.vi possible reasons: Labview externel code not present"

    thanks in advance,

    Aquila

    Aquila,

    goto the NI knowledge base and type in inport NT and you should see the patch that you require to install on NT machines to make it work..

    As far as I remember the patch was only required for older versions of LabVIEW.. but I may be wrong.

    Neville.

  13. I'm new here and am new to LabVIEW. I am a robotics hobbiest and am considering purchasing LabVIEW 8 Student Edition to advance some of my projects. As a student, I qualify for the cheaper edition, but am always leary when a $1,000 to $4,000 software package sells for $80. Is it the same? What are the all of the additional parts, add-ons, modules surrounding the full, Professional editions? Pretty clueless, eh?

    Which brings me here. . . I'm looking for a more straigtforward approach to developing the networked, I/O functions associated with telerobitics and so far, it appears LabVIEW may be the answer. Initially, I'm hoping to do the following: Link PCs wirelessly, share data back-and-forth between them, utilize the serial and USB ports for general I/O functions, and have graphical representation of signals and running processes. I would also like to add real-time video and some automated control loops for local control.

    The Student edition is the same as the FDS (Full Dev. system) which has most of what you need except the ability to build standalone executables. For that you need to add the Application builder. Otherwise you need to install the LV environment on every machine that you want to run your code on, and that could violate your licence agreement.

    The Developer Suites include a lot of toolkits and addons thrown in, which are not part of the Student Edition. for example the Dev. Suite includes

    -Database Toolkit

    -Internet Toolkit

    -PID control Toolkit

    -SPC toolkit

    -Report Generation for Microsoft Office Toolkit

    -State Diagram Toolkit

    etc.. but I think you don't need any of them for Robotics projects.

    One thing is that the Vision stuff sells as a separate module to LabVIEW. This is not a part of the Student Edition, and is VERY expensive. You need licences for the 1394 driver to acquire images, and another to process the images (Vision Module), and a run-time licence if you ever deploy the application as an exe. So I would leave out the Vision part of your experimentation, unless you have access to it at your University.

    For communication I would stick to serial for now. Note that you cannot use the USB port for general purpose IO. USB requires a system level driver to be installed in Windows for each USB device. You can use the NI-VISA libraries to talk to any USB Test & Measurement device.

    Read the NI documentation, it is for the most part, well-written.

    Good luck and have fun.

    Neville.

  14. Hello All,

    I am using SCXI 1520, Terminal Block 1314 and DAQ 6035 E Card, for Strain Gauge Measurement.

    We have got a Strain Gauge of 120 Ohm with the NI Hardware which was connected to CH02(One of the 8 channels provided), Now my problem is that if I connect the Strain Gauge to some other channel(except Channel 2) I am not able to get any readings , and if I reconnect it back to Channel 2 it gives prorper results.

    I have connected the strain Gauge in a Quarter bridge Configuration(obviously for a Single Strain Gauge) as per the circuit diagram provided correctly.

    I have Pentium -4 , 256MB RAM, Win XP SP2 machine.

    Could anybody please try to explain where I am going wrong.

    With Regards

    Have you tried re-initializing your SCXI modules and DAQ card through NI-MAX?

    Sometimes things go funny with SCXI and re-initializing seems to help.

    NI-MAX>Devices & Interfaces>DAQmx Devices>SCXI module <right click and select initialize for each of the modules and the DAQ card as well.

    Hope this helps.

    Neville.

  15. I whipped this up to enable dragging (selected) controls around on the FP while the VI was running. Of course, comments would be most welcome.

    Download File:post-3266-1139872912.vi

    Joe (orko)

    Sorry, but I just don't get why you would want to move controls around while running??

    If you want to display different controls in the same spot, use a tab control with all the controls and flip programmatically to the required tab sheet.

    Neville.

  16. It would be great if I could put markers into my chart to so the user that a condition had been met at that point in time as the vi is running. I was hoping to find a property node that would mark in a chart. I guess I could change the type of point displayed and then change it back to the default point on the next iteration. I think Labview should have this built in somewhere. Any ideas?

    Thanks,

    Eric Nelson

    Add another plot to your chart, which plots 'NaN'. Add a point to this plot only when it satisfies your condition. This way special points will show up with a different marker.

    You can add a different plot with a different marker to satisfy more than one condition (upper and lower limits for example).

    There is an example under charts somewhere in your LV examples.

    Neville.

  17. Thanks for your quick response!

    - It's a multimeter, powered by the public electricity grid.

    - A PC

    - Native Serial Port, 9 pins

    - The problem is that when I want to look where in the code the program stops, it starts running again! So I don't know....

    - I have LabVIEW 6.0 and use the Serial Read VI's

    Joost

    I think in the LV 6 you could use either the VISA Serial functions or the old-style serial functions. Try using VISA. Also, upgrade to the latest VISA version (3.4 ?) from the NI website, after making sure it will work with LV 6.0 (it mostly should, but pls confirm it).

    Also, post a code snippet if you can.

    Neville.

  18. Hi again,

    Sorry, I'd forgotten the question. :rolleyes:

    Does anyone have experience with any of this DAQ?

    Any feedback will be appreciate.

    Thanks in advance.

    Jose.

    Take a look at:

    Low price USB DAQ

    Are you planning on using with LabVIEW Linux? I am not sure if they provide linux drivers.

    PS I have never used this product but it looks interesting, and the price is definitely right!

    Neville.

  19. Hi guys,

    I've the following problem:

    I read values from a multimeter with RS232 via the Serial input port of the computer. Every second I want to save this value together with the time in a text file. All this is running fine, but after a while the programs doesn't do anything, but it is still running. I measured the whole weekend and I saw in my text file that there was sometimes a gap of a few hours. So it starts running by itself.

    Once I saw the program was doing nothing (when I checked if everything was fine), I moved the mouse and after a couple of seconds, it starts reading values again.

    Does anyone know how to solve this problem?

    Thanks, Joost

    can you describe your hardware a bit?

    1 which DMM? (Is it externally powered or battery operated)

    2 Laptop or PC?

    3 Native Serial port or USB-Serial adapter? (what brand)?

    4 Where in the code is it stopping? at the Serial read or the file write?

    5 What version of LV ? (using VISA serial functions or old-style serial functions?)

    etc.

    This will help you and us trouble-shoot your problem.

    Neville.

  20. I need to write a LV (6.1) program to get data from 5 32-bit IO cards (some PCI-6601 and PCI-6602). I have written the program, which reads one particular line (trigger) every, say, 1ms using a while loop. If a trigger is detected then data from all the cards are fetched.

    However, the program has some memory leak (4 to 8k/s as seen from windows task manager), so I am thinking of removing the while loop or at least reducing the number of loops.

    So, is it possible to do the same thing without reading a line frequently? for example, passively waiting a trigger to come?

    Thanks in advance!

    Raymond

    Hi Raymond,

    It might be possible to use a PFI pin as a digital trigger, and then configure your acquisition to start as soon as a "high" is received on the PFI pin.

    You can also, in theory, internally hook up all your DAQ cards together using the RTSI bus, so that a trigger on one, triggers all the cards. You will have to buy the RTSI cable or build your own.

    That way your acquisition is truly hardware triggered, with no S/W polling in loops.

    Look at the DAQ Hardware trigger examples, and the RTSI bus examples in LV.

    Neville.

  21. Hello,

    I made an .exe file in LV8.0 (PDS). On the PC where LV is installed the programm is running. On another PC without LV,

    the .exe file will not start because of "lvanlys.dll is an forbidden Labview file" (needed in mean.vi). The lvanlys.dll is in the same directory as on my "Labview" PC.

    Can anyone help me with this???

    Many thanks in advance

    Ulrich

    You need to build the exe making sure to include the analysis functions before starting the build. In the past to get past this rather annoying error, I have just written my own Mean.vi like so:

    NevilleDownload File:post-2680-1137789746.vi

  22. But what would be a decent architectural way of moving data to the FP of ther other VI? Since the datatypes are always changing, maybe it is desirable to use the subpanels ,though. But when you say move the data to the UI, what are the best ways for doing this? I figured I could send some references to the acquisition program, and send raw data to the UI that way, not sure if this is the best way.

    BTW - does anybody else think that the LabVIEW manuals tend to be pretty bad for describing functionality? Ie, I don't have any idea what the Data Sockets do or how to use them, and I also find their descriptions of thigns that could be useful like the TDM and INI files to be pretty bad too.

    There are a number of ways to get data from a daq loop to the UI:

    1 An LV2-style (functional) global.

    2 Using a Q to write data from the DAQ loop to the UI loop.

    Take a look at the various Design patterns under New>Design Patterns.

    Yes Datasocket documentation should be cleaned up a bit.

    Datasockets are a way to communicate with a LabVIEW program on a different machine across a network (intranet or internet), without having to develop your TCP/IP communications from scratch. You can get up and running very quickly with it, but it does have a few quirks.

    Neville.

  23. Everything you mention sounds true. It makes sense. I am stuck using LV4. Thanks for the comments.

    Talk to your local NI Rep. They should be able to give you old versions of LV (assuming you have a current LV 7 licence) so that you can go all the way back to LV 4.

    Alternately, they might be able to transfer it for you if there aren't too many VI's.

    Sorry, did you say "UNIX"? Are you trying to get to LV 4 UNIX version? that might be impossible unless your code has no platform specific VI's (DAQ?/toolkits etc etc). I don't think NI support HP-UX any longer. Now its only Windows, Mac and Linux.

    Neville.

×
×
  • Create New...

Important Information

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