LabVIEW for LEGO MINDSTORMS and LabVIEW for Education

cancel
Showing results for 
Search instead for 
Did you mean: 

How to detect in your code what sensors/actuators are connected to your EV3

Solved!
Go to solution

I 'd like to detect what sensors/actuators are connected to what ports in my EV3 brick. I'd like to do it in labvew if possible, or using the lego mindstorms software. 

0 Kudos
Message 1 of 6
(7,208 Views)

Hi gpesma,

 

I'm not sure what you mean by detect. What are you looking for to show a sensor was detected? Also, what sensors/actuators are you using? From what I understand the Lego sensors should be relatively plug and play. Links to the sensors you are using would be helpful here.

 

 

--------

Aaron F.

National Instruments

 

 

0 Kudos
Message 2 of 6
(7,199 Views)

I am using the standard lego sensors (touch,gyro,ultrasonic, color) and the standard motors which are included in the educational edition of lego mindstorms. My goal is to write a program in labview that acts differently depending on what sensors/motors are attached to it. So I want my program to know that for example there is a touch sensor on port1 and two motors in ports A&B if that is the case.

0 Kudos
Message 3 of 6
(7,194 Views)

Hi gpesma,

 

Are you trying to use this in a program that's target to computer or target to EV3? If you are doing target to EV3, you can use an Invoke Node. Right-click on an invoke node and select class EV3InputPrimitive to access the InputGetTypeMode method. The types and mode numbers are documented on page 100 of the firmware developer kit .

Message 4 of 6
(7,192 Views)

That sounds about right. What should my inputs be in that case if I want my outputs to be the type and mode. See picture.

0 Kudos
Message 5 of 6
(7,189 Views)
Solution
Accepted by topic author gpesma

The "layer" input refers to the daisy chain layer. If you don't have multiple EV3s daisy chained together, it's 0. The "no" input is sensor number, "0" for sensor port 1 and so on.

 

That method will only help with sensors. For the motors, you may need to rely on moving the motors slightly and testing tachometer counts.

Message 6 of 6
(7,180 Views)