Converting LabView code to Matlab

In summary, the conversation is about someone seeking advice on how to move a measurement setup control program from LabView to Matlab. They are familiar with programming in Matlab but have no experience with GUI and data acquisition. Suggestions are given on how to approach this, including using the GUIDE editor for the GUI and utilizing LabView functionality within Matlab. The importance of understanding hardware control is also mentioned.
  • #1
Jopi
14
0
Hi,
this is not actually a homework question, but as it has mostly to do with computer science, I thought this would be the appropriate place.
At work we have a measurement setup which is currently controlled by a LabView program. My task is to move the code from LabView to Matlab. I don't necessarily need/want to convert the code directly from LabView to Matlab, there are tools for that, but instead desing a new measurement setup control program using Matlab based on the old program in LabView.
I'm familiar with programming in Matlab, but I've never done any GUI and data acquisition stuff before. I was wondering what is the best way to do this in Matlab? For the GUI, I guess the best way is to use the GUIDE -editor, though I'm not sure if it is able to do everything that LabView does.
Instrument control I've not even begun to think about...
 
Physics news on Phys.org
  • #2
In the future, you might want to ask questions like this in the Computer Science subforum (or better yet, Mathematical Software or Programming sub-sub-forums, but the distinctions get blurred there most of the time).

Regarding the meat and potatoes of your problem, you'll need to figure out how your hardware is controlled, and whether or not there's an abstracted way of dealing with it (i.e. a high-level DLL, or driver that accepts / outputs text, or some such). As I'm more of an EE than a computer science type, I'd suggest getting core functionality going (in terms of being able to achieve basic and reliable communications) through the control line first before making a GUI, but that's probably just me.

When I used Guide (back in MATLAB 6.5 or thereabouts), it just helped me create a (bare bones) layout; you still need to design the GUI functionality (what buttons / windows display what, and when) and write all your callbacks (stuff that happens when you click, press a button, instrument melts down, etc.)

To complicate matters, you can call LabView and LabView functionality from MATLAB, and vice-versa:
https://www.physicsforums.com/showthread.php?t=308217
 
  • #3


Hi there,

Converting LabView code to Matlab can be a challenging task, but it is definitely doable. It sounds like you have a good understanding of programming in Matlab, which is a great start. The first step would be to familiarize yourself with the various data acquisition and instrument control functions available in Matlab. The Instrument Control Toolbox and Data Acquisition Toolbox are two options you can explore.

For the GUI, using the GUIDE editor is a good choice. You can also consider using App Designer, which is a newer and more robust tool for creating GUIs in Matlab. It may take some time to get used to the interface, but it offers more flexibility and customization options compared to GUIDE.

In terms of replicating the functionality of LabView, it may not be possible to do everything exactly the same in Matlab. However, with some creativity and problem-solving, you should be able to come up with a solution that meets your needs. Don't be afraid to reach out to the Matlab community for help and advice, as there are many experienced users who may have faced similar challenges.

Overall, the key is to plan and approach the project systematically, making use of the available resources and tools. Good luck with your project!
 

1. Can you convert all LabView code to Matlab?

No, it is not always possible to convert all LabView code to Matlab. Both programming languages have different structures and features, so some functions or operations may not have a direct equivalent in the other language.

2. How difficult is it to convert LabView code to Matlab?

The level of difficulty in converting LabView code to Matlab depends on the complexity and size of the code. Some simple codes can be converted easily, while more complex codes may require more time and effort to convert.

3. What are the main differences between LabView and Matlab?

LabView is a graphical programming language used for data acquisition, instrument control, and measurement analysis, while Matlab is a text-based programming language mainly used for numerical computations and data analysis. LabView also has a more visual interface, while Matlab is more code-based.

4. Are there any tools or resources to help with the conversion process?

Yes, there are some tools and resources available to help with the conversion process, such as the LabView to Matlab Conversion Utility, which can assist with converting basic LabView code to Matlab syntax. Additionally, there are online forums and communities where you can ask for help and tips from experienced programmers.

5. Are there any limitations or considerations when converting LabView code to Matlab?

Yes, there are some limitations and considerations to keep in mind when converting LabView code to Matlab. Some advanced features in LabView may not have a direct equivalent in Matlab, and vice versa. It is also important to thoroughly test the converted code to ensure it produces the same results as the original code in LabView.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
1K
  • Computing and Technology
Replies
3
Views
2K
  • STEM Career Guidance
Replies
5
Views
1K
  • Introductory Physics Homework Help
Replies
4
Views
1K
  • Programming and Computer Science
Replies
3
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
12
Views
1K
  • STEM Career Guidance
Replies
11
Views
5K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
3K
Back
Top