キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

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 件の賞賛
メッセージ11/21
2,462件の閲覧回数

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 件の賞賛
メッセージ12/21
2,457件の閲覧回数
Why do you care about the serial number? Seems irrelevant to your problem.
0 件の賞賛
メッセージ13/21
2,450件の閲覧回数

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 件の賞賛
メッセージ14/21
2,439件の閲覧回数
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 件の賞賛
メッセージ15/21
2,421件の閲覧回数

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 件の賞賛
メッセージ16/21
2,399件の閲覧回数
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 件の賞賛
メッセージ17/21
2,389件の閲覧回数

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.

すべてをダウンロード
0 件の賞賛
メッセージ18/21
2,380件の閲覧回数
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 件の賞賛
メッセージ19/21
2,358件の閲覧回数

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 件の賞賛
メッセージ20/21
2,348件の閲覧回数