LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to control motor from LabVIEW with LIN bus communication

Hello everyone,

 

I want to control motor from LabVIEW with LIN bus communication. I am using following Hardware and software from NI.

In addition, I have LDF file for LIN bus.

 

Hardware:

  1. NI 9866 (1-Port NI-XNET LIN C Series Module)
  2. NI cDAQ-9171 (NI CompactDAQ 1-Slot USB Chassis) 

Software:

  1. LabVIEW
  2. NI-XNET 14.5 driver 

I am not sure is it perfect way to implement this application using above mentioned hardware and software.

How would I do? What steps to be followed to retrieve message frames in LabVIEW?

I am completely new to this topic. I have lot of confusion about Master and slave operations.

 

Your help is much appriciated.

 

Thanks for your feedback in advance.

 

Kind regards,

sachin

0 Kudos
Message 1 of 4
(5,664 Views)

Looks like you've got a reasonable start on the hardware and software. Look over the LIN examples in the NI Example Finder.

Do you have a motor controller that you are talking to?

Make sure you get the Interface document for the controller. Since you already have the LDF, you should be able to modify the LIN examples to send your control signals.

0 Kudos
Message 2 of 4
(5,593 Views)

Hi Taki1999,

 

Thanks for your fast response.

 

I have tried with NI Example Finder. The example which I tried is "LIN Frame Input stream". Furthermore, I created the NI-XNET database with LDF file using the "LIN Frame Input stream". Please find attached PNG image of VI exempler after database LDF file browsing.

 

It would be great if you can answer the following questions from attached exempler PNG image:
1. How can I execute the Master task as a PC (I would expect PC has to perform Master task which controls motor)  and slave as motor?
2. As you can see there are three selection options sch_mreq(Schedule Master request), sched_normal and sch_sres (Schedule slave response) then how can I work with these options?
3. When would I need to select the LIN master option beside the XNET LIN schedule?

 

Please correct me if I am wrong with my approach. Also, If I get the more specific direction to tackle this would be cool.

Any suggestion regarding LIN bus communication would be helpful.

0 Kudos
Message 3 of 4
(5,568 Views)

@mirkalesachin wrote:

...

It would be great if you can answer the following questions from attached exempler PNG image:
1. How can I execute the Master task as a PC (I would expect PC has to perform Master task which controls motor)  and slave as motor? There's a property node for your LIN Task to select Master or not.
2. As you can see there are three selection options sch_mreq(Schedule Master request), sched_normal and sch_sres (Schedule slave response) then how can I work with these options? These come out of your XNET/LIN Database. The example should show how to switch between schedules.
3. When would I need to select the LIN master option beside the XNET LIN schedule? Prior to doing any Reads or Writes, you will need to set your LIN application as the master.

 

Please correct me if I am wrong with my approach. Also, If I get the more specific direction to tackle this would be cool.

Any suggestion regarding LIN bus communication would be helpful.


Read the LabVIEW help on LIN. Read your motor controller's manual on how to use LIN.

Message 4 of 4
(5,560 Views)