From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I pass a string structure into a VI?

Got it. You're right. Another example of how the provided VI's are not quite done?

 

So I've copied and modified this library to my hearts content and I am now starting to add in my data processing stuff (see attached).

A few questions for the masses, some simple some perhaps not so simple.

 

1. How do I make the control_panel_pwm.vi the "default" or "master" one or whatever so it opens automatically when I open the library? (I know this is a dumb question and really simple it's just bugging me).

 

2. So I added the enumeration "processData" and have created the respective state in the VI. The state is called from the "processEvents" state so it should loop through after doing the "updatePanelItems". However it does not seem to be getting data from the thermocouple carrier. I mean it gets temperature values, but it does not plot anything on the graphs. Is this because the "slate is wiped clean", so to speak, each time it cycles through? Does the data need to be passed through as a state variable or something?

 

3. This one is more food for thought: It seems as though I cannot dynamically change the speed of the motor. I set-up my VI so that I can enter the high-speed value, then I type in "J+" on the control panel, and the motor runs at that speed. However if I enter a new value and enter "J+" again it does not take on that new value and it just returns "?Moving". Only when I enter "STOP" then "J+" again will it begin to spin at the new value.  Ultimately I will need the motor speed to be adjusted dynamically.

 

Thanks!

Oh and feel-free to tear me up. That is, tell me everything I'm doing wrong or ways in which my VI is not quite "kosher" or how to improve it.

0 Kudos
Message 51 of 64
(968 Views)

Bump.

 

I mostly just need to know how to accomplish data acquisition within the state machine. Attached is a screenshot of how I currently have it setup, and the data is not being plotted on the graph.

 

I figured everything else out.

 

Thanks!

0 Kudos
Message 52 of 64
(949 Views)

I can't tell which one you're using from the screenshot, but if you're using a graph, try using a chart instead.  Charts save their past values and add new data as it arrives; graphs display only the data that is wired directly to them.

Message 53 of 64
(945 Views)

Um I'm pretty sure it's a graph, but I'm having trouble figuring out how to insert a chart? I don't see that in any of the menus and even when I search it doesn't come up.

0 Kudos
Message 54 of 64
(926 Views)

and I'm using version 8.2...

0 Kudos
Message 55 of 64
(915 Views)

On the front panel, when you right click, under the graph palette there are options for both "Waveform Graph" and "Waveform Chart."  You want the latter.  You can see which one you have by right-clicking the front panel object, selecting properties, and then looking at the title bar of the properties window.

0 Kudos
Message 56 of 64
(911 Views)

 


@Samweis wrote:

Um I'm pretty sure it's a graph, but I'm having trouble figuring out how to insert a chart? I don't see that in any of the menus and even when I search it doesn't come up.


Charts are front panel objects. See if you can figure out where it is from the attached screenshot.

 

 

0 Kudos
Message 57 of 64
(910 Views)

lol.  Yeah I found it before either reply 🙂

0 Kudos
Message 58 of 64
(896 Views)

This is essentially my stream of thought, and all are welcome to tell me if this makes sense or not or if there is a better way to accomplish this.

Please see screenshot attached.

 

Apparently my motor does not allow "on the fly" changes of the high speed value. So I'm thinking I'll just have a case that sends the stop command, then sends the new high speed value, then sends the start command. The short time lag should not make a difference for our application.

 

There are only certain conditions for which I want LabVIEW to change the high speed value. Those conditions are as follows:

1. When TC2 <= 0 degrees Celsius (thermocouple 2 will be positioned on the bottom of the copper plate at the base of the vessel, so only when it is close enough to the liquid nitrogen to actually cause water to freeze should the speed-changing case be invoked). I'm handling this with a simple "less or equal" feeding to a "select". Onward...

2. When the difference between TC1 and TC0 has deviated from the range of about 2.8 - 3.2 degrees Celsius. I'm thinking I'll have the temp diff from the DAQ go to a shift register fed into the changeSpeed case, use a comparison, do something like "newSpeed = oldSpeed / 2" (for example) and send the commands.

 

However I ONLY want the speed-changing case invoked every, say, 1.5 mins or so!!  Is there a simple way to do that? If the case is invoked every time the state machine cycles through, essentially we will have an "endless loop" where the value is decreased to zero (or increased to infinity) because we need to allow some time for the system to equilibrate.

 

Also if anyone has any better ideas as to change the speed value to have a temp diff approach a constant value, I'm all ears.

0 Kudos
Message 59 of 64
(875 Views)

One simple solution is to add a temp-check case which uses the Time functions to only run if enough time has passed. (Check time now with previous execution time)

To not pass yet another variable through all cases (which dont need it) you can use a uninitialized shift register as time storage between loops. If executed it sends on the now-time, else it passes on the old time.

 

/Y

 

 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 60 of 64
(854 Views)