COM порт
Добавлено: Вт апр 02, 2013 6:28 pm
Добрый день!
Помогите пожалуйста написать скрипт для считывания с ком порта данных.
Архитектура такая:
Com 1 на нем весит контроллер ICP DAS I7017. если выдается команда #61 возвращается значение по каналу 1.
2.4 #AAN
Description : Read Analog Input from channel N
Syntax : #AAN[CIIK](cr)
# delimiter character
AA address of reading module (00 to FF)
N channel to read, from 0 to 7
Response : Valid Command : >(Data)|CHK](cr)
Invalid Command : ?AA[CHK](cr)
Syntax error or communication error may get no
response.
> delimiter for valid command
? delimiter for invalid command
AA address of response module (00 to FF)
(Data) analog input value, reference Sec. 1.10 for its format
Example :
Command : #032 Receive : >+02.513
Read address 03 channel 2, get data successfully.
Command : #029 Receive : ?02
Read address 02 channel 9, return error channel number.
Related Command :
Sec.2.1 %AANNTTCCFF, Sec.2.7 SAA2
Related Topics :
Sec. 1.10 Configuration Tables
Note : The command for 1-7017/17F only
В идеале хотелось что бы считывалось со всех 8 входов и присваивалось значение к примеру переменным IN1-IN8. Которые можно было бы использовать далее.
СПАСИБО!
Помогите пожалуйста написать скрипт для считывания с ком порта данных.
Архитектура такая:
Com 1 на нем весит контроллер ICP DAS I7017. если выдается команда #61 возвращается значение по каналу 1.
2.4 #AAN
Description : Read Analog Input from channel N
Syntax : #AAN[CIIK](cr)
# delimiter character
AA address of reading module (00 to FF)
N channel to read, from 0 to 7
Response : Valid Command : >(Data)|CHK](cr)
Invalid Command : ?AA[CHK](cr)
Syntax error or communication error may get no
response.
> delimiter for valid command
? delimiter for invalid command
AA address of response module (00 to FF)
(Data) analog input value, reference Sec. 1.10 for its format
Example :
Command : #032 Receive : >+02.513
Read address 03 channel 2, get data successfully.
Command : #029 Receive : ?02
Read address 02 channel 9, return error channel number.
Related Command :
Sec.2.1 %AANNTTCCFF, Sec.2.7 SAA2
Related Topics :
Sec. 1.10 Configuration Tables
Note : The command for 1-7017/17F only
В идеале хотелось что бы считывалось со всех 8 входов и присваивалось значение к примеру переменным IN1-IN8. Которые можно было бы использовать далее.
СПАСИБО!