LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Port Control via VB DLL

Hi All,

I am writting an interface from LabView for the PC to a custom PIC
17C756A board that I designed. I had tested the board using VB with the

MSCOMM32 control, and everything worked fine. Later I was told that
Labview was going to be used as the language of choice, and it turns out

the Labview serial driver can't be used. So I intended to write a VB
DLL server between the PIC and Labview. I started with a simple DLL to
verify the passing of arguments between the two programs. This works
fine. When I integrated MSCOMM into the VB DLL, Labview reports the
object can't be found. I suspect that the MSCOMM32 control isn't being
seen when the DLL is invoked in Labview.

Has anyone tried to use MSCOMM in a DLL, and
gotten it to work. It
should be able to be done, unfortunately I am not a VB expert nor
Labview, just the embedded designer now tasked (drafted) with this
effort. Any suggestins would be extremely helpful.


I suppose I may just go to C, and use the the win32 API for the serial
port if worse comes to worse.

TIA

-Scott Boskovich
0 Kudos
Message 1 of 5
(3,722 Views)
Why can't the LabVIEW serial driver be used? The port couldn't be
configured properly?

"Scott Boskovich" wrote in message
news:3B1E6DC0.10535911@yahoo.com...
> Hi All,
>
> I am writting an interface from LabView for the PC to a custom PIC
> 17C756A board that I designed. I had tested the board using VB with the
>
> MSCOMM32 control, and everything worked fine. Later I was told that
> Labview was going to be used as the language of choice, and it turns out
>
> the Labview serial driver can't be used. So I intended to write a VB
> DLL server between the PIC and Labview. I started with a simple DLL to
> verify the passing of arguments between the two programs. This works
> fine. When I integrated MSCOMM into the VB DLL, Labview reports the
> objec
t can't be found. I suspect that the MSCOMM32 control isn't being
> seen when the DLL is invoked in Labview.
>
> Has anyone tried to use MSCOMM in a DLL, and gotten it to work. It
> should be able to be done, unfortunately I am not a VB expert nor
> Labview, just the embedded designer now tasked (drafted) with this
> effort. Any suggestins would be extremely helpful.
>
>
> I suppose I may just go to C, and use the the win32 API for the serial
> port if worse comes to worse.
>
> TIA
>
> -Scott Boskovich
>
0 Kudos
Message 2 of 5
(3,722 Views)
Initially I did use the LV driver, (using LV5) but it insists on appending a
char on the end of it, as well as not negiating the buffers well.
Since VB gives more control and flexability of the port, as demonstrated in
the MSCOMM test with the .exe file, it also seemed at the time to be a better
solution. Now, I am beginning to reconsider that... 😉

-Scott

D D wrote:

> Why can't the LabVIEW serial driver be used? The port couldn't be
> configured properly?
>
> "Scott Boskovich" wrote in message
> news:3B1E6DC0.10535911@yahoo.com...
> > Hi All,
> >
> > I am writting an interface from LabView for the PC to a custom PIC
> > 17C756A board that I designed. I had tested the board using VB with the
> >
> > MSCOMM32 control, and eve
rything worked fine. Later I was told that
> > Labview was going to be used as the language of choice, and it turns out
> >
> > the Labview serial driver can't be used. So I intended to write a VB
> > DLL server between the PIC and Labview. I started with a simple DLL to
> > verify the passing of arguments between the two programs. This works
> > fine. When I integrated MSCOMM into the VB DLL, Labview reports the
> > object can't be found. I suspect that the MSCOMM32 control isn't being
> > seen when the DLL is invoked in Labview.
> >
> > Has anyone tried to use MSCOMM in a DLL, and gotten it to work. It
> > should be able to be done, unfortunately I am not a VB expert nor
> > Labview, just the embedded designer now tasked (drafted) with this
> > effort. Any suggestins would be extremely helpful.
> >
> >
> > I suppose I may just go to C, and use the the win32 API for the serial
> > port if worse comes to worse.
> >
> > TIA
> >
> > -Scott Boskovich
> >
0 Kudos
Message 3 of 5
(3,722 Views)
If you haven't done so already, try the VISA drivers to give you more
control of the serial port configuration. In Functions, select Instrument
I/O, VISA, Easy VISA Serial Write & Read.vi. This example vi can get you
started. There are more properties that can be added the property node.
Additionally, buffer size can be adjusted using VISA Set Serial Buffer Size,
under Functions/Instrument I-O/VISA/Interface Specific. One note of
caution, the version of Easy VISA Serial I have uses com 2 by default. The
resource name for com 1 is ASRL1::INSTR. Also, the termination character
enable is on by default. You can disable it on the block diagram.

The standard serial drivers are easier to use, but have a few limitations.
For example, there is no way to time-ou
t a write operation that is using
hardware flow control when the serial device isn't attached. In LabVIEW 6,
the VISA serial drivers are featured more prominently on the functions
pallete and the standard drivers are tucked away under "I/O Compatibility."

"Scott Boskovich" wrote in message
news:3B1E898C.86B2078F@yahoo.com...
> Initially I did use the LV driver, (using LV5) but it insists on appending
a
> char on the end of it, as well as not negiating the buffers well.
> Since VB gives more control and flexability of the port, as demonstrated
in
> the MSCOMM test with the .exe file, it also seemed at the time to be a
better
> solution. Now, I am beginning to reconsider that... 😉
>
0 Kudos
Message 4 of 5
(3,722 Views)
I'm only very new to labview and may well be talking crap, but can't you
insert the MSComm control into a block diagram as an ActiveX control and use
it as you do in VB? I'm only guessing......


D D
wrote in message
news:mhxT6.525$oY3.98248770@newssvr17.news.prodigy.com...
> If you haven't done so already, try the VISA drivers to give you more
> control of the serial port configuration. In Functions, select Instrument
> I/O, VISA, Easy VISA Serial Write & Read.vi. This example vi can get you
> started. There are more properties that can be added the property node.
> Additionally, buffer size can be adjusted using VISA Set Serial Buffer
Size,
> under Functions/Instrument I-O/VISA/Interface Specific. One note of
> caution, the
version of Easy VISA Serial I have uses com 2 by default.
The
> resource name for com 1 is ASRL1::INSTR. Also, the termination character
> enable is on by default. You can disable it on the block diagram.
>
> The standard serial drivers are easier to use, but have a few limitations.
> For example, there is no way to time-out a write operation that is using
> hardware flow control when the serial device isn't attached. In LabVIEW
6,
> the VISA serial drivers are featured more prominently on the functions
> pallete and the standard drivers are tucked away under "I/O
Compatibility."
>
> "Scott Boskovich" wrote in message
> news:3B1E898C.86B2078F@yahoo.com...
> > Initially I did use the LV driver, (using LV5) but it insists on
appending
> a
> > char on the end of it, as well as not negiating the buffers well.
> > Since VB gives more control and flexability of the port, as demonstrated
> in
> > the MSCOMM test with the .exe file, it also seemed at the time to be a

> better
> > solution. Now, I am beginning to reconsider that... 😉
> >
>
>
0 Kudos
Message 5 of 5
(3,722 Views)