LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

lag keyboard input

Hi, I have an issue with my first LabView program can anyone help me please?

The function of my program is to manualy or automaticaly save the data obtained with the multimeter

My program worked fine until I wanted to add a file creation function each time the program runs, but the program creates a file every 5 seconds, I have tried using a loop and case but I cant make it work, it still creates a file every 5 seconds.

Any tips?

Aditionaly I have tried to program a keyboard input for the buttons in the vi using a few examples I found around the forum but my program just lags and I cant even start measuring.

I atach my vi for inspection , thanks in advance Smiley Happy

0 Kudos
Message 1 of 6
(2,794 Views)

From the absence of any sort of while or for loop in here, I am assuming that you are using the run continuously button to run this program. This is generally a bad idea, and can be strenuous to run.

 

Might I suggest looking at some example programs and seeing how you can compare them to your program.

 

[Edit]

I've had a quick tidy up of your code, putting it inside a while loop and moving the file generation and MM setup outside of the loop. Have a look at this and see if it runs better.

Message 2 of 6
(2,778 Views)

Hi Joamal:

 

The suggestions made by ogk.nz are correct you need to organize the Flow of your program. The Example sent is a good place to start and I would recommend reviewing the Getting Started Guide For LabVIEW to perfect your design and architectures. You can find it at http://www.learnni.com/

Check the Get Started Here option and on your Far left there will be a display menu where you can Review the Getting Started Modules.

 

Any other questions make sure to post them on our discussion forums

Juan Arguello Director Support Services @NI
0 Kudos
Message 3 of 6
(2,727 Views)

Thanks it actually works pretty well, I didnt knew that I shouldnt use the run continuosly button xD.

 

Now I only have one problem left, and its that the multimeter doesnt change its configuration( V, A, Resis etc) , only when I start the program, I tried moving the config block inside the loop but the multimeter starts to blink, it works but I dont know if it could damage the instrument(reconfiguring every second), so maybe you can help me to find a way to make it work fine?, I tried using an event structure with the option wheel value change as trigger but didnt work well tough, it kept reseting the configuration back to 0(dc voltage) .

 

Any ideas?

0 Kudos
Message 4 of 6
(2,711 Views)

It probably shouldn't damage anythin constantly updating the loop, although it does introduce overhead and is generally not tidy, to avoid the constant updating I would recommend looking into shift-registers or feedback nodes. On that note, I'll leave you with this snippet, I'm sure you can see how it might apply.

 

Feedback Node.png

 

[Side-note; In case you don't know how to use a snippet, download and save the image, then drag the file from your explorer into a block diagram.]

0 Kudos
Message 5 of 6
(2,701 Views)
An event structure is really the way to go. Use a value change event for the controls. The option wheel does not make much sense to me.
0 Kudos
Message 6 of 6
(2,683 Views)