NetLab · Rules · Torrent Tracker · Have a problem? · Eng/Rus | Help Search Members Gallery Calendar |
Welcome Guest ( Log In | Register | Validation ) | Resend Validation Email |
вопрос программистам (Visual Basic), управление через RS 232 (COM) |
|
Posted: 10-11-2003, 00:18
(post 1, #189923)
|
||
Unregistered |
в этом деле я новис, поэтому приму любую помощь. задача - управление приборами через RS232 (COM) приложением на Visual Basicе. Раньше на нем никогда не прогал, а сделать нужно в ближайшие сроки. Как решить эту задачу на basic, pascal, c++ знаю... вобщем необходимо выполнять примитивные функции: 1. Активировать СОМ с необходимыми параметрами. 2. Отправлять команду 3. Считывать ответ в файл. все. заранее спасибо! |
||
|
|
Posted: 10-11-2003, 00:34
(post 2, #189929)
|
||
Главный Колобок Group: Global Moders Posts: 7618 |
Используй контроль MScomm (клик правой кнопкой мыши на General слева, выбрать Components -> Microsoft Comm Control). |
||
|
Posted: 10-11-2003, 00:52
(post 3, #189936)
|
||
Unregistered |
Sidorini спасибо! а где можно достать примеры кодов не подскажешь? а то без поллитра так не разобраться... |
||
|
|
Posted: 10-11-2003, 01:19
(post 4, #189953)
|
||||
Главный Колобок Group: Global Moders Posts: 7618 |
Просто объяви поиск на MScomm. А пока маленький пример :
Так мы открываем порт с установками: Baud Rate - 9600 No Parity 8 data bits 1 stop bit |
||||
|
Posted: 10-11-2003, 01:27
(post 5, #189957)
|
||
Unregistered |
еще раз спасибо, уже там роюсь. наберусь наглости и спрошу, а чтобы вывести данные во внешний файл (текстовый или АSCII data) что поискать? |
||
|
|
Posted: 10-11-2003, 01:44
(post 6, #189963)
|
||
Главный Колобок Group: Global Moders Posts: 7618 |
Open pathname For mode [Access access] [lock] As [#]filenumber [Len=reclength] The Open statement syntax has these parts: pathname - Required. String expression that specifies a file name — may include directory or folder, and drive. mode - Required. Keyword specifying the file mode: Append, Binary, Input, Output, or Random. If unspecified, the file is opened for Random access. access - Optional. Keyword specifying the operations permitted on the open file: Read, Write, or Read Write. lock - Optional. Keyword specifying the operations restricted on the open file by other processes: Shared, Lock Read, Lock Write, and Lock Read Write. filenumber - Required. A valid file number in the range 1 to 511, inclusive. Use the FreeFile function to obtain the next available file number. reclength - Optional. Number less than or equal to 32,767 (bytes). For files opened for random access, this value is the record length. For sequential files, this value is the number of characters buffered. MSDN © Пример:
|
||
|
Posted: 10-11-2003, 03:56
(post 7, #189992)
|
||
Unregistered |
Sidorini, о похоже на квикбейсик очень признателен, спасибо за помощь!!! |
||
|
|
Posted: 11-11-2003, 06:05
(post 8, #190252)
|
||
Главный Колобок Group: Global Moders Posts: 7618 |
dad - Не за что |
||
|
Posted: 12-11-2003, 01:10
(post 9, #190543)
|
||
Unregistered |
Sidorini уже разобрался, все пашет, все пучком сенкс! |
||
|