RS232 communication without VISA
-
Eugen Graf
- guru
- Сообщения: 6502
- Зарегистрирован: 13 ноя 2007, 02:20
- Награды: 4
- Версия LabVIEW: 2009
- Откуда: Saarbrücken
- Контактная информация:
RS232 communication without VISA
Hello everybody! I made a little interesting example how to communicate over RS232 without VISA library:
Download here
Download here
-
- interested
- Сообщения: 2
- Зарегистрирован: 28 сен 2008, 13:50
- Версия LabVIEW: 8.5
- Контактная информация:
-
Eugen Graf
- guru
- Сообщения: 6502
- Зарегистрирован: 13 ноя 2007, 02:20
- Награды: 4
- Версия LabVIEW: 2009
- Откуда: Saarbrücken
- Контактная информация:
Re: RS232 communication without VISA
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
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
-
- interested
- Сообщения: 3
- Зарегистрирован: 03 дек 2008, 11:03
- Версия LabVIEW: 8.0
- Контактная информация:
Re: RS232 communication without VISA
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.
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
- guru
- Сообщения: 6502
- Зарегистрирован: 13 ноя 2007, 02:20
- Награды: 4
- Версия LabVIEW: 2009
- Откуда: Saarbrücken
- Контактная информация:
Re: RS232 communication without VISA
Hello. I think you have to write and read in a while loop. Try this one
-
- interested
- Сообщения: 3
- Зарегистрирован: 03 дек 2008, 11:03
- Версия LabVIEW: 8.0
- Контактная информация:
Re: RS232 communication without VISA
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
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
- guru
- Сообщения: 6502
- Зарегистрирован: 13 ноя 2007, 02:20
- Награды: 4
- Версия LabVIEW: 2009
- Откуда: Saarbrücken
- Контактная информация:
Re: RS232 communication without VISA
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: P.S. you can upload your screenshots directly to our forum. No external ressource is needed.
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: P.S. you can upload your screenshots directly to our forum. No external ressource is needed.
-
- interested
- Сообщения: 3
- Зарегистрирован: 03 дек 2008, 11:03
- Версия LabVIEW: 8.0
- Контактная информация:
Re: RS232 communication without VISA
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.
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
- guru
- Сообщения: 6502
- Зарегистрирован: 13 ноя 2007, 02:20
- Награды: 4
- Версия LabVIEW: 2009
- Откуда: Saarbrücken
- Контактная информация:
Re: RS232 communication without VISA
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.
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
- expert
- Сообщения: 1439
- Зарегистрирован: 17 июл 2008, 12:20
- Награды: 2
- Версия LabVIEW: 2010
- Откуда: Moscow
- Поблагодарили: 1 раз
- Контактная информация:
Re: RS232 communication without VISA
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().
.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().
-
- interested
- Сообщения: 1
- Зарегистрирован: 25 фев 2009, 13:16
- Версия LabVIEW: 8.5
- Контактная информация:
Re: RS232 communication without VISA
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!
-
- interested
- Сообщения: 1
- Зарегистрирован: 02 ноя 2013, 01:54
- Версия LabVIEW: 2013
- Контактная информация:
Re: RS232 communication without VISA
How did you select 'SerialPort' from your Constructor Node exactly?
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
- 2 Ответы
- 662 Просмотры
-
Последнее сообщение Borjomy_1
-
- 4 Ответы
- 242 Просмотры
-
Последнее сообщение Embedder74