LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Проблема с чтением ASCII команды через COM PORT по RS-232

Привет, не так давно начал работать с com портом при помощи библиотеки rs232.h. Требуется отправить команду на com порт для устройства...Идёт запись команды (ComWrt), а чтения не происходит(ComRd), вылетает ошибка, якобы в буфере, хотя на мой взгляд должно быть всё правильно. У кого были подобные проблемы?

Download All
0 Kudos
Message 1 of 5
(2,009 Views)

Hello,

according to Google translate your problem relates to the communication over RS232 channel but I can not see enough details in the images you posted to understand the situation.

 

Where are you getting the error and which one? I suggest you to trap the return code from each RS232 function that can help you in discriminating the cause: if negative, passing the error code to GetRS232ErrorString () can help. The error code and the exact instruction where you get it are crucial elements to understand what's going on.

 

As a last hint, you are not using any termination character: does your target device have some requirement about that? 

 

 

Finally, if you can post in English in the future it will be easier for us to understand your messages.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 5
(1,958 Views)

Привет, весли вас не затруднит не могли бы прислать самый простой пример записи и чтения сообщения в COM порт? (самый банальный Hello вполне подошёл бы) , желательно без UIR панелей, просто в консоли. Хочу кое что для себя проверить. Заранее спасибо.

 

 

Hi, if it doesn't bother you , could you send the simplest example of writing and reading a message to the COM port (the most banal Hello would be quite suitable), preferably without UIR panels, just in the console. I want to check something for myself. Thank you in advance.

 

 

0 Kudos
Message 3 of 5
(1,948 Views)

There are examples in LabWindows CVI that you can look at in order to see how it’s supposed to work. Our “simplest” examples we could send you could not co a better job here.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 4 of 5
(1,943 Views)

In addition to Rolf reply, I can point you to the handy and useful function CVI offers to locate the examples installed on disk: if you select Help >> Find Examples... menu function a search application will start where you can locate the examples searching by argument or keyword or simply browsing into a list. All those listed there are fully working examples that you can study to understand how they work.

 

In case of serial communications the following examples are available:

Screenshot 2021-07-09 14.37.21.png

double-clicking on one of them will open the example project into CVI.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 5 of 5
(1,934 Views)