For LabVIEW 2017:
1. Get the IoT Devices folder from Chris or someone who has it and save it within your user.lib
2. Test that the EV3 is connecting to your computer:
- Open LabVIEW
- Open the VI: LEGO EV3_Demo from within User Libraries, IoT Devices, LEGO EV3
- Run the code, and your device should beep once and turn the motors if any are connected. This will show if your EV3 is connected properly
3. To get a sensor value from the EV3:
- Open a new VI (see example code below)
- Copy and paste the LEGO EV3 ExpressVI from LEGO EV3_Demo
- Add the LEGO EV3_GetDeviceListing, LEGO EV3_Connect, LEGO EV3_Ports and LEGO EV3_Connect VI's
- For LEGO EV3_GetDeviceListing, create a constant for the "desired name" input
- Go to the settings tab on the EV3 and find the brick name - enter this as your constant
- For the first EV3_Connect, set the boolean value to True, for the second set it to False (this connects and then disconnects from the EV3)
- LEGO EV3_Ports has an output simply called "value", wire this to an Unbundle by Name
- Within the cluster titled "hardwarePortValues" are the port ID's (1.1, 1.2, 1.3, 1.4, 1.A, 1.B, 1.C, 1.D), the type ID of the sensor or motor and the value that the sensor or motor is reading
- Use Array Subset to pull only the data from the first 8 clusters (ports 1.1-1.D)
- Next use Array to Cluster and wire that into Unbundle by Name again
- Tip: you will need to drag down on the bottom of your Unbundle by Name function in order to expand it to three values. Click on the each one and use the drop down menu to select your desired port and data type
- You should now have three separate outputs for each of: portID, typeID and value
- Make sure you have selected the portID, typeID and value for the port to which your sensor is connected (if you have indexed from 0 to 7, the IDs will line up such that 0 is 1.1, 1 is 1.2, etc.)
- It is usually the data type "value" that is usually pushed to Thingworx