03-11-2009 07:45 AM
Hello everybody!!
I would like to ask you about SDI-12 communication. I am trying to develop a Labview VI which could communicate with a sensor. The communication with this sensor must be using SDI-12 protocol.
I have found that there is an already developed Labview API for doing this (http://zone.ni.com/devzone/cda/tut/p/id/7726). For doing this they use a converter (from SDI-12 to RS-232) plus the RS-232 VISA. The converter used is the Waterlog H-4191, however, I have to used another (one of Vegetronix). Mine is exactly a SDI-12 to USB converter, but I don't know how it does this, the USB works like a virtual COM port.
The problem I have is using Hyperterminal, the communication works perfectely (I open the virtual COM5 port, I write the SDI-12 commands, and the sensor answers); however, if I try to use MAX or the LabVIEW SDI-12 API or even a LabVIEW RS-232 handler (I mean a VI which includes the RS-232 VISAs), I doesn't work. It is like if my PC sends the commands but nobody reads it.
Do you know what it is happening??
Thank you!!
Solved! Go to Solution.
03-11-2009 12:02 PM
Hello again!!
I have more delimited the problem. The main mistake I has making is not to write at the end of every command \r\n ( I only was using \n, and with the Hyperterminal this is completely transparent).
So, what I have done is used the serial basic reader/writer of the examples of the Labview
However, it doesn't work properly.The first command is correctely sent by the PC and answered by the SDI-12 device, but for the second one (and the following ones) I always received a Unrecoigned Command message. For solved this situation I have to open once again the Hyperterminal, send a new command (which is always answered by another Unrecoigned Command Message) and the following command sent by the Hyperterminal is properly answered (and the next ones).
I think that the behaviour is like the Serial(RS-232) Handler of the Labview leaves a kind of rubbish in the Serial Port that make the SDI-12 not to recognized the command. Do you have any idea how to clean it???
And another importan thing is that I am using is a virtual COM ( I mean, a USB port behaving as a COM), and I have found an example of a VI thought for : " For example, it can be useful in certain virtual port implementations when talking to USB plugged-in devices which show up as com ports and VISA isn't working." . So maybe that happens frecuently, VISA not working with virtual serial port???? (http://zone.ni.com/devzone/cda/epd/p/id/3719)
And the las problem is that this example doesn't work etheir!!!Any help????
03-12-2009 09:49 AM
Hello 1000a,
thank you for your post on our webforum. I'm not formiliar with the SDI-12 devices, but I noticed a knowledge base about a virtual COM port and VISA. Maybe the last part will be intersting for you. Please notice that a virtual COM isn't officially supported by VISA.
I also noticed a thread about SDI-12 and asynchrone / synchrone VISA. I hope this will help you forward.
Best regards,
03-12-2009 10:59 AM
Hello Martijn,
Thank you very much for your answern. The problem is solved out and there were involved two mistakes:
On the one hand, it is necessary to read and write in the synchronous way.
On the other hand, I was making areally silly mistake that I was making: as a terminal character I write \n\r and it was only neccesary \r!!
In the example that I was using and which is developped for COM port is used \r\n and as in the hyperterminal you just have to pressed Enter button, so you don't know what the machine is actually writing at the end!
Thank you very much,
1000a
06-21-2010 02:01 AM
Hello 1000a,
I also want to integrate te Vegetronix converter into LabView. Would you be so kind and provide me with the VI's that you use for communication with the device?
Best regards,
Christoph
07-28-2020 11:10 AM
Hey can you share your VI, it would be really helpful for me.