Подключение устройства ethernet labview
RavensFan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Email to a Friend
You will need to provide more information. What is the brand/model of your ethernet IP I/O?
Some possibilities would be a Modbus TCP/IP protocol, or an OPC server/client, or communicating with some sort of driver provided by the manufacturer of the device.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Email to a Friend
- Mark as New
- Bookmark
- Subscribe
- Mute
- Email to a Friend
- Mark as New
- Bookmark
- Subscribe
- Mute
- Email to a Friend
There are VI's and examples for how to use Modbus communication over serial ports and ethernet connections.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Email to a Friend
Unfortunately National Instruments does not have any hardware that natively communicates using the EtherNet IP protocol. You can easily implement applications in LabVIEW that use simple TCP/IP or UPD communication, but I do not know enough about the EtherNet IP protocol specification to know if these standard protocols will work. As you mentioned, LabVIEW can interface with an OPC server. If you have any hardware which uses this protocol that can access the OPC server tags, then this would be your best option.
How is this generally done even outside of LabVIEW? Namely, if I have just a PC without a PLC attached, how can I communicate using this protocol from another software interface? If there are PCI or USB devices available that can use this protocol, then you may be able to utilize them from LabVIEW. I hope this information is useful for you. Please post back if we can provide any additional assistance. Thanks,
Наверное лучше для ваших целей использовать вот этот интерфейс, так как:
а) Он для этого и предназначен
б) Это сделать намного проще
Перечень дальнейших действий таков:
Установите драйвера на девайс и GPIB адаптер, изучите мануал, найдите систему команд для прибора, посмотрите нет ли готовых примеров для LabVIEW на диске с драйверами (если есть - попробуйте с ними поработать), если нет то см. примеры на слово GPIB в Example Finder. Из примеров попытайтесь получить отклик на команды, если не получается - то из MAX попытайтесь получить отклик на команды.
A Ethernet на этом приборе скорее всего для объединения его с компьютером в локальную сеть, для доступа к носителю информации, а вовсе не для управления им по этому протоколу.
Вот как то так.
п.с. Кстати если вы занимаетесь исследованием проводных коммуникаций, то мы с вами в некотором роде коллеги. Могу посоветовать так же вот этот прибор, возможно он вас заинтересует.
Думаю что Indey прав и для управления он не предназначен. Последний раз редактировалось FireFly 02 мар 2010, 08:28, всего редактировалось 1 раз. Иногда лучше молчать и слыть идиотом, чем заговорить и развеять все сомнения. Indey писал(а): A Ethernet на этом приборе скорее всего для объединения его с компьютером в локальную сеть, для доступа к носителю информации, а вовсе не для управления им по этому протоколу.
Вот как то так. Как вариант можно купить преобразователь GPIB-LAN National Instruments ENET 100. Подключить прибор по GPIB к преобразователю, а команды уже посылать по локалке. В таком случае всё прекрасно находится в максе.
Наверное лучше для ваших целей использовать вот этот интерфейс, так как:
а) Он для этого и предназначен
б) Это сделать намного проще
Перечень дальнейших действий таков:
Установите драйвера на девайс и GPIB адаптер, изучите мануал, найдите систему команд для прибора, посмотрите нет ли готовых примеров для LabVIEW на диске с драйверами (если есть - попробуйте с ними поработать), если нет то см. примеры на слово GPIB в Example Finder. Из примеров попытайтесь получить отклик на команды, если не получается - то из MAX попытайтесь получить отклик на команды.
A Ethernet на этом приборе скорее всего для объединения его с компьютером в локальную сеть, для доступа к носителю информации, а вовсе не для управления им по этому протоколу.
Вот как то так.
п.с. Кстати если вы занимаетесь исследованием проводных коммуникаций, то мы с вами в некотором роде коллеги. Могу посоветовать так же вот этот прибор, возможно он вас заинтересует.
Internet Protocol (IP), User Datagram Protocol (UDP), and Transmission Control Protocol (TCP) are the basic tools for network communication. The name TCP/IP comes from two of the best-known protocols of the internet protocol suite, the Transmission Control Protocol and the Internet Protocol. With TCP/IP you can communicate over single networks or interconnected networks (Internet).
TCP/IP communication provides a simple user interface that conceals the complexities of ensuring reliable network communications. Refer to the Using LabVIEW with TCP/IP and UDP from LabVIEW Help for more information about how TCP/IP communication works.
Use the TCP/IP functions located on the Functions»Data Communication»Protocols»TCP palette for TCP communication in LabVIEW. As with DAQ, instrument, and File I/O communication, the process involves opening the connection, reading and writing the information, and closing the connection.
With most I/O communication, the processor is always the client that initiates a connection to the disk drive server, the external instrument server, or the DAQ board server. With TCP/IP connections, a computer can function either as the client or the server. The following block diagram represents a client application that initiates a connection to a remote server with TCP Open Connection. The server, or daemon, listens for remote connections and responds appropriately.
LabVIEW users can develop custom applications for TCP/IP communication. The programmer is responsible for developing both the client and the server.
Because anyone can initiate a connection to a server, you might want server access control. The following block diagram shows how the server uses the remote address output value of the TCP Listen VI to determine whether a remote client has permission to access the server.
Developing Communication Applications
1 = acquire data and confirm
2 = send data
3 = get status
4 = close connection
The following image* shows how the server receives these commands. Notice that the same basic TCP functions are included, but surrounding code allows for more complex connections and robust communication.
- A While Loop surrounds the rest of the VI. This allows the VI to handle multiple sequential connections without having to restart after each connection closes. The VI cannot handle multiple simultaneous connections.
- The outer Case structure determines whether a valid connection occurred.
- If a valid connection is not established, nothing happens.
- If a valid connection occurs, the VI enters a While Loop that reads one byte from the TCP/IP port. This byte holds commands 1 through 4 from the client.
- If the connection is valid but no command is received within the read timeout period, the default case of the inner Case structure sends a TRUE value to the continuation terminal of the inner While Loop to keep the connection active.
The following block diagram* shows the other four cases of the inner case statement. Each case handles a specific command that the server can send. Each case sends information to the continuation terminal, which determines whether to continue the loop. In particular, the Quit case always returns a value of FALSE. After leaving the loop, the server closes the connection with the client.
This type of server architecture allows you to develop flexible servers for the more complex network communication procedures. The protocols you develop might be more complex than the preceding example.
* Note that these images are from a previous version of LabVIEW. The colors of data wires and function icons may not match your version. The structure of the code is still applicable.
Internet Protocol (IP), User Datagram Protocol (UDP), and Transmission Control Protocol (TCP) are the basic tools for network communication. The name TCP/IP comes from two of the best-known protocols of the internet protocol suite, the Transmission Control Protocol and the Internet Protocol. With TCP/IP you can communicate over single networks or interconnected networks (Internet).
TCP/IP communication provides a simple user interface that conceals the complexities of ensuring reliable network communications. Refer to the Using LabVIEW with TCP/IP and UDP from LabVIEW Help for more information about how TCP/IP communication works.
Use the TCP/IP functions located on the Functions»Data Communication»Protocols»TCP palette for TCP communication in LabVIEW. As with DAQ, instrument, and File I/O communication, the process involves opening the connection, reading and writing the information, and closing the connection.
With most I/O communication, the processor is always the client that initiates a connection to the disk drive server, the external instrument server, or the DAQ board server. With TCP/IP connections, a computer can function either as the client or the server. The following block diagram represents a client application that initiates a connection to a remote server with TCP Open Connection. The server, or daemon, listens for remote connections and responds appropriately.
LabVIEW users can develop custom applications for TCP/IP communication. The programmer is responsible for developing both the client and the server.
Because anyone can initiate a connection to a server, you might want server access control. The following block diagram shows how the server uses the remote address output value of the TCP Listen VI to determine whether a remote client has permission to access the server.
Developing Communication Applications
1 = acquire data and confirm
2 = send data
3 = get status
4 = close connection
The following image* shows how the server receives these commands. Notice that the same basic TCP functions are included, but surrounding code allows for more complex connections and robust communication.
- A While Loop surrounds the rest of the VI. This allows the VI to handle multiple sequential connections without having to restart after each connection closes. The VI cannot handle multiple simultaneous connections.
- The outer Case structure determines whether a valid connection occurred.
- If a valid connection is not established, nothing happens.
- If a valid connection occurs, the VI enters a While Loop that reads one byte from the TCP/IP port. This byte holds commands 1 through 4 from the client.
- If the connection is valid but no command is received within the read timeout period, the default case of the inner Case structure sends a TRUE value to the continuation terminal of the inner While Loop to keep the connection active.
The following block diagram* shows the other four cases of the inner case statement. Each case handles a specific command that the server can send. Each case sends information to the continuation terminal, which determines whether to continue the loop. In particular, the Quit case always returns a value of FALSE. After leaving the loop, the server closes the connection with the client.
This type of server architecture allows you to develop flexible servers for the more complex network communication procedures. The protocols you develop might be more complex than the preceding example.
* Note that these images are from a previous version of LabVIEW. The colors of data wires and function icons may not match your version. The structure of the code is still applicable.
Читайте также: