Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial connection via DAQ card

Hello!
I control a device with LabVIEW 7.0 Express and NI PCI-6110 DAQ card, 2 digital lines configured as output, 2 digital lines as input.
I would like to use one of the digital inputs to realize something like a serial connection with which I can read serial data from the device.

Is this possible with LabVIEW and without using the serial port (RS232) or any other additional input?

The device sends out 4 byte in the format:
300 baud, 1 start bit, 8 data bit, 1 stop bit, no parity.
The "start condition" is a rising edge on one digital line while the other has high state.

Has anyone a suggestion how this could be done?

Thank you so far,

Espelkamper
Message 1 of 4
(3,681 Views)
Hello Espelcamper,

theoretically, this is possible. The only problem is that the digital lines of your board can not be timed in hardware. That is why you would have to poll them in a loop and implement all of the serial protocol in software what, of course, costs a lot of performance which you on the other hand need for your analog input operations.

I would suggest using a board with serial ports or a multifunction board that has hardware tiomed DIO lines (eg. the M-Series boards)
Ingo Schumacher
Systems Engineering Manager CEERNational Instruments Germany
Message 2 of 4
(3,665 Views)
Thank you Ingo,

I have tried the method with the loop before.
But I just got an array containing "1"s.
So I think the reading starts after the transmission is already finished.
It seems that in my case LabVIEW is too slow for such an approach:
the line should be read every 3,33ms minimum and certain (300baud).
I have to send a signal (high) to the device first (on another line).
Then the transmission starts immediately.

Then I tried a buffered digital read without success.
Here the reading should be done over quite a long time (several seconds I think should be enough) and in parallel was a sequence containing the switching.
But when it came to read the data an error message occured meaning the driver is too old or the DAQ-card (PCI-6110) has not the necessary functionality.

Then I exchanged the digital with a buffered analog read construct.
And this seems to work.
The result is an array with a lot of "1"s at the beginning and at the end with some kind of bits in between.
At the moment the bits make no sense obviously but I am working on that.

The question is if the whole thing can be done without using two ports for the same input signal (1 digital and 1 analog).
Since this is just the experimental stadium I am open for (almost) everything, even PXI, SCXI.

In mean case I want to measure the duration of some digital output signals (independent).
The signals can last from several seconds to several minutes so I think a resolution of 0,1s should be fine enough.
This should be done in parallel.

There are, let's say, 12 or 32 lines which should be measured in parallel.
Half of them (6 or 16) may contain serial data, but only in a special condition.
The serial reading on one of these lines should be done in parallel with the measurement on the rest of the lines.
If possible the serial reading should work on all 6 lines independently.

At the moment I see the alternatives of using a digital and an analog port for the same signal on a PCI-6110 which is already available, or
try to use an M-series card as proposed.
Does anyone see another good way?

Thank you,

Espelkamper
0 Kudos
Message 3 of 4
(3,650 Views)
I forgot to mention this solution:
Of course I could use the standard RS232 serial port on the PC.
But then I had to use a multiplexer for 6 digital lines.
And there would be still two cables for one signal and it would be much too simple 😉 , too.

Espelkamper
0 Kudos
Message 4 of 4
(3,647 Views)