03-04-2024 08:57 AM - edited 03-04-2024 09:05 AM
I have written my MATLAB Code for my simulation in which I am calculating the Velocity for the Motor. I have LabVIEW code for motor in which it takes motor speed as an input. I need help in writing the G code for the profile which I have already done in MATLAB.
Solved! Go to Solution.
03-04-2024 09:01 AM - edited 03-04-2024 09:02 AM
Hi rishab,
I already showed you the conversion to G code for the first lines of your m code.
Could you please cleanup your (m) code and remove all parts dedicated to plotting graphs? I guess this is not needed for "Velocity" calculation…
03-04-2024 09:16 AM - edited 03-04-2024 09:19 AM
Yes, I understand you let me understand how to write the first part. But my concern is how I will make sure writing the matrix part and differentiation part in the g code, I don' t understand how to increament the time values in the g code.
Also, My major conern before dewlling into the g code programming is do we have some other way to integrate or use the matlab code result directly in the Labview. Because for building further logic I need to use Matlab and again writing it into labview will consume time ?
03-04-2024 09:30 AM - edited 03-04-2024 10:01 AM
@rishab_kr wrote:
Yes, I understand you let me understand how to write the first part. But my concern is how I will make sure writing the matrix part and differentiation part in the g code, I don' t understand how to increament the time values in the g code.
Also, My major conern before dewlling into the g code programming is do we have some other way to integrate or use the matlab code result directly in the Labview. Because for building further logic I need to use Matlab and again writing it into labview will consume time ?
If it works in MATLAB, then why port it to LV? if you want to use LV in the end, why develop in MATLAB?
Yes, there are ways to use MATLAB code in LV. https://www.ni.com/docs/en-US/bundle/labview/page/calling-the-matlab-software-from-labview.html
03-05-2024 12:45 AM - edited 03-05-2024 12:45 AM
Hi rishab,
@rishab_kr wrote:
Also, My major conern before dewlling into the g code programming is do we have some other way to integrate or use the matlab code result directly in the Labview. Because for building further logic I need to use Matlab and again writing it into labview will consume time ?
Why don't you stick with Matlab?
Why do you need to use LabVIEW anyway?
03-05-2024 03:34 AM
So basically I need to operate the Hardware using NI SbRio 9627 for my developed simulation in Matlab.
03-05-2024 04:12 AM
Hi rishab,
@rishab_kr wrote:
So basically I need to operate the Hardware using NI SbRio 9627 for my developed simulation in Matlab.
Do you want to use the sbRIO only as "semi-smart DAQ device" or do you want to use it as (it's main purpose) "embedded controller"?
When you need the "embedded controller" then I would implement the control algorithm in LabVIEW (with Realtime behaviour in mind!) for the sbRIO. And I would even try to utilize the FPGA inside the sbRIO...
03-05-2024 06:32 AM
Yes, So basically I have developed my hardware and I have to write the labview code by using the Realtime behaviour in mind as well as utilizing the FPGA board on the NI SbRIO 9627.
Also, Can you check once the flow of my G coding (please suggest if there is any improvement) ? there are text based codes I have written for your reference.
2. Basically I am not from electronic background so can you give brief / share any reference link to follow up regarding Real time and FPGA.