LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

Math script to MatLab conversion

I cannot figure out how to convert from Labview mathscript to MatLab script.

I need a reference to do some very simple stuff.

Does anyone know of tutorials that would help with a conversion?

 

John

0 Kudos
Message 1 of 9
(530 Views)

I cannot look at your VI (only access to LabVIEW 2020 at the moment), but I would start by just copying the text between the two nodes and create connectors as needed.

 

0 Kudos
Message 2 of 9
(512 Views)

Is there a reason why you chose the Math script way instead of native LabVIEW functions?

 

santo_13_0-1729137832209.png

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 3 of 9
(502 Views)

Please see if this LabVIEW equivalent makes sense (I don't know what you intended with the logic, but this should match your Math script logic)

 

santo_13_0-1729141874618.png

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 4 of 9
(492 Views)

Thank you for the help in this matter.

 

I am working with some older course material.

I think the professor, at the time, wanted the students to exercise different aspects of LabView.

I started the students using the latest version of LabVIEW (2024) and found that not all previous course material would work.

I am working with other instructors to deliver the Lab material.

I am looking for methods to upgrade the course material and not rock the boat too much.

 

The intent of the script is to control a servo motor to move forward then reverse to imitate a waving motion. The user would set the values for the speed and the number of waves before initiating the go logic.

 

John

 

0 Kudos
Message 5 of 9
(477 Views)

If this is a LabVIEW course, polluting it with Matlab is a distraction that will dramatically complicate things and distracts from the pure beauty of a dataflow language. Santo already showed how it could be implemented in pure g.

0 Kudos
Message 6 of 9
(467 Views)

The course is an IOT type of course from several years ago.

The original owner of the course is no longer with the program.

I understand that any course material could be better.

The course deals more with Arduino, sensors and simple control.

The LabVIEW is the tool which is hosting concepts of data I/O for the programmer. 

I was not critical about the delivery because I am a temp or sessional instructor for the delivery..

I will suggest the ideas to my supervisor at the time of course review.

The other instructors will have the students work with LabVIEW 2022 so they can deliver the course.as it was originally designed.

Thank you for all your help.

 

John

0 Kudos
Message 7 of 9
(462 Views)

I tried the program and it did not work.

This is a sub vi that will take the input of Speed and NumberOfWaves and provide an output of a changing Angle1 between an upper and lower value between 0 and 180 degrees.

The Speed variable determines the rate at which the Angle changes. The limits are checked to ensure the output does not go outside the useable range.

The Waving, WaveCount and Direction are indicators of what is happening during the process. 

The sub VI would also have a delay of 10 mSec. The Angle1 gets translated to pulse width for a servo motor.

If the VI was to work you could run it and watch the count and Angle1 change until the WaveCount has been completed.

 

0 Kudos
Message 8 of 9
(410 Views)

@mohawkcollege-john wrote:

I tried the program and it did not work.


There are billions of ways the term  "does not work" can be interpreted.

Since we cannot see what you did, three is no way to tell.

0 Kudos
Message 9 of 9
(395 Views)