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. Hi,

    Is there a way to programmatically detect if there is one or 2 (or more) screens connected to the computer ?

    What I'd like to do is to detect the presence of a second screen, and if it's connected display a window on the second one.

    I guess it will be different on Windows and MacOS X, so my question is for both of them ;)

    Any idea ?

  2. QUOTE (Eugen Graf @ Jun 24 2008, 10:06 AM)

    Check out http://forums.lavag.org/Event-Value-change-during-the-change-and-not-at-the-end-t7388.html&pid=28049' target="_blank">this thread for some ideas.

    Once the mouse down is detected, move a hidden off-screen ring to over-lap the cell and set screen focus to it.

    Just trying to help,

    Ben

  3. Hello,

    I am writng a vi to simulate the keyboard. basically i need to send in some commands to a Hardware (running linux) using plink.

    i could not do it by using the System exec.vi and hence thought let me write a vi which will open up a "cmd" (command line prompt) and let me type what i need to type in it using LV. So i am using the user32.dll for accomplishing the same

    I manged to get 60% of the vi but do not know how to simulate certain keystrokes like " / ? * ^ & and other things.

    one thing i found that to simulate the * (which nothing but "shift" followed by "8") u have to pass the value 16 (for shift) and 56 (for 8) but dont know how to perform the ? or ? operation.(pasing ascii equivalent * as 42 didnt helped me)

    Please see the attched vi...Its very basic (i didnt managed to write it in a professional way :) )

    also loked at the ASCII table but some of the decimal equivalent values didn't helped me out...

  4. QUOTE (jjylf @ Jun 24 2008, 11:21 AM)

    If you execute in highlight mode you will see why it can't work :)

    QUOTE (jjylf @ Jun 24 2008, 11:21 AM)

    I removed the stop button connection, and it worked. Thank you very much!
    :D

    You're welcome :)

    There are different way of stopping several loops with only one button, do you need help on this ?

  5. QUOTE (jjylf @ Jun 24 2008, 10:58 AM)

    Hi.

    I am programming a VI that mainly consists of three while loops:

    (1) The main while loop takes input from a java program (TCP/IP) manipulates the data and puts it in the queue.

    (2) The second while loop deques elements and sends it to an electric motor.

    (3) The third while loop gets input (meassurements) using the DAQ Assistant express VI and sends it to the java program (Also TCP/IP, different port).

    Developing this program I first made two while loops, (1) and (2), and it executes well in paralell. Then I added the last (3) while loop for meassurements and it won`t execute. Not untill i press the stop button for the first (1) while loop. But I want all three to run in paralell.

    I`m using the "Wait Until Next ms Multiple" VI with 50 ms in all the three while loops. I do this because the sampling period from the java simulator is 50 ms.

    Any suggestions to what might cause the last (3) while loop not to run will be greatly appreciated. Thank you.

    Hi jjylf,

    Can you post a screen shot of you main diagram (the one with the 3 while loops), it sounds like there is a dependance between loop 1 and 3, that could explain the behaviour you described.

    Hope this helps

  6. Hi.

    In one of the posts I saw something called as "PIPES" which is a part of Labview for Linux version.(which was seen under "Connectivity->Libraries and executables)

    Is the same thing available on Labview for Windows also? How can i get the same?

  7. QUOTE (PaulG. @ Jun 20 2008, 07:58 PM)

    I've seen it. It's the part where the official-looking guy appears and says: "If you have seen this person contact INTERPOL at ..." :)

    Well... Am I that famous ???

  8. Thanks all for your replies,

    QUOTE (Tim_S @ Jun 19 2008, 09:10 PM)

    My first idea is to use FPGA based hardware. I'm guessing you're locked into the hardware you're using, though.

    My second though, and I've not investigated what's possible here, would be to leverage counter timers to as to provide a triggered reset line for, say, 100 msec (think of a off-after-delay relay). I'm assuming you have a PCI-6221 instead of a PCI-6227 (can't locate a 6227 on the website); the PCI-6221 doesn't have any counter/timers, so that's out.

    My third-and-least-favorite thought is to keep your loop timed to work at, oh, 20 to 60 Hz (166 msec ~= 6 Hz, so this is at least double to 10 times the rate) and programically re-arm the trigger. This option is entirely at the mercy of the operating system.

    Good luck.

    Tim

    I'm not locked to the hardware I have, I have a 6221 (not a 6227 which doesn't exist, sorry) because I'm acquiring different signal, but if there is a need for another board I still have a free PCI slot in the computer.

    FPGA... well I though about it bit I'm really not familiar with and I'd prefer a DAQmx solution, RT is also something I'd like to avoid even if I lose a bit in time accuracy.

    I like your second idea (counter timers so as to provide a triggered reset line for, say, 100 msec (think of a off-after-delay relay)) I though this could be configured in the DAQmx task setting but I didn't find it. Anyone knows it is possible and how ?

    QUOTE (neB)

    How about configuring a triggered acq and set the post trigger size large enough to get the second two chirps.

    Anther trick that may help is to set-up (configure but do not start) two acquistions for the same channels but only arm one at a time. When one is trggered, arm the second, etc.

    Just sharing ideas

    As I said I've looked for a LabVIEW example that does this but didn't find - I might have missed it though. Do you know how to code this ?

    I hadn't thought of 2 acquisitions, one at a time ; I'll keep this idea in mind :lightbulb:

    QUOTE (Yuri33)

    Rectify and smooth the signal, that way, you only get one trigger per sound packet. If you need to make things as fast as possible, pipe the processed data back into an output channel and configure the appropriate analog trigger parameters.

    Or alternatively, if the noise is occuring at a specific frequency, there is a single tone frequency detector VI in the signal processing palette. I believe the VI has a window size parameter, so you can have it process data in packets large enough to contain an entire packet of sounds at a time. You could then generate a software trigger when you detect your particular tone.

    Hmmm.. At the very beginning I thought I could trigger both the video camera and the sound acquisition at 4kHz (get one image per trigger with the camera and 10 sound sample at 40kHz per trigger), do some signal analysis to find the noise pattern, get the buffer of the moment it started and get the corresponding buffer on the camera.

    I gave up this idea thinking that it would be alot easier to do with DAQmx and also the noise pattern can be very different from a type of watch to another so I'd have to modify the analysis for each type of watch.

    Good idea anyway :)

  9. Hi there,

    I am facing a problem.

    I need to login to a Panel (running Linux on it) using plink.

    I am using the "System Exec.vi" to open up a secure port using plink and getting the needed information, for example to list the "files" in one of the directory i would issue the command

    plink 10.47.101.22

    cd /opt/MAP/etc/db/

    ls -al

    exit

    exit

    And i am getting the response without any problems.(a new shell gets opened, and closes when the job is over)

    Now the problem is there is a "database" in one of the folder and i would like to view/modify the same using "msql" commands. So I log in to the panel, go to the location where the database exists and issue the commands (this how i work manually)

    But if i use LV and the System exec.vi to issue the command as shown below, A new "shell" opens (like u are opening a command prompt window) and it does not comes out. I have to manually go close this shell to gain the control back.

    plink 10.47.101.22

    cd /opt/MAP/etc/db/

    msql -d Users.bdb -o guru.txt (to create text file called 'guru.txt)

    select * from UserTable ;

    .q

    exit

    exit

    Now is there any solution to avoid this so that my vi can continue executing without any issues?

    Is there any other tool or something is available to perform such operation?

  10. QUOTE (Gabi1 @ Jun 20 2008, 09:05 AM)

    How many times did I forgot to set a boolean constant in a case to 'true', leading to an infinite loop condition??

    in some project the run time is long, and therefore debug time is exponential: why not allow code change while program is in 'pause mode': i discover a bug - dont want to restart the whole process - pause, change the wire, structure or element - and then continue running.

    It is possible in VB for example. works perfectly there.

    Why not in Labview?

    I think this is already planned. I heard of it but I don't remember where...

    Didn't NI (tried to) show this at the last NI Week?

    So in future (what ever future means) you can "just" edit a running programm... :thumbup:

  11. QUOTE (Aristos Queue @ Jun 19 2008, 03:39 PM)

    Note to self:

    Include man-eating rabbit in all future demos VI's.

    post-29-1213905393.gif?width=400

    Which reminds me...

    1) Has anyone else ever seen the video "Pets or Meat?" It was a short included in Michael Moore's "Roger and Me". Crelf, you're hailing from that teritory. You must have seen it.

    2) Does mistreatment of stuffed animals count toward the man-eating rabbit req? My wife thought it was cruel when I derivated a bear.

    post-29-1213904969.jpg?width=400

    Ben

  12. QUOTE (Antoine @ Jun 19 2008, 05:56 AM)

    Hi all,

    I am acquiring an analog signal with A PCI 6227 board at 40kHz, this signal comes from a microphone that measures the sound of a mechanical watch.

    As you can see on the graph below, every 166ms we see the same noise pattern that correspond to 3 shocks in the mechanism.

    I have a DAQmx task to acquire this analog signal. This is basic DAQmx.

    http://lavag.org/old_files/monthly_06_2008/post-7452-1213869344.png' target="_blank">post-7452-1213869344.png?width=400

    Now I'd like to go one step further and generate a trigger on a digital output ( to trigger an image acquisition) "as soon as possible" after detecting the first noise of the pattern.

    I'm not really familiar with DAQmx, and I don't really know what is the best way to go.

    I've tried to set a trigger generation on the threshold and to set it as automatically retriggerable, but then I get a trigger for the 3 peak of the pattern ; I'd like only one trigger on the first peak.

    Any ideas ?

    This is admittedly a "hand waving" answer.

    How about configuring a triggered acq and set the post trigger size large enough to get the second two chirps.

    Anther trick that may help is to set-up (configure but do not start) two acquistions for the same channels but only arm one at a time. When one is trggered, arm the second, etc.

    Just sharing ideas,

    Ben

  13. QUOTE (Yren @ Jun 19 2008, 04:20 PM)

    guys, i m doing speech recognition using labview for my final year project. Can anyone guide me on this ? thanks a lot and appreciate it much. :worship:

    Hello,

    Well... First question : have you ever used LabVIEW on other project or are you completely new ?

    Speech recognition... Ok, that's vast... what exactly do you want to achieve ? Could you tell more precisely your goals, I guess you don't need a LabVIEW program that writes what you speak-up :rolleyes:

    On what part do you need help ? Maybe on acquiring sound ? Maybe on processing the acquire signal ? Maybe something else...

    Do you know what hardware/software you'll be able to use ? Do you need advice to choose them ?

    A well set problem is half solved !

    Help us to help you.

  14. QUOTE (bbean @ Jun 19 2008, 07:27 AM)

    I guess I'm lazy and would like to avoid writing a client LV app if we could use a web browser. Don't know if I'm trying to fit a round peg into a square hole, but wanted to get feedback from others. Wouldn't I have some of the same issues with memory/buffer allocations using a shared variable string? I realize they would help with "keeping it real time" because they have a lower priority.

    thanks

    THe built-in web-page support is still a "Risk factor" in my apps. My customers that have implemented very simple pages for monitoring have reported success. The very complicated GUI's should not be assumed to work without effort or resources.

    The methods mentioned by Neville (maybe not shared variables, I don't they are ready for prime time yet) are approaches that I would turn to if I wanted to be comforatble with the success, since I can control all of those factors.

    So include some experimenting with your intended GUI early in your development. You don't want to have to re-write your app after you find that opening the web-page kills your app.

    Just trying to help,

    Ben

  15. Hi all,

    I am acquiring an analog signal with A PCI 6227 board at 40kHz, this signal comes from a microphone that measures the sound of a mechanical watch.

    As you can see on the graph below, every 166ms we see the same noise pattern that correspond to 3 shocks in the mechanism.

    I have a DAQmx task to acquire this analog signal. This is basic DAQmx.

    post-7452-1213869344.png?width=400

    Now I'd like to go one step further and generate a trigger on a digital output ( to trigger an image acquisition) "as soon as possible" after detecting the first noise of the pattern.

    I'm not really familiar with DAQmx, and I don't really know what is the best way to go.

    I've tried to set a trigger generation on the threshold and to set it as automatically retriggerable, but then I get a trigger for the 3 peak of the pattern ; I'd like only one trigger on the first peak.

    Any ideas ?

  16. QUOTE (bbean @ Jun 18 2008, 03:28 PM)

    I have to provide a list of events that have occurred during execution of my run-time application to the user. The user will access the RT app via Remote Front Panels. The events are described by a timestamp and a string. And don't occur that frequently (once a minute) For example:

    10:30:04 - TEMP ALARM - ZONE 1 - TEMPC = 30

    10:31:04 - POSITION MOVE - 33 mm

    etc

    etc

    I'm trying to determine the best method to store and display the data in LV RT. Here are the options I've thought of:

    Datatype / Storage Method / Display Method

    1) string / FIFO string buffer of 100 lines LV2 global / string indicator on FP (limited to 100 lines) (I know there really isn't a front panel in LV RT)

    2) Cluster of timestamp & string / 100 element queue / array of datatype on front panel

    3) string / event file / string indicator on FP (limited to 100 lines)

    If I use 1 and (a string indicator), I'm worried about it sucking up CPU resources and memory to limit the size of the string to 100 lines.

    For option 3, I thought I would read the last 100 lines into the string indicator on the FP everytime a new event occurred (it has to be written to the file anyway).

    Any suggestions?

    I and my customers have been burned by strings in RT apps running of FP units.

    Try to avoid strings completely. If you have code that always returns the same string, concider using an enum to display those strings.

    I have used LV2's set-up as round-robin buffers to do what you are attempting.

    AS you are developing watch your memory usage over extended periods of time. THe run out of memory issue will sneak up on you if you don't.

    Ben

  17. QUOTE (limhj @ Jun 18 2008, 04:26 PM)

    Hello Antoine,

    Thanks for the tips. I could not find any examples from the help search using 'imaq' as keyword. Maybe I have not installed them.

    I'm not sure you can uncheck the examples when you install... Anyway, if you did it was a mistake, if you have the CD then install them their worth, specially if you begin with LabVIEW ;) .

    Hmmm... Maybe IMAQ is not a good search word, try with "1394", if it doesn't work, you're sure that the IMAQ examples are not installed.

  18. QUOTE (limhj @ Jun 18 2008, 02:47 PM)

    Hello,

    I would like to use NI IMAQ IEEE 1394 to read the image captured using a Basler camera (A601F-2). Since I am quite new to LabView and NI IMAQ toolkit, I am trying to get a clear understand of how LabView, NI IMAQ, and the camera works together as an application.

    I am using LabView version 8.5 and have installed 'NI-IMAQ 3.5.1' and 'IMAQ for IEEE1394'on my PC (Windows XP). My question is as followed:

    Is there a tool or wizard to create, edit or run tasks using the NI-IMAQ (such as the 'DAQ assistant' does for Data Acquisition)? Using DAQ assistant, the interface between LabView and the NI DAQ can be build. But I am not sure how to connect LabView and the NI-IMAQ. Can anyone describe this for me?

    My assignment is to create a VI to capture image from a Basler camera (IEEE1394), calculate the intensity of each point, find the average intensity, and write the intensity output of each pixel in the form of a matrix to a file. Is there an example VI that does something close to this out there that I can use as my starting point?

    Thanks in advance for your answer.

    Yours,

    limhj

    Hi limhj,

    First, if you are new to LabVIEW, I suggest you have a look at the LabVIEW examples, Help >> Find Example >> go to search tab, dial "IMAQ".

    Then, I never use it but I know it works well, you can use the "IMAQ express VI" (I have the express VIs disabled on my LabVIEW so I don't even know where it is located).

    To get the intensity of the pixel, you functions in the IMAQ subpalette and maybe also examples in LabVIEW.

    Try to do the most you can from the examples and then if you get blocked at some point post your problem + your code.

    Hope this helps

  19. QUOTE (irpotential @ Jun 17 2008, 01:15 PM)

    I've been using labview for about a week now and have found several useful posts here, but now need to begin asking questions.

    About me: I'm a physics major doing a summer research program that requires labview programing.

    Welcome to LAVA. You will find more physics types here than you will most other places you visit. If you keep your eyes open you'll an entire thread devoted to mis-application of quantum theory. In fact more than one of us can pick out a picture of Maxwell from a collection AND understand what he was getting at.

    BTW: What school do you attend?

    Ben

×
×
  • Create New...

Important Information

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