LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

References for writing a driver for an rs232 device?

I wrote a standalone app for a device and many customers are asking for
LabVIEW interaction.

I assume this means I have to write a driver of some sort. The NI site
looks impressive, but the volume of material is absolutely overwhelming ans
I have not figured out exactly what I need to do.

Can someone point me to some reference material for what I need?

I want to isolate the user from having to encode communications to the
device and from parsing the results.

Thanks
Tim


0 Kudos
Message 1 of 9
(3,134 Views)
Is your device a VISA or IVI compliant device such as a DMM or a power supply? If yes look at the Instrument driver Network for instrcutions how to do it. If not i attached the help for a device wihch dosn't fall into that category and I wrote a driver for it. This will give you a startup information how the programmer interface can be implemented.
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 2 of 9
(3,130 Views)

If you using a recent version of LabVIEW there is a instrument driver project wizard, which I think saves a lot of time and creates a standardized driver library that users should be familiar with.

 

 You can use NI VISA for RS232 communication and modify any of the VIs created from the wizard. See "Instrument Driver Modification Instructions" in the LabVIEW help.

_______________________________________
Systems Test Engineer
Certified LabVIEW Architect (CLA)
0 Kudos
Message 3 of 9
(3,125 Views)
Tim wrote:
> I wrote a standalone app for a device and many customers are asking for
> LabVIEW interaction.
> I assume this means I have to write a driver of some sort. The NI site
> looks impressive, but the volume of material is absolutely overwhelming ans
> I have not figured out exactly what I need to do.
> Can someone point me to some reference material for what I need?
> I want to isolate the user from having to encode communications to the
> device and from parsing the results.
> Thanks Tim


You have a couple of options. To name a few: Port your interface to an existing standard already supported by NI, like GPIB or VISA. Or just provide a DLL and document the API and let the Labview user use the Labview DLL interface.

http://zone.ni.com/devzone/cda/tut/p/id/4049
http://www.ni.com/support/visa/default.htm
http://www.ni.com/support/visa/vintro.pdf

http://ftp.icpdas.com/pub/cd/iocard/pci/napdos/pci/manual/calling_dll_functions_in_labview.pdf
http://www.fz-juelich.de/zel/datapool/page/160/WritingDLL_LabView.pdf
0 Kudos
Message 4 of 9
(3,106 Views)
Freelance Embedded Systems Engineer <g9u5dd43@yahoo.com> wrote in
news:4901fb06$0$17038$9a6e19ea@unlimited.newshosting.com:

> You have a couple of options. To name a few: Port your interface to
> an existing standard already supported by NI, like GPIB or VISA. Or
> just provide a DLL and document the API and let the Labview user use
> the Labview DLL interface.
>


Is there something particularly wrong with just writing a vi with the
appropriate serial port stuff in it? It's no less supported than GPIB!

--
Scott
Reverse name to reply
0 Kudos
Message 5 of 9
(3,096 Views)
Scott Seidman wrote:
> Freelance Embedded Systems Engineer <g9u5dd43@yahoo.com> wrote in
> news:4901fb06$0$17038$9a6e19ea@unlimited.newshosting.com:
>> You have a couple of options. To name a few: Port your interface to
>> an existing standard already supported by NI, like GPIB or VISA. Or
>> just provide a DLL and document the API and let the Labview user use
>> the Labview DLL interface.

> Is there something particularly wrong with just writing a vi with the
> appropriate serial port stuff in it? It's no less supported than GPIB!

From the original post:
>>> I want to isolate the user from having to encode communications to the
>>> device and from parsing the results.
0 Kudos
Message 6 of 9
(3,085 Views)

From the original post:
>>> I want to isolate the user from having to encode communications to the
>>> device and from parsing the results.

You can do all the programming in LabVIEW and still have this request as well.  It is called subVI's.Smiley Wink

 

You would do all the encoding and parsing in lower level subVI's.  Use higher level subVI's that act as a wrapper for calling the lower level subVI's.  It would expose a list of commands (reset, get value, set value, .... whatever makes sense for the device) in an Enum.  The user would drop the upper level subVI in his program can select the appropriate command from the Enum that he wants to do.  The subVI would call all the appropriate lower level subVI's for encoding and parsing as needed.

 

The user is isolated from the low level stuff, and the programmer doesn't have to worry about dealing with .dll's, activeX or any other tricky programming to get the communication to work.  If the original poster wrote the original app, he can probably figure out how to rewrite all of in LabVIEW.

0 Kudos
Message 7 of 9
(3,070 Views)
Freelance Embedded Systems Engineer <g9u5dd43@yahoo.com> wrote in
news:4903263e$0$4903$9a6e19ea@unlimited.newshosting.com:

>
> From the original post:
>>>> I want to isolate the user from having to encode communications to
>>>> the device and from parsing the results.

Isolating the user hardly means that it shouldn't be done in a vi-- just
that the user shouldn't know what's being done in the vi.


--
Scott
Reverse name to reply
0 Kudos
Message 8 of 9
(3,056 Views)
Scott Seidman wrote:
> Freelance Embedded Systems Engineer <g9u5dd43@yahoo.com> wrote in
> news:4903263e$0$4903$9a6e19ea@unlimited.newshosting.com:
>
>> From the original post:
>>>>> I want to isolate the user from having to encode communications to
>>>>> the device and from parsing the results.
>
> Isolating the user hardly means that it shouldn't be done in a vi-- just
> that the user shouldn't know what's being done in the vi.

Sure, I agree, if he was coding in Labview then he could provide his own VI that handles all of the encoding. But I got the impression that the original poster doesn't have and doesn't use Labview and was looking for a means to provide an interface so that Labview users could use the serial device that he supports.


0 Kudos
Message 9 of 9
(3,038 Views)