Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Triggering Digital Data Read from Incoming Data

I am working my first project in labview and have little experience with this subject. I am needing to talk to a piece of equipment through a serial communication line. I am using a PXI 1045 chassis with the NI 6534 Digital I/O board installed. What I need to do is to be able to send this piece of equipment a control word, and then receive back a status from the equipment. I have the send portion figured out but I am having problems with the timing of the receive. The incoming data would consist of a start bit, X data bits, a parity bit and a stop bit. I would like to be able to set up my input so that it waits to receive the start bit, records the data and the parity bit and then stops the read and prepares to send another control word. I have not found any questions on this post that address this type of question or any examples that help but if you know of any that may be of assistance please guide me to them. Thanks in advance for any help.

Josh
0 Kudos
Message 1 of 3
(2,940 Views)
Solved: I believe that I have solved this issue. I was able to use a pattern match start trigger to match the start bit transition. I can then read a specific number of bits after the start with a clock set to the appropriate sample rate. I have not completely tested this method yet but I think it should work. If anyone sees any pitfalls with this or knows of a better way I am open to suggestions.

Thanks
0 Kudos
Message 2 of 3
(2,923 Views)
Hi Josh858,
 
Digital Pattern Matching might be the way to go for this type of application. Although this would work, if you are expecting multiple serial data transfers, you may need to set your device to retriggerable. However, because re-triggering is not available on the 653x family, here are two possible options to get around this limitation.
 
Option 1: Configure a digital input task, to wait for a pattern to trigger and performs a finite acquisition. You then close the task and reconfigure the hardware to wait waits for the next pattern. (This is the easiest modification to your code)

Option 2: Use a Continuous Digital Input task with a external sample clock source. A counter will be used as a retriggerable finite sample clock. The Digital Input task will then receive a finite number of sample clock edges, when these expire then the Counter re-arms. To do this, you can refer to these two shipping examples found in your LabVIEW Example Finder.

Hardware Input/Output»DAQmx»Generating Digital Pulses» Generate Digital Pulse Train-Finite-Retriggerable.VI

Hardware Input/Output»DAQmx»Digital Measurements» Cont Read Dig Chan-Ext Clk.VI

I hope this helps,

S_Hong

S_Hong
National Instruments
Applications Engineer
0 Kudos
Message 3 of 3
(2,907 Views)