Jump to content

scls19fr

Members
  • Posts

    45
  • Joined

  • Last visited

    Never

Everything posted by scls19fr

  1. Hello, I would like to send a string using a serial com when I click on a button (4 buttons are possible) I'm using polling on buttons and testing if string is empty. (see main.vi and buttons_pressed.vi) When there is so many button polling is not a good thing so I'd like to change my code to use events structure. So first I made a minimal vi called ecu_keys.vi I think that I shouldn't set timeout value to 0 because I have a very high CPU usage ! Moreover I don't see the string changing when I click on one of the buttons. I also wonder how I should modify my VI to fit with "VISA Write" Best regards VI are available here http://svn.berlios.de/viewcvs/openphysic/l...bo-wrenturbines or svn checkout svn://svn.berlios.de/openphysic/labview/turbo-wrenturbines see trunk directory I also join the files in this post Download File:post-11213-1207857774.vi Download File:post-11213-1207857765.vi Download File:post-11213-1207857753.vi Download File:post-11213-1207857738.vi Download File:post-11213-1207857711.vi Download File:post-11213-1207857703.vi Download File:post-11213-1207857694.vi Download File:post-11213-1207857685.vi Download File:post-11213-1207857677.vi --- LAVAG is great ! LAVAG people are great !
  2. CITATION(orko @ Apr 10 2008, 08:54 PM) All right I will post it !
  3. CITATION(orko @ Apr 10 2008, 07:43 PM) All right it works fine now ! I don't know why I didn't make this myself ;-) Thanks again I will probably make an other post about the use of events (for the other part of my VI where I send string to the ECU using serial COM when I click on keys DATA UP / DATA DOWN / MENU UP / MENU DOWN) because I know that the code inside the event structure must be very short... so I guess that I shouldn't put READ VISA inside ! Best regards Sebastien
  4. I change the vi to use the event structure It's now much cleaner !!! Download File:post-11213-1207848111.vi I still have a problem with initializing the Express VI / Input / Simulate arbitrary signal The problem happens when I click on Autostart and click on Stop before the end of the Autostart sequence A similar problem happens with "programmed" signals The VI Express need to be initialize when -I click on STOP TURBO -I click on STOP PROG / MANUAL About the producer / consummer I found very informative applications notes on NI site http://zone.ni.com/devzone/cda/tut/p/id/3023 http://www.ni.com/labview/f/power.htm I also found a video (in french !) about it https://lumen.ni.com/nicif/f/webcastlvprogm...7/content.xhtml
  5. Thanks I will try the idea of shift register with boolean. I must admit that the use of shift register is not yet very intuitive to me! About the size of code : I agree with you : it need a good cleanup ! I will use event stucture for managing keys (input keys (START STOP PROG STOP/PROG) http://svn.berlios.de/viewcvs/openphysic/l...es/trunk/input/ test_input.vi I will also do it in the other vi http://svn.berlios.de/viewcvs/openphysic/l...turbines/trunk/ main.vi for managing keys DATA UP / DATA DOWN / MENU UP / MENU DOWN these keys sends string to the ECU using serial COM. So I will probably need something like a queue if I click to many times on a button. What is your opinion about it ? Best regards Sébastien
  6. Thanks for the "restart"... I was trying using a different way (using pin in Reinitialisation) You said me to CITATION I agree with you I know it's not a clean way but throttle is only read in the other loop... So I don't think it's so bad ;-) You also said me to become familiar with how event structures work, CITATION avoid "stretching" the code. If you can't see everything with minimal (or ideally no) scrolling, then it's time to rethink the design. For instance, this app to me is divided into three major parts: front panel events, triggers, and handlers. For this reason... Sorry but I don't understand what you mean (don't forget... I'm french ;-) ) CITATION - Research the design pattern templates and examples that NI has installed for you, especially (for this case) the producer/consumer loop with events. This design pattern fits into a great number of application designs and has become the weapon of choice for me when re-using code that provides a user interface. I would like to find a sample... because the NI sample are nearly empty.... so it doesn't help me very much ! I still have a problem with restart ! If I click on Autostart and on Stop before the end of the startup sequence. It works fine. But when I click again on Autostart the Autostart sequence doesn't start from the beginning Download File:post-11213-1207769988.vi
  7. Thanks again. I will look inside the VI Express But I still wonder what is the best place to initialize the VI Express (put a "true" constant on the appropriate pin).
  8. I modified the VI as said it before. See Download File:post-11213-1207748140.vi Download File:post-11213-1207748151.vi Download File:post-11213-1207748202.vi When I click on Autostart I get the good signal and I can stop it before the startup sequence is finished ! So it's much better than my solution with sequence (as I can't break a sequence !) But I have some problems. If I click on Autostart and I wait for the end of the startup sequence. The state return of manual (that's good !) I can modify manualy the throttle using the slider (that's good too !) BUT If I click on Stop and click on Autostart, the startup sequence doesn't restart ;-( I guess the problem is about initializing the VI Express / Input / Simulate arbitrary signal But I can't initialize it because I such a case there is a loop problem and I can't compile. An other (same) problem is with predefined sequences such as PROG Step/Square I can only run it once. A third problem I about generating a "loop" signal (infinite) when the button loop is pressed. Hopping you can help me. Best regard Sebastien
  9. Thanks for modifying my VI. But I don't like something... 10ms need to be set in to part of the vi (inside the loop Wait until Next 10ms multiple) and in the VI Express / Input / Simulate arbitrary signal I will try now to modify it in order to be able of manually modify output using a slider when the autostart sequence is over Best regards Sebastien
  10. I ever made a state machine for STOP/AUTOSTART/MANUAL/PROG About the way of generating a signal (instead of using sequence) I found this http://forums.lavag.org/Generate-my-own-in...ice-t10532.html Express / Input / Simulate arbitrary signal (not sure of the translation because in french it's Express / Entrée / Simuler un signal arbitraire) so I would have to "break" a sequence ! but I also have some questions that could be answered in this post
  11. Wow ! Not sure of being able to do this ! Maybe you have a link that could explain these patterns (using some use cases) Thanks
  12. See more informations in this post http://forums.lavag.org/Break-abort-a-long...nce-t10544.html I wonder if I shouldn't use something like this VI Express / Input / Simulate arbitrary signal (not sure of the translation because in french it's Express / Entrée / Simuler un signal arbitraire) Have a look at the same VI Express inside a loop while with a 100ms delay for displaying. I wonder was X unit is (ms ? s ? iteration ?). I want a signal 0 to 1s : 0 1s to 1.5s : 20 1.5s to 2s : 100 2s to 3s : 20 After this delay (3s) I would like to be able to modify mysef the value... using a slider... but that's not the problem for now !
  13. Thanks Ross and Justin for your replies. I think I need to explain the facts. First I'm thirty years old and I pass my exams a long time ago ! Secondly, I teach electronic and physics (thermal science) at Poitiers Institute of Technology (France) So, I'm not a "Labview Advanced Virtual Architect"... therefore I'm looking for help here ! (I won't get credits for this !!!! .... can additional credits be changed for money ?) We own a turbojet WrenTurbines MW54 Mk3. This turbojet has an engine control unit ECU / FADEC (Full Authority Digital Engine Control) Using a serial COM I get data (RPM, EGT, pump power) I also add more sensors (like strain gauges to get thrust, like a pression tranceiver to get air flow using a venturi) and a Labjack U12 data acquisition board. We would like to make a test cell for students. For now we modify throttle using a radio controlled receiver. I design an USB servo tester that simulate the radio controlled receiver when receiving data from Labview (using an ATMEL AVR ATmega8, a FTDI chip, Virtual COM Port driver and NI VISA) http://www.celles.net/wikini/wakka.php?wik...steurDeServoUSB Now I'm looking for a way to send predefined sequences. You can have a look at my VI about this part. see the test_input_step.vi The whole project is in a Subversion directory Web access http://svn.berlios.de/viewcvs/openphysic/l...bo-wrenturbines Anonymous access svn checkout svn://svn.berlios.de/openphysic/labview/turbo-wrenturbines See the trunk directory. "Tags" directory also contains some files
  14. Hello, In my VI which is use with a turbojet I use a finite state machine with the following state STOP / AUTOSTART / MANUAL / PROG I can modify throttle manualy (using a slider) when the state is set to MANUAL. I can send a predefined sequence when the state is set to PROG. The predefined sequence for test is for example a self made square signal generated using a Labview "sequence" for example throttle=40 wait 5000 ms throttle=60 wait 5000 ms and so one... When I click on a "STOP PROG" button I would like that the state instantly turn to MANUAL. So my problem, is that now when I click on "STOP PROG" tge state is only set to MANUAL ***after*** every step of the sequence are finished ! If my PROG (predefined sequence) is very long it's not very conveniant as I have to wait the end of the sequence to abord. Is there an easy way to solve my problem ? Best regards
  15. Thanks a lot. I never had a look at event structure before... I use LV since a long time... but I'm still a newbie ! I will look at this because I guess it can be very usefull !
  16. Thanks guys for your very informative posts. My VI is relatively simple so I will use the NI method. But I keep in mind the master/slave sample. Best regards
  17. Thanks you both for your replies... I found an interessting document about this "problem" on NI site Stopping Parallel While Loops in LabVIEW With One Stop Button http://digital.ni.com/public.nsf/allkb/267...AE?OpenDocument
  18. Hello, in a VI I have two parallels loop. I would like to stop the two loops when I click on a STOP button. I tryed two ideas One STOP button is connected on the loop until condition of the first loop and is also connected to the other loop. -> It doesn't work ! One loop is never run. One STOP button is connected on the loop until condition of the first loop and a STOP local variable is connected to the other loop condition. -> It doesn't work ! It can't compile because of the mechanical characteristics of the STOP button. What should I do ? Best regards
  19. Thanks for your reply. I can't use this. Because I want to set my own high delay / low delay For example t=0 to 10s out=100 t=10s to 15s out=10 t=15s to 20 aout=90 and so one... I have make this using a sequence with several step in which I modify a local variable. Some steps also contains a timer object All this is inside a loop while loop
  20. Hello, for an experiment I need to send to a device a low frequency square signal. I want to generate my own input signal for this device. In fact I would like to be able to set the high level delay and low level delay. I don't think the "simulate signal express" can fit to my needs. I believe that I should use a sequence inside an infinite loop while. The first sequence set output to 0 (a numeric float constant) The second sequence wait x seconds The third sequence set output to 100 (a numeric float constant) and so one But I don't know if it's a good way to do like this... Any idea ? I also encountered a problem when I try to send the 2 constants (0 and 100) to a display. I don't know what I should do. Maybe I should use a global variable but I never use it with Labview I hope you can help me Best regards PS: I also would like to generate my own low frequency sawtooth signal (rising phase delay is about 60s)
×
×
  • Create New...

Important Information

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