Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to write a driver for custom hardware on a digital port

Hi,
I am a complete newbie to LabView and so I hope that someone can hint me to the information I need.
At the moment, I am completely lost.

I have the CVS-1454 which has a digital I/O port.
Now I want to plug a custom made converter on this port to convert the digital port into 4 RS232 ports.

The hardware is not the problem, but how do I write a driver for my box?

Is there some kind of tutorial on writing drivers available?

All I found in the official documentation was that you can write your own drivers, but the link to the page which should give more information was invalid 😞

Thank you for reading and have a nice day,
FReAK
0 Kudos
Message 1 of 7
(3,692 Views)
The tutorials and help on creating drivers is for LabVIEW Instrument Drivers. There are several links here on what an instrument driver is and how to develop one. I don't think that's what you're looking for though. Is the intent to make the digital I/O appear to the system as regular com ports (i.e. com1, com2) and emulating all of the functions such as baud rate, handshaking, etc.? Or are you looking to embed some software in your custom converter?
Message 2 of 7
(3,692 Views)
Thank you for the link, I will have a good look on the pages there even if I think I have searched them already. But maybe I have missed something.

The intent is to have a stupid piece of hardware and to put all the timing logic etc. in the driver.

At the end the digital I/O (with the converter) should appear to the system as regular com ports.
0 Kudos
Message 3 of 7
(3,692 Views)
Frankly, what you're attempting to do may be beyond the capability of both LabVIEW and the digital I/O. At the very least, it's going to take quite a bit of work. On the transmit side, you're going to have break down characters into binary and then transmit them at a pretty precise rate. I'm not familiar with the CVS-1454 but a lot of digital I/O on NI devices is not hardware timed. Using software timing is going to be risky. You have the same issue on the receive end - just in reverse. I think that if I was forced to convert some digital I/O to serial, I'd try to use commerical parallel to serial converters. The digital I/O is similar to a parallel port and the converters handle all of the conversion, timing, and handshaking for you.
0 Kudos
Message 4 of 7
(3,692 Views)
Oh me ugh, stupid ... 🙂

sure we have some parallel to serial converters on that board.

For using the board I "just" have to set the output of the digital i/o to high or low. Some outputs need constant values and some have to use some timing to signal sending or receiving to the board (we have UARTS connected to the parallel/serial converters and these need timed inputs).

So actually I need some information on how to write a driver which realizes these timings for my UARTS.

Another question is if I can use the ISO outputs of the dio port as TTL outputs, or if I have to add a converter to my board. (we need more TTL outputs than the dio offers :-()
0 Kudos
Message 5 of 7
(3,692 Views)
Now you're getting into some issues that I'm really not too sure about. Apparently the CVS-1454 has a real-time OS so that with LabVIEW RT, you can download to the CVS-1454 and expect some deterministic timing. With some details on the timing requirements, you might want to post to the LabVIEW Real-Time forum.
0 Kudos
Message 6 of 7
(3,692 Views)
I will try the RT forum when I have to deal with the timing issues, for the moment I am still looking for a good tutorial on writing drivers (or a good example of a selfwritten driver). So if you know any other source than the link you have posted earlier, I would really appreciate it.
0 Kudos
Message 7 of 7
(3,692 Views)