LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

hello...interfacing of ultrasonic sensor and camera

i am making application in which ultrasonic sensor and camera is used.i am using myrio board.i have interfacing code for both ultrasonic and camera which i attached below.i need your help to build we can say logic.i want to capture the image using camera when distance measured by ulrasonic sensor is particular for example 10 inch.please help me..its very necessary for me.

Download All
0 Kudos
Message 1 of 6
(2,928 Views)

Hi sagar,

 

create a main VI executing (pseudo-)code like this:

WHILE
  IF distance measured by sensor == 10±x inch THEN
    capture image using camera
  ENDIF
WEND

Suggestion:

Your subVIs should not run "forever" (as "ultrasonic sensor" does at the moment) - or you need to think about data exchange between parallel running loops in different VIs…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(2,907 Views)

 hello GerdW, 

 

                     i am in the learning phase of labview.so currently i dont know how to write psuedo code.can u please explain in detail.how to map pseudo code to original?

0 Kudos
Message 3 of 6
(2,890 Views)

Hi sagar,

 

you need to use suitable LabVIEW structures/functions.

- WHILE/WEND is just a WHILE loop (I guess you figured this as well)

- IF/THEN/ELSE is a CASE structure

- the rest of the pseudocode suggestion are just your two subVIs…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(2,884 Views)

hello Gerdw,

     sorry but i cant understand.whether i have to draw structure or write pseudo code?please explain with one example whole thing.thanks in advance.

0 Kudos
Message 5 of 6
(2,875 Views)

Hi sagar,

 

whether i have to draw structure or write pseudo code?

Pseudocode is a way to describe an algorithm without using a "real" programming language!

You need to code the sketched algorithm in LabVIEW!

 

Btw. you don't "draw" in LabVIEW, you "code"/"program"…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 6
(2,860 Views)