LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview Arduino stepper motor

Solved!
Go to solution

hello everyone,

i am facing a little problem with labview code. I have labview+arduino controlled stepper motor which works perfectly fine for single step as given in example of stepper motor. I want to collect 4 samples after a certain period of time (e.g. in my case after every 10 secs. motor should take a step). I have written a code but somehow its not working properly since in the 4th position motor starts rotating rather than step whereas nothing happens as rest of 3 positions. Attached is the VI for this system. I highly appreciate help in this regard.

Thanks in advance !

0 Kudos
Message 1 of 20
(11,838 Views)

Well, first thing is first:  Does the steppe motor work normally (when you are just telling it to do steps)?

If yes, then we can move on.  The fact that you have two independent loops that depend on each other (kind of an oxymoron lol).  This will generally cause a race condition which can produce unexpected results.  From the little that you have explained about your context, I'm guessing that a simple state machine should be used here.  If you could provide us with more details of what you are trying to do, that would help us guide you in the correct direction.

0 Kudos
Message 2 of 20
(5,454 Views)

I have the same problem also. The main issue with mine is the LIFA coding which  i thnk that person is having

Because for me i did test with the arduino interface with L298 on a breadboard and it work.

To get different positioning, i placed switch on the breadboard as when i pressed it, it goes to a position.

the labview that is attached there is similar to the labview example which i used to try but it is not working

since i suspect the LIFA.

0 Kudos
Message 3 of 20
(5,455 Views)

Hello

Are you using LIFA to interface.

We are having the same problem i guess

0 Kudos
Message 4 of 20
(5,455 Views)

Many thanks for reply.

Yes, if i try to operate motor independently with labview+Arduino it works (steps) without any problem.

So i am building a setup for liquid sample collection in which sample vials are placed on a circular sample holder. This sample holder desired to be operated by the stepper motor. There is small liquid outlet coming from my experiments which is fixed at a particular position of sample holder and the vial gets filled after certain time. So i want to rotate the sample holder after certain time interval automatically (the time set labview), such that next empty vial will be in position to collect the sample.

Thanks again !

0 Kudos
Message 5 of 20
(5,455 Views)

@ Zahkay

In my case the motor works well when used the labview stepper motor example.

So in that case if i press OK button in that VI the stepper motor reponds as it should.

Maybe i didnt understood your problem but are you trying to trigger this OK button action using an external physical switch ?

0 Kudos
Message 6 of 20
(5,455 Views)

@atulchemistry

thank you very much for replying. in my case, the arduino coding on its own  with the stepper and built in L298 on a breadboard is working fine.. i am attaching my breadboard connection with stepper.

I wanted to make  the labview example as similar to the VI you upload to work for me as well. but it is not working

did u upload LIFA for it to work. which process you did yours.

Hope to hear from you soon

0 Kudos
Message 7 of 20
(5,455 Views)

To get it work first i opened the Arduino and then browse to LIFA_BASE file.

It opens many files at the same time. You have to scroll to LABVIEWinterface.h file and check that baud rate is 115200 in line 4 and 6 if you are using Arduino Uno. (atleast this settings worked for me)

and then scroll to LIFA_BASE file. Then i choose the COM port to which arduino attached from Tools>Serial Port and Arduino uno in Tools>Boards. After that hit the upload button and it will do some process which takes a while. Now if you close Arduino and go to Labview stepper motor example and choose correct COM, baud rate you should be able to work with it. Atleast its worked for me this way. Also i created constants in the VI for com port, baud, etc for init.vi. Not sure if it makes difference but it worked. Hope this helps.

Message 8 of 20
(5,455 Views)

Yes sir, my problem is with the lifa only. for the coding. i try what you told me just now already, and it rotate then an error just pop out, i will attach it with this message. for the example in labview right

when we set speed: i put 100

steps to move: 200 ( because to make a complete turn for my motor is 400)

set acceleration: i put  100 ( in fact how much should we put)

and the last stepper what is this i dont understand...

i thnk my coding for LIFA is nt good u knw i am putting the code in the VISA one

where did u put the coding for the stepper in the LIFA

here is the error i am gettingcv.JPG

0 Kudos
Message 9 of 20
(5,455 Views)

Error 5002 is  related to the port/baud rate problem,, I also had this error first but when I uploaded the sketch of LIFA_Base it started working.

I use labview 2013 and ardunio latest version.

Also at first I installed the VI packet manager 2013 and connected labview and Arduino ( this process I did first https://decibel.ni.com/content/docs/DOC-15971)

Maybe you have done that already but if not that might be problem !

I am not expert but I could tell you these are the things which I have done

Message 10 of 20
(5,455 Views)