LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Developing a User Interface

Hi,
 
I have been LabVIEW 7.1 PID toolset for about 2 months now. My project is to develop a remote lab to control using PID, the level in a coupled tank experiment. I am using an Ethernet DAQ to log the information using the TCP connection. I am developing a User Interface for other students to log into and use. I am having a number of problem and also would like to add some additional features. The operating system is Window XP, however this is being hosted by a Linux machine.
 
 
1.) I am using a waveform chart, when I get to a reading of 1000, on the scale the numbers to not keep on going, ie i get 0 100..  700, 800, 900, 1000, 1000, 1000, 1000, 1000 .. 2000, 2000, 2000. Why does this scale freeze?
 
Also on the waveform chart I want to have the time scale in seconds however they are in 100ms intervals for some reason.
 
2.) The PID VI is not reseting. I have it in a case statement, but when I stop this case statement and then put new PID values in, the old values are the one that are used. The PID only resets when I stop the while loop that the case statement is in.
 
 
3.) I am trying to have a timer, to record the length of the time since a experiment has started. I am currently using the while loop [i] button to measure the number of iternation, however I need to restart the while loop to restart the timer, which is no good. Are there any other way to do a timer?
 
I want to be able to do some extra features too,
 
1.) Prompt for the name of the file (I know this is easy but cant do it)
 
2.) When I click the start button, (the colour changes) but i wanst the writing to change as well. How do I do this?
 
3.) When I push the start button, the kp, ki and kd values fade out ( you cant enter anything further in them til the student pushes stop)
 
4.) I cant push the start button until I have filled in the Kp and Required Level, control boxes.
 
I have attached my file. If you have a look at my block diagram, would you be able to comment on anything that I am doing which isnt correct, I havent used LabView before and I am doing this project for my Thesis and would like it to work well.
 
Thank you very much,
Duncan
 
 
0 Kudos
Message 1 of 6
(3,420 Views)
I can't answer all your questions, but I will try to do my best...

Also on the waveform chart I want to have the time scale in seconds however they are in 100ms intervals for some reason.

Try right-clicking on the axis and choose Formatting>Scales>x-scale to change the multiplicative value.  Otherwise, use a property node for the graph and set range>increment depending on exactly how you want to accomplish this.

2.) The PID VI is not reseting. I have it in a case statement, but when I stop this case statement and then put new PID values in, the old values are the one that are used. The PID only resets when I stop the while loop that the case statement is in.
 
I don't have this subvi, but open the sub-vi, click on file>vi properties>execution and either select "clear indicators when called" or "make VI reentrant", I can't remember which will do what you are trying to do!
 
3.) I am trying to have a timer, to record the length of the time since a experiment has started. I am currently using the while loop [i] button to measure the number of iternation, however I need to restart the while loop to restart the timer, which is no good. Are there any other way to do a timer?

See  the attached file.
 
I want to be able to do some extra features too,
 
1.) Prompt for the name of the file (I know this is easy but cant do it)

Leave the file input to "Save to file" unconnected.  It will automatically prompt for file name.
 
2.) When I click the start button, (the colour changes) but i wanst the writing to change as well. How do I do this?

Use the paintbrush in the tools window and paint both outside and inside the text region setting the background color (see attached with example changes).
 
3.) When I push the start button, the kp, ki and kd values fade out ( you cant enter anything further in them til the student pushes stop)
 
4.) I cant push the start button until I have filled in the Kp and Required Level, control boxes.
 
I have attached my file. If you have a look at my block diagram, would you be able to comment on anything that I am doing which isnt correct, I havent used LabView before and I am doing this project for my Thesis and would like it to work well.
 
Thank you very much,
Duncan
 
 



0 Kudos
Message 2 of 6
(3,383 Views)

Hi Dunk,

Robert has some very good advice, but beware one thing: Leaving the file path unwired will indeed pop up a dialog asking the user to select a file to save to, but if you are writing data to file in a loop (as you are), it will pop up the dialog EVERY iteration of the loop! I've attached a screenshot below with a much better solution. The idea is to use a file path control instead of a constant, and to leave it blank. You should even right click the blank file path control and select Data Operations >> Make Current Value Default. Then after the VI runs the first loop and the dialog pops up, the file the user chooses will be input into the Write Spreadsheet File VI and then output on the other side. Take this New File Path output from the VI and wire it into a local variable for the file path control, so that it is no longer empty, and subsequent loop iterations won't pop up the file dialog anymore.

Also, LabVIEW has an Express VI called Elapsed Time, available in the Time and Dialog palette. It is usually designed to test whether a certain amount of time has passed yet, but it can be used simply to measure the amount of time in seconds elapsed since it was last reset (it has a Reset boolean input). You could use this VI quite easily to measure elapsed time and then reset it without stopping the loop.

Hope this helps!

Jarrod S.
National Instruments
0 Kudos
Message 3 of 6
(3,360 Views)
Jarrod is absolutely correct about the save/loop issue.  I didn't even consider the loop factor. 

Indeed,
Robert
0 Kudos
Message 4 of 6
(3,314 Views)

Hi

I am still having some problems. Thank you for the timers and entering path name, I got those working!

I am still having a problem with displaying 100ms on my graph. I know it has something to do with timing, I think that my while loop is running every 100ms, so I think this is why it is appearing on the graph, but dont know how to solve.

2.) The PID VI is not reseting. I have it in a case statement, but when I stop this case statement and then put new PID values in, the old values are the one that are used. The PID only resets when I stop the while loop that the case statement is in.


I don't have this subvi, but open the sub-vi, click on file>vi properties>execution and either select "clear indicators when called" or "make VI reentrant", I can't remember which will do what you are trying to do!
 
The " reentrant execution" is already checked.
 
3.) When I click the start button, (the colour changes) but i wanst the writing to change as well. How do I do this?

Use the paintbrush in the tools window and paint both outside and inside the text region setting the background color (see attached with example changes).
Still if I paint one side all read, when I click to make green, the red inner square remains.
 
I still havent been able to do the following,
 
3.) When I push the start button, the kp, ki and kd values fade out ( you cant enter anything further in them til the student pushes stop)
 
4.) The user is not able to push the start button until I have filled other boxes. The start button fades out, until other boxes are filled.
 
Also I have some further questions,
 
When I start the program, the controls palette opens up. How do I stop this?
 
Thank you,
Duncan
 
0 Kudos
Message 5 of 6
(3,277 Views)

Your Waveform Chart has no way of knowing how quickly the loop is running. Its default x-axis behavior is to plot the first value it receives at x=0, the second at x=1, etc. This default behavior has no relation to time, even if it is labeled as such.

If you want to represent your x-axis as true time (either relative or absolute), consider bundling your 3 plots into 3 waveforms and graphing the waveforms. Waveforms contain timing information such as t0 (initial time) and dt (time between acquisitions) that Waveform Charts and Graphs use to populate the x-axis.

You can search the Example Finder for "waveforms" for some examples on building, modifying, and graphing waveforms. Hope this helps!

Jarrod S.
National Instruments
0 Kudos
Message 6 of 6
(3,211 Views)