LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I use this Dll to send and rec. from the RS232 port

This DLL talks with and is control of the rs232 port . I would like to send a command with the DLL to the port and recive a respones. The respons is Voltage levels in string from. Expample a "%" sent to the instrument we return a Unit ID.
INTERFACE char* (WINAPI DYNAMIC KeyCmd)( char const* cmd, char* rsp, int maxrsp);
INTERFACE void (WINAPI DYNAMIC DoCmd)(char const*cmd, char *rsp, int maxrsp);
0 Kudos
Message 1 of 6
(3,462 Views)
I don't think you can do this directly from LabVIEW. The declaration
you gave looks like it's for a function POINTER not a regular
function. You will probably need to create a wrapper DLL around this
DLL so that you can have an actual function to call from LabVIEW.

If the communications is serial and you know the protocol, why not
skip the DLL altogether and try to control directly from LabVIEW?

Douglas De Clue
ddeclue@bellsouth.net


louX2 wrote in message news:<506500000008000000C3550000-1027480788000@exchange.ni.com>...
> This DLL talks with and is control of the rs232 port . I would like to
> send a command with the DLL to the port and recive a respones. The
> respons is Voltage levels in string from. Expample a "%" sent to the
> instrume
nt we return a Unit ID.
> INTERFACE char* (WINAPI DYNAMIC KeyCmd)( char const* cmd, char* rsp,
> int maxrsp);
> INTERFACE void (WINAPI DYNAMIC DoCmd)(char const*cmd, char *rsp, int
> maxrsp);
0 Kudos
Message 2 of 6
(3,462 Views)
It probably would be easier to use LabVIEW VIs to control the serial port since all you are really doing is reading and writing. I would suggest using the VISA VIs. They are much easier to work with. This link will take you to the NI-VISA homepage. I would suggest using this resource and the example VIs that come with LabVIEW. It will probably make your attempts much easier.
J.R. Allen
0 Kudos
Message 3 of 6
(3,462 Views)
I would love to use VISA, but the insturment driver takes over the port, so the only way to get info from this insturment is to link in. DLL
0 Kudos
Message 4 of 6
(3,462 Views)
"I would love to use VISA, but the insturment driver takes over the port, so the only way to get info from this insturment is to link in. DLL"
0 Kudos
Message 5 of 6
(3,462 Views)
You can always disable the driver.

Douglas De Clue
ddeclue@bellsouth.net


louX2 wrote in message news:<506500000005000000B7930000-1027480788000@exchange.ni.com>...
> I would love to use VISA, but the insturment driver takes over the
> port, so the only way to get info from this insturment is to link in.
> DLL
0 Kudos
Message 6 of 6
(3,462 Views)