03-10-2017 10:13 AM - edited 03-10-2017 10:20 AM
Hello everybody,
I just started LabView last week and I am trying to do an ECG. What I would like to do is 3 buttons, one to add a patient and save data in a subVI, an other to stop and the last one to see the signal. I use an event structure to do it. The signal is a row of numbers that I read with "Read meas File".
My problem is that when I click on the button to see the signal it displays only one point and I would like to see the signal moving like a real ECG.
Thanks
Solved! Go to Solution.
03-10-2017 10:27 AM
PierBJX,
As you are new, please attach code when asking questions such as this. You're more likely to get help, and the help will be more useful.
-DR2
03-10-2017 10:28 AM - edited 03-10-2017 10:29 AM
DR2,
I modify the message to add the .vi, is this code you talk about ?
03-10-2017 12:36 PM
Yep, that's it! 😉
Looking at your code, I believe that a Simple State Machine would suit you well here. You wouldn't be pigeon-holed into packing your code into an Event Structure. I am going on the assumption that you don't need to continuously display data.
03-10-2017 05:26 PM
Some more comments:
03-10-2017 10:03 PM
altenbach wrote:
- Please never maximize the front panel and diagram window to the screen. That's very annoying!
Sorry for derailing a little here, but I've seen you say this a few times (and I also find opening full screen VIs annoying - hitting Ctrl-T by accident invariably a frustration) but does LabVIEW save VIs differently when full screen? I can imagine if they're saved by position/bounds (i.e. pixels) even a high-res screen being loaded on a low-res screen would be problematic. Is full-screen different?
03-11-2017 06:12 AM
What do you mean by using a simple state machine ?
I am already using a event structure, no ?
03-11-2017 06:36 AM - edited 03-11-2017 06:37 AM
altenbach thanks for your help very useful!
- What do you mean when you write "There is a +1 primitive" ?
- Instead of using the timeout event to scroll data maybe I could use a loop with a stop, what do you think ?
- I just want to create a new user and I am using a subVI and it works, I just a simple create file, write file and close file.
- Sorry for the screen 😕
- I attached the typical data file
thanks
03-11-2017 11:04 AM
PierBJX wrote:- What do you mean when you write "There is a +1 primitive" ?
See here. No need for a "+" and a "1" diagram constant.
PierBJX wrote:- Instead of using the timeout event to scroll data maybe I could use a loop with a stop, what do you think ?
Don't over-complicate things! You already have a while loop to spin the code. That's all you need. If you trap the code in an inner while loop, you interfere with the event structure. And if you use a parallel while loop, you need to implement inter-loop communication and such.
I'll have a look at your file....
03-11-2017 11:48 AM - edited 03-11-2017 11:51 AM
Here's a simple illustration of using Q&R and the timeout event. Pressing the ECG button starts or stops the chart.
(In the final program you should have an event to load new data and then keep it in a shift register, of course)