Hobbyist Toolkit

cancel
Showing results for 
Search instead for 
Did you mean: 

Problema de lectura de sensor ultrasonico HC-SR04 con libreria linx

Buen dia, he realizado pruebas de lectura de datos con los modulos de la paqueteria linx la mayoria a sido un exito, el problema se ha dado al intentar realizar la lectura del sensor ultrasonico HC-SR04 con el nodo read que se encuentra en las funciones de Linx, Sensors, Distance, Ultrasonic.

Una vez que lo ejecuto no envia ningun resultado a los indicadores numericos que le he colocado en sus salidas de datos, la version de labview que uso es 18 y la version de la paqueteria Linx es 3.0.1.192, he probado el funcionamiento de mi sensor en la plataforma arduino directamente y si funciona. Alguien puede apoyarme?, se lo hagradeceria. Adjunto VI usado.

0 Kudos
Message 1 of 4
(1,451 Views)

Have you deployed the Linx Firmware to the Arduino? What was the result of that? This would be under Tools -> MakerHub -> Linx -> Linx Firmware Wizard...

 

Are you able to just turn on / off the LED attached to pin D13 using Linx?

0 Kudos
Message 2 of 4
(1,396 Views)

Tengo el mismo problema, ¿lo lograste resolver? 

0 Kudos
Message 3 of 4
(463 Views)

Hey @Dave_H69, I'll give you a step by step instructions:

 

with arduino plugged on a USB port follow the instructions to upload the firmware:

 

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019TmpSAE&l=pt-BR

 

I'm using a LabVIEW 2020SP1 professional, with LINX installed.

 

Create a new VI, insert OPEN.vi, READ.vi from ULTRASSONIC pallete and CLOSE.vi, all from Makerhub/LINX pallete. do not mix LIFA and LINX VIs.

 

Wire your code as image bellow:

jorgemondadori_0-1622942243921.png

Open the Read.vi inside the while loop, and add a constant to Stimulus Pulse input, and set the enum to Active High.

jorgemondadori_1-1622942383408.png

 

Save and close this subVI. (Note: this will change your library file, keep that in mind)

Set the inputs: In this example, DO Channel = 2 (arduino pin) connected to Trig pin of HC-SR04 and DI Channel = 4, connected to Echo pin of HC-SR04.

jorgemondadori_2-1622942598863.png

You may want to put a filter or ptbypt mean before the Centimeters (or inches) Indicator, to dump a bit the reading rate. Also, set your loop wait function according to your application.

 

Here is the result of using a 30 CM ruler.

jorgemondadori_3-1622942964419.png

 

 

Also i am posting the VI, remember to edit the library file!

 

 

Jorge Augusto Pessatto Mondadori, PhD
Sistema Fiep
CLAD, CLD
0 Kudos
Message 4 of 4
(428 Views)