RS232 communication without VISA

VISA; TCP/IP, CAN and similar protocols
Ответить
Аватара пользователя
Eugen Graf

Activity Professionalism Silver Black
guru
guru
Сообщения: 6502
Зарегистрирован: 13 ноя 2007, 02:20
Награды: 4
Версия LabVIEW: 2009
Откуда: Saarbrücken
Контактная информация:

RS232 communication without VISA

Сообщение Eugen Graf »

Hello everybody! I made a little interesting example how to communicate over RS232 without VISA library:
Изображение

Download here
Asheesh.JMI
interested
interested
Сообщения: 2
Зарегистрирован: 28 сен 2008, 13:50
Версия LabVIEW: 8.5
Контактная информация:

Re: RS232 communication without VISA

Сообщение Asheesh.JMI »

:thank: ..
well done dude...
Аватара пользователя
Eugen Graf

Activity Professionalism Silver Black
guru
guru
Сообщения: 6502
Зарегистрирован: 13 ноя 2007, 02:20
Награды: 4
Версия LabVIEW: 2009
Откуда: Saarbrücken
Контактная информация:

Re: RS232 communication without VISA

Сообщение Eugen Graf »

Did you try this?

It has some advantages vs. VISA:

VISA has a very large installation data. If a user installs a easy application for serial communication, he should wait about 15 minutes, many files will be copied, many regisry entries will be made. MAX will be installed and so on. Why to do that if the application is very easy?

If you try to get installed ports over VISA Find Ressource and some Bluetooth or Ethernet to Serial adapter is installed on our PC, so you will wait about 15-20 seconds. Here you will wait some milliseconds to get all installed ports.

.NET requiered for this example is installed on almost all windows PCs, so no extra libraries are needed. If .NET is not installed, you can download it from WWW and install free.

A disadvantage is the not supporting of crossplatforming. You can't run this example on Linux or Mac OS.

But anyways this is a great possibility to work with serial interface without VISA library :super:
actt
interested
interested
Сообщения: 3
Зарегистрирован: 03 дек 2008, 11:03
Версия LabVIEW: 8.0
Контактная информация:

Re: RS232 communication without VISA

Сообщение actt »

Hi, Eg,
Your idea is extremely elegant.
I’ve tried it, works properly. I use Intel Celeron 1.4 G, converter USB>RS-232, FT232R by FTDI. Baud rate and COM port number I enter manually.
I use PIC processor – there are two counters, two 3-byte registers. The connection with the PC is cable – RX, TX and Ground. When I transmit the letter A from PC, the PIC sends 3 bytes to the PC-current value of the counter A, starting with the junior byte. When I send the letter B the PIC sends 3 bytes – the condition of counter B. When the PC sends another letter, the PIC hasn’t got any reaction.I manage to receive particular bytes.
My purpose is to read the condition of the two counters 100 times/s and saving them into separate columns in EXCEL file. Metod of reading exists v INVOKE NODE, where the bytes are read, and as result you got the decimal value. For a pity I’m not too experienced and everything I make slowly and I’ll be so thankful to you for any idea.
Аватара пользователя
Eugen Graf

Activity Professionalism Silver Black
guru
guru
Сообщения: 6502
Зарегистрирован: 13 ноя 2007, 02:20
Награды: 4
Версия LabVIEW: 2009
Откуда: Saarbrücken
Контактная информация:

Re: RS232 communication without VISA

Сообщение Eugen Graf »

Hello. I think you have to write and read in a while loop. Try this one
Вложения
ReadCounters.png
actt
interested
interested
Сообщения: 3
Зарегистрирован: 03 дек 2008, 11:03
Версия LabVIEW: 8.0
Контактная информация:

Re: RS232 communication without VISA

Сообщение actt »

Hi, Eg,
Thank you for your idea, however I couldn't write properties in Read Node. I'm sending my creation until I've reached -pic2.
I can't determine the arrowed detail-pic1. Also I'm unable to find Help for Methods and Properties for Invoke Node. Is it possible these properties to be different between the version 8.0 and 8.6?
If you have any possibility, please, help me.

http://www.estimakm.com/images//pic1.jpg
http://www.estimakm.com/images//pic2.jpg
Аватара пользователя
Eugen Graf

Activity Professionalism Silver Black
guru
guru
Сообщения: 6502
Зарегистрирован: 13 ноя 2007, 02:20
Награды: 4
Версия LabVIEW: 2009
Откуда: Saarbrücken
Контактная информация:

Re: RS232 communication without VISA

Сообщение Eugen Graf »

You need the Array in the Pict1 to allocate a buffer (piece of memory). Than the Read Function will write data from serial buffer to this allocated buffer.

To Pict2. I really don't know why you have no output from the Read Function. May be it's the version of .NET installed on your PC.

Try the VI I attached:
SerialNET.vi
LV 8.0
(15.79 КБ) 1892 скачивания
P.S. you can upload your screenshots directly to our forum. No external ressource is needed.
actt
interested
interested
Сообщения: 3
Зарегистрирован: 03 дек 2008, 11:03
Версия LabVIEW: 8.0
Контактная информация:

Re: RS232 communication without VISA

Сообщение actt »

Hi, Eg,
I was unable to activate your READ NODE. Version 8.0 determine it immediately as an error. I’ve made it simple with array for the three bytes, afterthat I estimate the value of the counter A.
I’ve read also, that the NI recommended that not to use .NET in stand-alone VI. I’d like to use .NET VI on separate machine only with RUN TIME.What do you think – is it useful?

http://www.estimakm.com/images//pic1.jpg
http://www.estimakm.com/images//pic2.jpg

P.S. I'm sorry, I couldn't understand how to upload images directly in the forum.
Аватара пользователя
Eugen Graf

Activity Professionalism Silver Black
guru
guru
Сообщения: 6502
Зарегистрирован: 13 ноя 2007, 02:20
Награды: 4
Версия LabVIEW: 2009
Откуда: Saarbrücken
Контактная информация:

Re: RS232 communication without VISA

Сообщение Eugen Graf »

Of course you can use .NET, but don't forget to install this on the target machine. You can put the installer of the .NET into your application installer (you need it because of LV RunTime).

To your VI, I think you need a Type Cast between Byte Array and Numeric Indicator.

Klick on the Full-Answer-Button on the left bottom of the page, so you will be able to attach your pictures into the forum.
Аватара пользователя
Konstantin Sumenko

Activity Bronze
expert
expert
Сообщения: 1439
Зарегистрирован: 17 июл 2008, 12:20
Награды: 2
Версия LabVIEW: 2010
Откуда: Moscow
Поблагодарили: 1 раз
Контактная информация:

Re: RS232 communication without VISA

Сообщение Konstantin Sumenko »

NI recommends not to use .NET connectivity at stand alone VI's only due to .NET framework different versions availability (cause there is simple assemblies catch mechanism in LabVIEW).
.NET is a powerfull addition to LabVIEW, with it you can make things that LabVIEW directly can't (for example detection of USB device insertion).
Also you can find interesting read/write methods in System.IO like ReadExisting() and ReadLine().
pjotr
interested
interested
Сообщения: 1
Зарегистрирован: 25 фев 2009, 13:16
Версия LabVIEW: 8.5
Контактная информация:

Re: RS232 communication without VISA

Сообщение pjotr »

This is a great addition to my LabVIEW applications, where I have struggled for years with all kinds of serial interfacing solutions that were either too big in codesize, too complex to work easily with, too unreliable on target machines or too dependent on device drivers or libraries that needed to be installed under admin accounts. Thanks a lot!
Newton2this
interested
interested
Сообщения: 1
Зарегистрирован: 02 ноя 2013, 01:54
Версия LabVIEW: 2013
Контактная информация:

Re: RS232 communication without VISA

Сообщение Newton2this »

How did you select 'SerialPort' from your Constructor Node exactly?
Аватара пользователя
dadreamer

Activity Professionalism Автор
professor
professor
Сообщения: 3926
Зарегистрирован: 17 фев 2013, 16:33
Награды: 4
Версия LabVIEW: 2.5 — 2022
Благодарил (а): 11 раз
Поблагодарили: 126 раз
Контактная информация:

Re: RS232 communication without VISA

Сообщение dadreamer »

Newton2this
Вложения
Без имени-2.jpg
Ответить
  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «Communcation with devices»