I thought I would get this started. Keep in mind that I’m not much of a LabVIEW guy (Simulink has been my primary tool at work for many years). Some of my requests below may be just because I don’t know how to use LabVIEW very well, so if that’s the case I’d love to let me know how to get it to do what I want.
Here is what I’d like to see:
Real-time filter/transfer function VI’s. I’ve tried using the filter VIs, and it seems like they will take a vector input, filter that vector, and the output is the filtered vector. That’s not very useful in real-time. I want it to take a single value for the current time sample, and return a single value as the filtered output for the current time sample. In other words, a real-time filter.
Output / data storage VIs that store data as it comes in, like the “To Workspace” or “To File” blocks in Simulink. In my autonomous robot simulator, I probably spent less time doing every other part of the simulator than I spent trying to figure out how to turn a stream of “real-time” samples into a vector so LabVIEW could write it to a file. Just like in (1) above, I want to feed it a single value every time sample, then the VI should just tack the new sample onto the end of what is already there.
I know I have thought of other things, but that is all I can think of for now. I guess what I really want is for ALL of the vectored blocks to have a “real-time”, sample-by-sample counterparts.
I’m wearing the other shoe. I know LV and only know Simulink from looking over other people’s shoulders.
For #1, you are looking for the PtByPt functions. LV doesn’t call them realtime since vectors are also useful for realtime, especially when dealing with 2D data. Anyway, in the Signal Processing palette, the lower right corner has functions specifically for incremental signal processing point-by-point.
For #2, the file I/O functions support appending data to the end of the file, but they are rather generic and support all sorts of random access as well, so as far as I know there is no easy AppendOnly function in the palette. If the file is left open, the file write will automatically append. I’d be glad to show a simpler way to use the file I/O if you want to show what you wrote previously. Or if you have specific questions…
On the FRC simulation topic, are you most interested in visualization, modeling, control development, state machines, or something else?
My interests in Simulation are currently completely for controls development. If we do anything that is complex in the control software, I like to create a simulation to test the software thoroughly before it ever goes on the robot.
Having said that, anything to help with modelling would be great. Currently I just determine equations of motion and implement those with basic math blocks, which I’m happy to do.
Before I forget, what about point-by-point front panel graphs? I was only able to find a 2-D graph that will take an x-vector and a y-vector. Is there anything that will do point-by-point as the data comes in?
In LV terminology, you are looking for a chart. A chart does incremental updates, and a graph replaces old data with the new. The chart accepts a large variety of numeric types including scalars, arrays, timestamped arrays, etc.
If you are looking for a generalized XY chart, we are a bit weak in that area. The charts assume increasing X axis, typically monotonically increasing, but timestamped data provides the info needed to scroll appropriately for triggered data.
Does this answer your question? Or can you describe what you want the display to do?
Greg McKaskle
I guess what I’m looking for doesn’t exist yet (I’d like arbitrary X - not necessarily monotonically increasing).
One of my simulation tools simulated the path that the robot would drive in autonomous mode. I wanted to plot that path on an X-Y plane to be sure that it was going where I wanted it to. The robot could have X and Y coordinates that increase or decrease over the duration of the path (i.e. not monotonically increasing). The solution I came up with was to store the X-Y path data in large vectors during the simulation, then create a graph after the simulation was finished. That resulted in a bit of frustration (and a lot of “why won’t this let me do that??”). I finally figured out how to do what I wanted, but it took me a while to get there.
Our team programs in C++. When we write a section of code, we always do some sort of logic test before we allow the motors to move. This usually consists of adding a bunch of prints that verify the logic works as expected.
What I would find really useful is a way to use compiled C++ code (maybe Java too?) to plug into a LV simulation. I don’t have anything hashed out in detail, but the basic premise is that teams developing in C++/Java could continue to use what they’re familiar with, but still use the visualization strength of LV.
What I’m thinking is a way to compile our code in such a way that we could drop it into a VI representing the robot behavior. I envision this block being used in a LV environment running on a PC. Inputs and sensors could be set manually or could be automated for more complex, reproducible behaviors. Output could be visualized however is appropriate.
VIs for different components such as speed controllers and motors developed by people that know how to accurately model the physical components could help out as well.
I know it’s a pretty large concept/requiest, but it would definitely help teams out and would provide students a glimpse into real world simulation.
Something I’ve been asking for with Labview for a while…
The ability to “ZOOM” in on sections of VI’s. Some VI’s can have many wires, connecting many other sub-VI’s. It be nice to ZOOM(enlarge) so we can clearly see the connections.
Another nice item, although I’m not certain how feasible it is, would be to have a DESKTOP CRIO simulator. Such that code could be developed, complied, run(pseudo) and debugged without needing a 2nd Crio or using the Robot.
There was once an XY chart example. It is probably still there. It is really just a subVI that keeps a window of the data and updates the graph in the loop. On today’s computers you can of course set the window quite large and run quite fast. The waveform charts are pretty optimized compared to a waveform graph, but there isn’t much to do to outperform the XY graph that redraws everything. Anyway, looking at the example may help a bit.
Skipping to zoom. Yep, it would be nice sometimes, but it just goes to show that when things aren’t designed in from the beginning, it is tough to retrofit.
I’d like to be able to shrink structures to fit.
I’d also like to be able to drag sections of code into and out of structures, and optionally have them retain their wiring.