Teensy 3.1: LabVIEW + Controlling Teensy Outputs(I²C/Serial)

Status
Not open for further replies.

Chopsticks

Active member
Hi There!

I've been trying to connect my Teensy 3.1 to LabVIEW. Using the tool "Basic Serial Write and Read Modified.vi" in this post: https://decibel.ni.com/content/message/69017.

But I was wondering if it's actually possible to control the Teensy's I²C or serial output? Or do i need to use a MAX232/MAX3232 with USB? on other RX/TX ports on Teensy?
So far, I used the NI USB-DAQ 6008, but this tool doesn't have I²C/Serial out. I can use digital I/O's and analog I/O's.

What I actually want is to control a digital potentiometer (AD5282 for example) by using teensy's I²C function. That's not the hard part. But I'm using LabVIEW for monitoring and signal processing. And want to use LabVIEW for controlling my Teensy.

Help is welcome :) Other posts about using labview was actually confusing me.
 
Like all software, it's best to start simple and build little-by-little on top of each success.

On the Teensy side, try something like this:

Code:
void setup() {
  pinMode(13, OUTPUT);
}
void loop() {
  if (Serial.available()) {
    byte b = Serial.read();
    if (b > 0) {
     digitalWrite(13, HIGH);
    } else {
     digitalWrite(13, LOW);
  }
}

When Teensy receives an non-zero byte, it'll turn on the LED.

Then get Labview to send 1 and 0, perhaps with 1 second delay between them. I can't help on the Labview side. In fact, I can't even view whatever is at that link you posted, since I don't have an account.

I know several people here use Labview. Maybe they'll notice this thread? Or you might search and see if you can find previous conversations. There was recently a conversation about Labview where I fixed a bug involving the serial break signal (an obscure feature you don't need, but apparently some other widely used Labview VI uses it).
 
Yep. I jumped from LIFA (ni.com/arduino) to LINX (labviewhacker.com).

I've gotten Teensy's to compile the firmware ok, and they seem to communicate ok, but I need to get a little smarter in LabVIEW to figure out what I'm not doing correctly with the new device (teensy') typedefs. As it is, LINX says all the Teensy's are Arduino Uno's <sigh>, but the response back from the Teensy's is correct, so it's all in my additions for the Teensy 'drivers'.

I won't claim everything will work after fixing that <see also: peeling onions>, but it's encouraging. I've just run into real j*b things I had to take care of first. Hopefully I'll be getting back to figuring out why my typedefs break and get it a little further down the road.

Having to learn how to get Github working with LabVIEW has been an adventure too!

Mark
 
Status
Not open for further replies.
Back
Top