From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I read continous streams of data?

Hi Jeff, how do I acess my labview code. I am not sure how to create a snippet? or do you mean you want an image of my block diagram?

 

0 Kudos
Message 11 of 46
(788 Views)

Hi arteitle, As in the laptop I am using? my set-up is an arduino wired to an MPU6050 gyroscope and bluetooth SMiRF Silver Modem. 

0 Kudos
Message 12 of 46
(788 Views)

Not the laptop, but what's in between the gyroscope and the laptop, since the gyroscope doesn't have an interface that's typically found on a laptop (i.e. I2C or SPI). Presumably the Arduino is talking to the gyroscope over one of those, then sending data in some format to one of its serial ports which is then going over Bluetooth to the PC where it appears as a COM port in VISA. So the formatting of the data it sends is going to be defined in the Arduino code. Did you write that code, or do you have any documentation for it? We need to know the format of the data it sends out.

0 Kudos
Message 13 of 46
(784 Views)

Yes, this exactly how it is working. (Arduino is talking to the gyroscope and sends data to the serial ports via bluetooth where it appears on LabVIEW. I am not using arduino code as I thought LabVIEW would allow me to create a system where I can stream and record the values? I did initially have code on C++ but it is complicated and not working using bluetooth, so I am sticking to LabVIEW.  

0 Kudos
Message 14 of 46
(779 Views)

@Okor29 wrote:

Hi Jeff, how do I acess my labview code. I am not sure how to create a snippet? or do you mean you want an image of my block diagram?

 


NEVER an image of your Block Diagram -- just attach the VI, itself (it is helpful to say which version of LabVIEW you are using).

 

If you want to attach a snippet as an Image (which can at least be visible to those with lower LabVIEW Versions than you are using), here's how to proceed:

  • Go to your Block Diagram.
  • Type Ctrl-A, "select All".  We need to see the whole Block Diagram (so it better not be much bigger than your screen!).
  • In the Edit menu, choose "Make Snippet from Selection" (or words to that effect).  It will make a PNG file that has extra "magic" that allow us to turn your picture back into LabVIEW code.
  • Attach the Snippet.  And attach the VI.

Bob Schor

0 Kudos
Message 15 of 46
(778 Views)

The Arduino is acting as the middleman, transferring data from the gyro to the Bluetooth and on to the PC, but the Arduino must be running some code, because if it were blank it wouldn't be transferring anything. Did you load some code into it to get it working, or did it come preloaded from wherever you got it?

0 Kudos
Message 16 of 46
(777 Views)

@Okor29 wrote:

Yes, this exactly how it is working. (Arduino is talking to the gyroscope and sends data to the serial ports via bluetooth where it appears on LabVIEW.


Arduino "talks" to the Gyroscope by executing some code.  It sends data to the serial ports via Bluetooth by executing some code.  WHAT CODE?

 

It appears that your Gyroscope sends signed 16-bit numbers for the various channels that you acquire.  How many channels, and at what data rate?  You have Gyros, linear Accelerometers, and possibly other gadgets on that chip.

 

The point is, bytes are going to be arriving (we hope) at the PC and being read by LabVIEW.  In the Best of All Possible Worlds, the data would be "human Readable" (e.g. "1.3, 2.5, 6.2<CR><LF>") so we could see the Format and so VISA could use its termination character to "clock" the stream, but we may just have a raw binary data dump with no internal indication of how much data, how many channels, how to interpret the byte stream.  This can be handled, but it makes for a little more effort and pains where you sit down.

 

Bob Schor

0 Kudos
Message 17 of 46
(776 Views)

Here is a snippet of my block diagram and an attachment of my vi. 

 

thank you, 

 

Okor29

Download All
0 Kudos
Message 18 of 46
(769 Views)

Hi arteitle, 

 

Yes I did load some code before to get it working on C++ and it streamed well when it as conected via USB but once I installed my bluetooth modem and and tried doing via a bluetooth adaptor, it could not work. I think I needed to modify my code to use bluetooth but I did not know how to do that so I began using LabVIEW instead. 

 

Many thanks, 

 

Okor29

0 Kudos
Message 19 of 46
(767 Views)

@Okor29 wrote:

 

Yes I did load some code before to get it working on C++ and it streamed well when it as conected via USB but once I installed my bluetooth modem and and tried doing via a bluetooth adaptor, it could not work. I think I needed to modify my code to use bluetooth but I did not know how to do that so I began using LabVIEW instead. 

 


It's not "instead" though, the C++ code running on the Arduino has to work in concert with the LabVIEW code on the PC. So what we're asking you to tell us is how the C++ code formats the data it sends to PC, so that we can help you write LabVIEW code that receives it properly. Did you write the C++ code or do you have source code you can share, at least the part where it sends data?

0 Kudos
Message 20 of 46
(758 Views)