LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Arduino Uno and LabVIEW

So you can read the device's serial number from the LabVIEW side? Well that says the interface is working.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 11 of 21
(1,632 Views)

I'm currently reading the device serial number from NI max, the VISA resource name for the Arduino is ASRL4::INSTR. Is there a way to read the device serial number directly from LabVIEW using the VI or block diagram?

0 Kudos
Message 12 of 21
(1,627 Views)
Why do you care about the serial number? Seems irrelevant to your problem.
0 Kudos
Message 13 of 21
(1,620 Views)

In the LabVIEW VI you have to enter the device name under the "Device Configuration" section, by serial number I thought 'mikeporter' was referring to the device name. As I said, I'm a bit new to using LabVIEW and microcontrollers, I'm still trying to learn the basics of how to interface various programs and external devices.

0 Kudos
Message 14 of 21
(1,609 Views)
I can't look at your VI since I am posting by phone. Please probe the output of your VISA Read and report what the exact string is. I would also hope that you are not using VISA Bytes at Serial Port that might be returning 0. Show what the serial monitor in the arduino ide displays.
0 Kudos
Message 15 of 21
(1,591 Views)

I probed the output of the VISA read, this is what it gave me, ASRL4::INSTR for the value. I also probed some of the other wires, and the only thing going into the "Waveform Chart" is the offset for each of the axes. I also noticed that the wire coming from "NI-845x Device" is giving an error. The value for it says "{status=> True,code => -301706, source => Proper Node (arg 1) in ST_Accel.vi".

 

You mentioned that I should not be using VISA Bytes at Serial Port, how would I know if I am using VISA Bytes at the Serial Port?

 

Per your request, here is the serial monitor in the Arduino IDE displays, note that I'm using +/- 2g, so 1g is equivalent to 16384. The data below is when the accelerometer chip was sitting on the table.

 

x: 832  y: 64  z: 17536

x: 768  y: 128  z: 17792

x: 704  y: 0  z: 17792

x: 832  y: 128  z: 17792

x: 768  y: 64  z: 17600

x: 768  y: 64  z: 17664

x: 640  y: -192  z: 17664

x: 704  y: -64  z: 17664

x: 768  y: -64  z: 17664

x: 768  y: 128  z: 17856

x: 640  y: 128  z: 17600

x: 704  y: 128  z: 17664

x: 704  y: 128  z: 17728

 

I would also like to mention that I greatly appreciate you taking the time to help me out.

0 Kudos
Message 16 of 21
(1,569 Views)
You probed the wrong thing. You need to probe the read string output. That is what you should be parsing for your xyz values. You should be seeing something similar as the serial monitor and a scan from string function would probably work. As I said, I'm posting from my phone so an image of the block diagram would help.
0 Kudos
Message 17 of 21
(1,559 Views)

It seems that I'm just gettings 0's for the x,y, and z values. LabVIEW has no zoom-out function so I could not get the entire diagram in 1 picture. I have attached 2 images of my block diagram, the first block diagram displays pretty much everything in the diagram, but I wanted to ensure that you could see the entire diagram.  Can you download PNG files on your phone? If not just let me know how you want me to send you the pictures.

Download All
0 Kudos
Message 18 of 21
(1,550 Views)
Well, I'm confused. The serial monitor is just a text display that would be the same thing as a simple VISA Read in LabVIEW. Your code shows an i2c read of an NI-845x. That device is not at all the same thing as an arduino. You need to clarify what hardware you actually have. The two different devices are easily distinguished. One says arduino and the other says NI.
0 Kudos
Message 19 of 21
(1,528 Views)

I downloaded this VI from another forum, I can't believe I overlooked something so simple. So I have to change the NI845 configuration block and the initial NI845 block with Arduino blocks, is that all?

0 Kudos
Message 20 of 21
(1,518 Views)