Автор |
Сообщение |
Сообщение создано: 02. 02. 2011 [22:17]
|
gustavo
Gustavo Duarte
Создатель темы
Зарегистрирован(а) с: 02.02.2011
Сообщения: 10
|
Hi all,
We need use Serial Interface to get and send data from and to external device. The server in which openScada is running doesn't has serial port, only usb. For this reason we have to use a usb to rs-232 converter.
Before try with OpenScada, we tested the converter writing and reading to and from /dev/ttyUSB0 device, using a shell script and loop tx and rx pin. And all work fine.
However when we try to configure Serial Interface using GUI OpenSacada, first we set Address: /dev/ttyUSB0:2400:8N1:s and then when we do click for activate, the GUI become as darkness and freeze until we disconnect the converter from USB port.
Somebody know if OpenScada support serial interface with usb-rs-232 converter ?
Thanks in advance.
|
Сообщение создано: 03. 02. 2011 [09:24]
|
roman
Roman Savochenko
Moderator Contributor Developer
Зарегистрирован(а) с: 12.12.2007
Сообщения: 3750
|
"gustavo" wrote:
Somebody know if OpenScada support serial interface with usb-rs-232 converter ?
Possible you have like that problem http://oscada.org/ru/forum/posts/otslezhivanie_oshibok/ne_mogu_prisoedinit_ovenovskii_preobrazovatel_ac4_usb .
And equal for that, I have not any USB->RS-232(485) device for test and I have not any like problem for any other USB->GSM devices.
For like that specifical problems you can:
- Take sources of work version from SVN, add trace messages, build and detect where serial port init command is wrong for that device.
- Or take technical support here: http://oscada.org/en/services/technical-support
Learn, learn and learn better than work, work and work.
|
Сообщение создано: 03. 02. 2011 [21:32]
|
gustavo
Gustavo Duarte
Создатель темы
Зарегистрирован(а) с: 02.02.2011
Сообщения: 10
|
Thanks Roman,
We will try downloading sources and add debug messages.
We let to know results.
Regards.
|
Сообщение создано: 04. 02. 2011 [10:13]
|
roman
Roman Savochenko
Moderator Contributor Developer
Зарегистрирован(а) с: 12.12.2007
Сообщения: 3750
|
"gustavo" wrote:
We will try downloading sources and add debug messages.
We let to know results.
The problem like for that: http://mhonarc.axis.se/dev-etrax/msg07432.html.
And I am some updated Serial transport for port init made using previous properties and allow for miss any port properties set. Last SVN-snapshot already have the changes.
Learn, learn and learn better than work, work and work.
|
Сообщение создано: 05. 02. 2011 [13:44]
|
gustavo
Gustavo Duarte
Создатель темы
Зарегистрирован(а) с: 02.02.2011
Сообщения: 10
|
"roman" wrote:
"gustavo" wrote:
We will try downloading sources and add debug messages.
We let to know results.
The problem like for that: http://mhonarc.axis.se/dev-etrax/msg07432.html.
And I am some updated Serial transport for port init made using previous properties and allow for miss any port properties set. Last SVN-snapshot already have the changes.
Thanks Roman, I could see your updated in "Checked out revision 1256". I will compile again and try and then will let to know results.
Regards.
|
Сообщение создано: 07. 02. 2011 [15:05]
|
gustavo
Gustavo Duarte
Создатель темы
Зарегистрирован(а) с: 02.02.2011
Сообщения: 10
|
"gustavo" wrote:
"roman" wrote:
"gustavo" wrote:
We will try downloading sources and add debug messages.
We let to know results.
The problem like for that: http://mhonarc.axis.se/dev-etrax/msg07432.html.
And I am some updated Serial transport for port init made using previous properties and allow for miss any port properties set. Last SVN-snapshot already have the changes.
Thanks Roman, I could see your updated in "Checked out revision 1256". I will compile again and try and then will let to know results.
Regards.
After compile last SVN-snapshot version, I made attemp again, and the result was the same.
When I do click to run in serial port configuration screen, openscada became freeze until usb-rs232 converter is disconnected.
What is your suggestion ? Analyze serial port message trace ? There are some way to enable message traces or debug mode ? Or we have to add "printf' s" in mod_serial.cpp ?
Thanks in advance.
Gustavo.
|
Сообщение создано: 07. 02. 2011 [15:49]
|
roman
Roman Savochenko
Moderator Contributor Developer
Зарегистрирован(а) с: 12.12.2007
Сообщения: 3750
|
"gustavo" wrote:
What is your suggestion ? Analyze serial port message trace ? There are some way to enable message traces or debug mode ? Or we have to add "printf' s" in mod_serial.cpp ?
Place printf() to the function "void TTrOut::start( )" of the file OpenSCADA/src/moduls/transport/Serial/mod_serial.cpp. And see to where hang is.
Learn, learn and learn better than work, work and work.
|
Сообщение создано: 08. 02. 2011 [19:51]
|
gustavo
Gustavo Duarte
Создатель темы
Зарегистрирован(а) с: 02.02.2011
Сообщения: 10
|
"roman" wrote:
"gustavo" wrote:
What is your suggestion ? Analyze serial port message trace ? There are some way to enable message traces or debug mode ? Or we have to add "printf' s" in mod_serial.cpp ?
Place printf() to the function "void TTrOut::start( )" of the file OpenSCADA/src/moduls/transport/Serial/mod_serial.cpp. And see to where hang is.
I added several printf() at different places of TTtOut::start() and I can see application hang when
fd = open(mDevPort.c_str(), O_RDWR|O_NOCTTY); function is called.
I tried adding O_NONBLOCK flag to open and work fine, oscada did not hang.
However I think that the problem is that driver of usb-serial converter is not work properly.
Because, I was the following test:
1) Start, server.
2) Try run port serial and oscada hung.
3) Add O_NONBLOCK flag, try again run port serial and work fine.
4) Remove O_NONBLOCK flag, and try run port serial and also work fine.
As you could see this is very strange, I can find out an explication, only that the usb-serial coverter driver is not working properly.
Thanks.
|
Сообщение создано: 08. 02. 2011 [19:58]
|
gustavo
Gustavo Duarte
Создатель темы
Зарегистрирован(а) с: 02.02.2011
Сообщения: 10
|
"gustavo" wrote:
"roman" wrote:
"gustavo" wrote:
What is your suggestion ? Analyze serial port message trace ? There are some way to enable message traces or debug mode ? Or we have to add "printf' s" in mod_serial.cpp ?
Place printf() to the function "void TTrOut::start( )" of the file OpenSCADA/src/moduls/transport/Serial/mod_serial.cpp. And see to where hang is.
I added several printf() at different places of TTtOut::start() and I can see application hang when
fd = open(mDevPort.c_str(), O_RDWR|O_NOCTTY); function is called.
I tried adding O_NONBLOCK flag to open and work fine, oscada did not hang.
However I think that the problem is that driver of usb-serial converter is not work properly.
Because, I was the following test:
1) Start, server.
2) Try run port serial and oscada hung.
3) Add O_NONBLOCK flag, try again run port serial and work fine.
4) Remove O_NONBLOCK flag, and try run port serial and also work fine.
As you could see this is very strange, I can find out an explication, only that the usb-serial coverter driver is not working properly.
Thanks.
I think that I was not clear enough in my last post. My opinion is that the problem is in usb-serial converter. Openscada work fine.
Thanks and sorry.
|
Сообщение создано: 09. 02. 2011 [10:19]
|
roman
Roman Savochenko
Moderator Contributor Developer
Зарегистрирован(а) с: 12.12.2007
Сообщения: 3750
|
"gustavo" wrote:
I think that I was not clear enough in my last post. My opinion is that the problem is in usb-serial converter. Openscada work fine.
OK. I will place O_NONBLOCK to function open() and you please test for permanent work it.
Learn, learn and learn better than work, work and work.
|