LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Communicate with PSoC. What should my connection between LabVIEW and PSoC be?

Hello, 

I'm currently set to work on are project where the basic is that 3 LEDs are blinking with a PWM. The LabVIEW code are handed over to me and now I have to adjust from generating the PWM signal form LabVIEW to controlling the LEDs from PSoC-4 with an LED driver TLC59711.  I'm not familiar with PSoC and I'm supposed to get my PSoC-kit and the driver later to day. I do not have any clue of how I should connecting the PSoC code + driver to my LabVIEW. Should I use the NI-VISA, and how does this work. I'm sorry for the lack of detailed information but I'm still not sure what I should do, but hopefully it will come to my along the way. But let me now if you need other information and I'll try to collect them.   

Could anyone give me some start advice? 

 

The code I think I need to replace is digital part in the upper left corner of my snippet. 

Snippet_mainVI.png

0 Kudos
Message 1 of 9
(5,962 Views)

Shouldn't you be reading the PSoC documentation and manuals?

0 Kudos
Message 2 of 9
(5,927 Views)

A colleague of mine who directs the BME Senior Design class came to me with a chip that had lots of "smarts" (like your PSoC-4) and communicated via a Serial Port.  He was using it for A/D conversion, but it's the same idea.  He had a nifty $20 USB-to-Serial cable that he wired to the Serial Port of his microcontroller, plugged the USB into his PC, MAX found it, and we set up VISA communication with his device.

 

Once he had that, it just came down to knowing (as he put it) the "bit-banging properties" of his chip.  As I recall, once you gave it the byte sequence that said "Sample", the bytes came flying out and had to be unscrambled and re-assembled to make 2 channels of 24-bit signed quantities, but LabVIEW is good at that.  He's now adding in the Data Logging steps ...

 

I suspect that your code is doing much the same thing.  I can't see the sub-VIs (such as Generate PWMs V3.5), but these might be "Tell the Chip to do such-and-such", and might be where the significant code is located.  It does look like something is acting as a DAQmx device (the Analog Input Channel goes to "Analog input setup V2.0") -- could it be that you actually have LabVIEW Drivers for this microcontroller?  [That would really make things simple ...].

 

Bob Schor

Message 3 of 9
(5,918 Views)

Hi Bob, thanks for your reply!

 

He had a nifty $20 USB-to-Serial cable that he wired to the Serial Port of his microcontroller, plugged the USB into his PC, MAX found it, and we set up VISA communication with his device.
I did kind of the same thing but i'm uncertain which devices where on the computer before. I think these 3 are new ones. I suspect that the LPT1 could be my PSoC-4 device? 

Devices.PNG

I look for good examples where people where connecting PSoC's and LabVIEW, have you eventually seen something? 

 

"bit-banging properties"

I'm not yet certain of these properties but I hope to find out 🙂 

 

Generate PWMs V3.5

Yes, the "Generate PWM's V3.5" tells my LEDs to blink in a certain pattern. This part is still going to be a part of the system, but is programmed onto the LED driver TLC59711, that one of my colleagues is doing (some C code). So I dont know if that is what you mean by the "LabVIEW Drivers for this microcontroller"? Otherwise I downloaded the VISA driver, but agian not certain if that at all was nesseceray.. 

And again thank you so much for your replies. It is most appreciate and impresive all that work you and others put into these forum! 

Best Regards
A.

0 Kudos
Message 4 of 9
(5,886 Views)

LPT1 stands as parallel port. Since you used USB-to-RS232, you should look for a "COM" port in the device list...

Message 5 of 9
(5,876 Views)

Okay, I do have the COM1 port? 

My cable between computer and PSoC-4 is a USB-to-Mini-B? 

0 Kudos
Message 6 of 9
(5,865 Views)

Are we talking about a laptop? If your laptop does not have a physical serial port, then I guess the COM1 port belongs to your USB-serial interface (I guess you already installed the drivers for your USB-serial cable?).

 

My cable between computer and PSoC-4 is a USB-to-Mini-B? 

Do you ask us about this? We cannot see your configuration... See what I wrote above, if you need to use serial interface, I guess you need a driver for this cable. Do you have a driver for this cable? Or do you have a driver for the PSoC device alternatively?

 

If you have a manual for your hardware, you could go into MAX, and test the communication via the "VISA Test Panel". Maybe there are some basic device query commands...?

0 Kudos
Message 7 of 9
(5,850 Views)

My colleague definitely connected to COM1 using the VISA driver.  You can "play with" your device by opening MAX, clicking on COM1, and using VISA to set baud/bit settings (N-8-1 is probably what you need).  See what your device wants at a "Get Status" or "Identify Me" command, send it, see if you can read its responses ...

 

If you can do it in MAX, you can do it in LabVIEW.  MAX at least allows you to "play" interactively, see what the device spits back when you say "Send me some data".  Once you know, write code accordingly.

 

Bob Schor

Message 8 of 9
(5,838 Views)

Okay, I'll keep working on it.

 

Thanks for now!

0 Kudos
Message 9 of 9
(5,810 Views)