LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

help in the programming of the Hc-sr04 ultrasonic sensor

Solved!
Go to solution

ok I'm sure I'm going to do the test with 2 cards tomorrow night. But can you explainme a litle more how to change the chanels? i have some ideas but i prefer to have it claer before i start the test tomorrow.

0 Kudos
Message 21 of 42
(1,817 Views)

Once you connect the two cards to your computer, the channels that you can use will appear available on the front panel menu. For example, if you click on the Trigger or Echo menu when there is no card connected to the computer, it will not give you any option but the "browse" selection. If you have your cards connected, when you pull down your menu, you will see the channels that you have available. So you just select each card channel on the menus

 

front panel.png

Francisco S.
National Instruments
Account Manager
www.ni.com/soporte
0 Kudos
Message 22 of 42
(1,815 Views)

Ok thanks, i hope i do the test tomorrow and it will work.

 

Now can we speak about the step motor? i have the code to make ir run, is an example of the vernier products stepper motor, but im not sure how to make ir run in both directions.

Example:

 

get a signal of the distance sensor, and make the step motor run 100 steps clockwise, wait 600 seconds and then 100 steps counterclockwise.

 

That is what i need, but this motors arn´t conected directly to the card, i add the DCU. (http://www.vernier.com/products/sensors/dcu-btd/) in the user manual tells how to wire it and make it run, but i dont know how to make it run in the other direction.

 

Thanks for all your help.

0 Kudos
Message 23 of 42
(1,812 Views)

Are you using LabVIEW to make it run? If so, what is the code?

Francisco S.
National Instruments
Account Manager
www.ni.com/soporte
0 Kudos
Message 24 of 42
(1,809 Views)

 

At night I post the code, is only the code to make the motor run N steps at Y speed. And again thanks for all your support.

0 Kudos
Message 25 of 42
(1,807 Views)

here is the code of the motor, what I try to do is to make the step motor run X steps, then stop the motor and turn on the DCU output panel to number 6 so i can star a normal motor to run.

 

The goal is, if the sensor get to a desired value, then the step motor tun X steps to one side, then stop. Then the DCU chanel must be changed from Outpu pattern 0 to #6, and a timer must begin, when the timer get a Y time, the DCU must be changed from #6 to #0 and the stepper motor must run back the same number of steps it run.

 

 

My program is only the motor part, i didnt add the sensor yet nor the conditions, i have some problemas with the timer.

 

Thanks for all.

0 Kudos
Message 26 of 42
(1,800 Views)

Hi again i run the program with notes and i get this error. Is directly when I run it, and i cannot change the CH of the trigger or the Echo because the erro jump whne i run it.

0 Kudos
Message 27 of 42
(1,801 Views)

That error is ocurring because you have not yet connected any card and because the values that are selected on the front panel menus are default. It does not mean that you have the PCI6225 connected

Francisco S.
National Instruments
Account Manager
www.ni.com/soporte
0 Kudos
Message 28 of 42
(1,789 Views)

ok yea ima having some problems with my usb ports thanks

0 Kudos
Message 29 of 42
(1,782 Views)

 

Hi man yesterday night I make the test with 2 NI's, I changed the chanel in the program but i get the same error, so what can we do? Can we make a programa step by step to make the sensor work? because the example is not running.

 

Yesterday i tried to do it my way, i generate with one card the trigger, and with the other the input, but it asked me if i whant to measure period, frequency, number of picks, and somethings like that.

 

Thanks for your help.

0 Kudos
Message 30 of 42
(1,772 Views)