Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial communication with VSI-Class 2 (vehicle serial interface)

Hi! I'm trying to communicate with a device call VSI-Class 2 (vehicle serial interface, Dearborn Group)with labview. This device doesn´t have drivers. I must create them but I don't know where to start. I have an example in C++, where they used winsock2 to stablish a communication (see the attach file).Someone told me to use VISA to communicate, but I'm not sure if that will work. Someone can help me. Thanks!
0 Kudos
Message 1 of 3
(3,453 Views)
Hi,

WinSock2 is the Windows implementation of the TCP/IP sockets. Apparently, from the document you attached, you can also bind a serial port to a socket. I've never seen this. Does the device have a serial or ethernet port?

VISA has the ability to communicate using both serial and raw socket connection. You just need to know what packets or messages to send. This information doesn't seem to be included in the document.

From the document you attached it seems that the instrument does require a driver that allows you to use the socket API to communicate to it. Check the following article on the Microsoft site:

Windows Sockets 2 as a WOSA Component

I think your best bet is to contact the instrument manufacturer and ask if you need any drivers. If not ask if you can use the serial port directly to communicate with the device and what messages you need to send.

If you need some drive to use the socket API, you can still use it LabVIEW using the library function call node. This node allows you to call dll functions directly. You could use this to call the Winsocket functions directly. This implies some work, but it is not difficult to do.

Hope this helps.

DiegoF
National Instruments.
Message 2 of 3
(3,453 Views)
Hi DiegoF,

Thanks for your help. The device (VSI) has a serial port, and the messages that I need to send are in another document that I already have. Also I already contact the manufacturer and ask them about the drivers. They told me that you can't use the serial port directly to communicate. If you want to stablish a lower level RS232 communication you will need to create a driver or function, but if you only want to do communication of the Class2 bus and aren't concerned with the specific operations of the VSI then they have a winsock2 socket that you can use that takes care of all the RS232 communication of the VSI.The last option is my case, I only need to communicate over the class2 bus.

So I need to use the library function call node, right?
I could call some function but when I arrived to the bind one, I couldn't call it, I'm doing something wrong at the parameters, because the bind function has a structure as a parameter so I don't know how to stablish it. Can you help me with that?
The bind prototype is
int bind (SOCKET s, const struct sockaddr *name,int namelen);
and the structure is
struct sockaddr {
u_short sa_family;
char sa_data[14];
};

Thank you very much!

Catalina
0 Kudos
Message 3 of 3
(3,453 Views)