LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial TTL signal generation to control motor driver via DAQ

Hello,

 

With LabVIEW, I'm trying to communicate to a stepper motor driver that reads TTL Serial protocol. The driver that I am using has preinstalled commands decoded from of a TTL signal (fake example: HALT is command int178 == 0b10110010 and TTL signal is high/low square signal representing 0b10110010 + parity and other odds and ends) and I need to be able to generate this TTL signal based on an integer input. I will probably write a Python script connected to a Python node to manage the command input, but the actual translation, generation, and transmittance of a TTL signal I am clueless on. I think I will use DAQmx to transmit to a digital output pin. 

The hardware is a PCIe-6343 card with a DAQ and I plan to use 1 digital output pin (with 5V and GND pin) to transmit TTL signal to the motor controller.

I apologize I am not well versed in LabVIEW or the graphical language; but I have spent several days reading forums/help and asking around with no luck so I have resorted to posting a question. 

If anyone has any guidance on how to generate these TTL signals it would be much appreciated!

Thanks

0 Kudos
Message 1 of 10
(3,310 Views)

@maeosu wrote:

Hello,

 

(fake example: HALT is command int178 == 0b10110010 and TTL signal is high/low square signal representing 0b10110010 + parity and other odds and ends)

Other odds and ends like Start and Stop bits, parity. Basically a serial data protocol

Why not just use a USB serial to TTL converter?

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 10
(3,297 Views)

Hello,

Thanks for your reply.

We could as a last resort, but we are trying to fully utilize our DAQ/PCIe-card for all of our I/O peripherals of our system and not the computer. 

0 Kudos
Message 3 of 10
(3,288 Views)

I guess it's time versus money

 

You can spend time figuring out how to bit bang the serial protocol out one pin of a DIO port...

 

Or for about $40 you could buy an adapter and be communicating with your device using VISA like any other device on a serial port...

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 10
(3,245 Views)

Money is not an issue with this project, but time is - so if you are telling me that there is no LabVIEW block/tool to convert integer --> TTL signal and that I'd have to build it all from scratch, then that is useful information to me!

Building our system off the DAQ is of high preference for this project, but if it's not practical...it's not practical.

I spent a fair amount of time digging around in the VISA toolbox, only to find it'll only talk to a port, which wasn't useful until now. 

Thanks 

0 Kudos
Message 5 of 10
(3,241 Views)

If you have the PCIe slots available, I would go with something like a Startech PEX2S953LP (2 serial ports) and then a IC232TTL to adapt to your TTL device.  I am not a fan of USB, so I would prefer having the dedicated card for this.  Then it is just simple writing to the port using VISA.

 

EDIT: Since this is a NI site, I should probably also link to their options.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 10
(3,187 Views)

Thank you for your feedback and links! We may have another slot, I will have to check.

May I ask why you are not a fan of USB?

0 Kudos
Message 7 of 10
(3,114 Views)

I'd guess PCIe falls out less often 😉


GCentral
0 Kudos
Message 8 of 10
(3,050 Views)

If you are not careful, Windows has a "power saving feature" where it will just turn off your USB hubs.  This has caused issues.  Also, if you plug into a different port, it may show up as a different COM port, causing issues with your application.  Back in the day, it seemed like only 1/2 of the USB-RS232 adapters would work.  Those issues seem to have alleviated over the years, but I still have a bad taste in my mouth.  I have never had an issue using a PCI(e) or PXI(e) RS-232 card.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 10
(3,040 Views)

@crossrulz wrote:

  I have never had an issue using a PCI(e) or PXI(e) RS-232 card.


I used to say that until I had a number of StarTech PCIE serial port cards just stop working. Honestly I nave never  figured it out but the ports would just "disappear" no error or anything, just no longer exist. This happened in multiple computers in the lab but never happened to some and they are still in use today.

 

But since Windows7 FTDI USB to Serial  adapters have been rock solid and Windows remembers their UUID so they always get the same Com port when plugged in.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 10 of 10
(3,027 Views)