LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA read from single digital line

Hi, 

I'm currently trying to connect a Decagon 5TM soil moisture sensor to a NI PCI-6225 card.

The sensor has three wires: GND, power, and data. Data can be send via a DDI serial protocol at a 1200 baud rate, see http://manuals.decagon.com/Integration%20Guides/5TM%20Integrators%20Guide.pdf (page 10). When the sensor is powered, it sends 1 start bit, 8 data bits and 1 stop bit. Afterwards the sensor can be powered off, which increases its life time.

I would like to power the sensor via a digital line of the NI PCI-6225 card and then read in the data via a second, single digital line of the same card. 

Since data is send in a serial fashion, I thought it would be possible to aquire the data using the 'VISA configure serial port' and the 'VISA read' function. However, 'VISA configure serial port' expects a COM port as input and not a single digital line.

Does anybody have an idea how I could circumvent this problem or if there's another way to read the data? In the end I'd like to read data from 12 sensors of that kind, which should be accomplished using the 24 digital channels the NI card offers.

Any help would be appreciated...

Kind regards

 

Sepplovich

0 Kudos
Message 1 of 8
(3,444 Views)

There is a chip (or two) on a VISA device that "looks at" a digital line, times its transitions according to some protocol (e.g. RS-232, VISA), and "interprets" it as a Byte value.  It usually had inputs that lets you specify the clock speed (a.k.a. Baud Rate), how many "data" transitions + "support" transitions (sometimes called "Parity" and "Stop" bits) to expect, and can also buffer the data so you can get, say, 100 bytes terminated by a specified set of bits (sometimes called a "Termination Character").

 

You could "reinvent the Wheel" and choose to implement the VISA protocol using one or two digital lines, but this strikes me as a lot of work and not "cost-effective".  A colleague of mine showed me a device that spits out a digital stream that conforms to the VISA protocol, but at some insane Baud rate (something over a million, as I recall) that he feeds into another chip that "plays VISA" and returns a stream of u8 bytes.  I don't remember the cost of the chip, but I believe it was less than $20.

 

Bob Schor

 

P.S. -- I may have stated the chip behavior wrong.  It might have accepted the bit stream and turned it into a VISA signal, sent to the PC via a USB connection, and read with a simple VISA read.  In any case, a small amount of hardware was used to turn a one-bit Bit Stream into usable VISA, something that the Industry has been doing for at least 4 decades ...

0 Kudos
Message 2 of 8
(3,431 Views)

VISA is for serial ports, TCP/IP, GPIB communications.  You have a DAQ card so you need to use DAQmx to read from that cart.  Use continous timed digital reads to read the data.

 

The tricky part is you are going to need to write your own driver to detect the pattern of bits in the digital read and convert them to data.  It might be more work than you can handle.

 

I'd suggest looking at one of those DDI to serial converters they talk about in that document.

0 Kudos
Message 3 of 8
(3,425 Views)

Thanks Bob_Schor

0 Kudos
Message 4 of 8
(3,374 Views)

Hi Sepp,

 

The serial signals and protocols supported by the sensor require some type of interface hardware to be compatible with the serial port found on most personal computers (or USB-to-Serial adapters). There are several SDI-12 interface adapters available in the marketplace;

Found on page 4!

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 8
(3,370 Views)

Well, I've read the manual carefully: the sensor can communicate with 2 different protocols: DDI and SDI-12. After beeing powered, it sends data using the DDI protocol and only AFTERWARDS it switches to the SDI-12 protocol!

Using the DDI protocol has the advantage that I can switch on the sensor, read the data and turn it off afterwards. This has the advantage that it hasn't to be powered all the time, increasing its lifetime. A SDI-12 to USB converter costs more than 100€ which I would like to save, having bought already a quite expensive NI card. Moreover, even the manufacturer of the sensor recommends at some point on its homepage not to use the SDI-12 protocol if you want to have reliably read data from the sensor...

0 Kudos
Message 6 of 8
(3,362 Views)

I am about to implement the same Decagon sensors - any chance you would share your code and hardware specs? 

 

Thanks a bunch

DN

0 Kudos
Message 7 of 8
(1,571 Views)

Hello,

in the end I've used an Arduino Nano as an interface. In the meanwhile there's a SDI-12 library in the official Arduino libraries repository.

The trick is to power the sensors only shortly one after the other, so you can use the same standard sensor address when querying data.

If I remember correctly, I used the digital lines of the NI card to power the sensors. The current output of the NI card I was using was sufficient for that.

Hope this helps

 

0 Kudos
Message 8 of 8
(1,525 Views)