LabVIEW Interface for Arduino Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Interface for Arduino Packets

Below is a table containing information about how the LIFA packets are built.  This is a work in progress as of 6/27 and should be completed soon.  Please let me know if you have any questions about this (most people won't need to worry about how this works under the hood.  This is for the benefit of advanced users).

FunctionDescriptionHeaderCommandARG0ARG1ARG2ARG3ARG4ARG5ARG6ARG7ARG8ARG9ARG10ARG11ARG12ChecksumReturn
SyncUsed to synchronize LabVIEW and the Arduino (Required in wireless mode).0xFF0x00xxxxxxxxxxxxxChecksum"sync"
FlushFlush serial buffer on Arduino.0xFF0x01xxxxxxxxxxxxxChecksumNone
Set Pin ModeSets digital pin mode as input or output.0xFF0x02PIN

MODE:

0 - INPUT

1 - OUTPUT

xxxxxxxxxxxChecksum0x00
Write Digital PinWrites a value to digital I/O pin.0xFF

0x03

PIN

Value:

0 - LOW

1 - HIGH

xxxxxxxxxxxChecksum

0x00

Write Digital Port

Writes a value to digital I/O pins 0 - 13.  Each bit represents a pin value from MSB (Pin 13) to LSB (Pin 0)0xFF0x04PIN 13- 8PIN 7 - 0xxxxxxxxxxxChecksum0x00
ToneGenerates a square wave of the specified frequency (and 50% duty cycle) on the specified pin.0xFF0x05












Checksum0x00
Read Digital PinReads the value of a digital input pin.0xFF0x06












Checksum
Read Digital PortReads the value of digital input pins 0 - 13.0xFF0x07












Checksum
Read Analog PinReads the analog voltage of the specified analog input pin.0xFF0x08












Checksum
Read Analog PortReads the analog voltage of analog input pins 0-5.0xFF0x09












Checksum
Write PWM PinWrites a PWM signal with the specified duty cycle on the specified PWM pin.0xFF0x0A












Checksum
Write PWM PortWrites a PWM signal to three PWM pins.0xFF0x0B












Checksum
Config Seven SegConfigures pins to use with seven segment display.0xFF0x0C












Checksum
Write Seven SegWrites a character to the seven segment display.0xFF0x0D












Checksum
I2C InitInitialize I2C and join the bust as master.In0xFF0x0E












Checksum
I2C SendSend I2C data.0xFF0x0F












Checksum
I2C ReadRead I2C data.0xFF0x10












Checksum
SPI InitInitialize the SPI bus.0xFF0x11












Checksum
SPI Set Bit OrderSet data transmission bit order.0xFF0x12












Checksum
SPI Set Clock DividerSet SPI clock divider.0xFF0x13












Checksum
SPI Set Data ModeSet SPI data mode0xFF0x14












Checksum

SPI Send / Receive

Send and Receivce SPI data0xFF0x15












Checksum

SPI Close

Close SPI Bus0xFF0x16












Checksum
Set Num ServosSet the number of servos to use in your application and dynamically allocate memory for them.0xFF0x17












Checksum
Config ServoConfigure servo by setting which pin to use and angle range limits.0xFF0x18












Checksum
Servo Write AngleWrite a target angle for the specified servo.0xFF0x19












Checksum
Servo Read AngleRead the last target angle sent to the servo.0xFF0x1A












Checksum
Servo Write uS PulseWrite a uS pulse for the specified servo.0xFF0x1B












Checksum
Servo Read uS PulseRead the last uS pulse width sent to the specified servo.0xFF0x1C












Checksum
Servo DetachDetach the specified servo so that the DIO pin is free to be used for DIO.0xFF0x1D












Checksum
Comments
A.Fiore
Member
Member
on

Hello, i think this packets are great and could solve some problems i found trying to connect LabVIEW and Arduino for a project.

I started to use LIFA and i found a mistake in the definition of the number of "analog pin" for the Arduino Mega 2560: there are 16 analog pin and not only 8. I had to modify the "Analog Pin.ctl" and "Check for pin out of range.vi" to make it work properly.

I got also a question: i have to read a sensor with a frequency output, i've already made an attempt using only arduino reading a digital pin and using the function "pulseIN". how can i do this using LabVIEW? is it possible to use on of the packet in the table?

Thank you

Andrea

N8DMT
Member
Member
on

Is an updated version of the LIFA Packets table available?  Looking for additional info on the stepper motor commands (30 and up).

Gerry99
Member
Member
on

Could you added command for reading intterupt pin in arduino ?? So labview could read and count for RPM measurement..

it's still common problems..

Thanks

Gerry

Contributors