[?]: Связь WinCC по RS232

Панели оператора PP/OP/TP/TD/MP.
Программные пакеты ProTool/WinCC flexible, SCADA система WinCC
Post Reply
KVadim
Posts: 1
Joined: Tue Jan 17, 2006 1:02 pm

[?]: Связь WinCC по RS232

Post by KVadim » Tue Jan 17, 2006 1:07 pm

У нас есть устройство принтер - маркиратор Matthews. Цифровой вход только один RS232. Связываюсь с ним через Hyperterminal. Все отлично.
Пробую в WinCC :?: так:
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.OpenTextFile("com2",2,True)
MyFile.Write "4444"
MyFile.Close

Не получается.
- Какие есть варианты отправки текста по RS232 через WinCC ?

PLC_ITA

Please post in english

Post by PLC_ITA » Thu Jan 19, 2006 10:58 am

I can help you, but i don't know russian language.
Bye

alexmaemur
Posts: 8
Joined: Sun Oct 10, 2010 6:27 pm

Re: Связь WinCC по RS232

Post by alexmaemur » Sun Oct 10, 2010 7:17 pm

Добавил свой вопрос в эту тему т.к он по сути тот же.

Стоит задача управлять внешним устройством из WinCC, как это лучше сделать не используя контроллеры сименс?
По сути хотелось бы используя алгоритм в PLCSIM заставить работать это устройство.
Первая мысль это управление через COM или LPT.
Кто может подсказать где рыть инфу на этот счет?

How WinCC can operate and control equipment by COM or LPT port,
How algoritm from PLCSIM can operate and control equipment, without PLC Siemens (I have PC only)?

ppp
Posts: 268
Joined: Thu Feb 09, 2006 6:52 am
Location: Russia

Re: Связь WinCC по RS232

Post by ppp » Mon Oct 11, 2010 5:34 am

Для связи по COM-порту давно используем библиотеку от http://www.marshallsoft.com.

Зачем изобретать велосипед? Все уже давно написано за нас.
Как использовать библиотеку.

В Visual C
__________
в заголовке:
#include "wsc.h"
#pragma comment(lib,"wsc32.lib")
файлы wsc.h, wsc32.dll, wsc32.lib должны быть в каталоге с проектом

все
теперь можно использовать функции непосредственно в теле программы:
There are 32 functions in the WSC library.
SioBaud Sets the baud rate of the selected port.
SioBrkSig Asserts, cancels, or detects BREAK signal.
SioCTS Reads the Clear to Send (CTS) modem status bit.
SioDCD Reads the Data Carrier Detect (DCD) modem status.
SioDebug Set and/or reads debug data.
SioDone Terminates further serial processing.
SioDSR Reads the Data Set Ready (DSR) modem status bit.
SioDTR Set, clear, or read the Data Terminal Ready (DTR).
SioEvent Wait for specified event.
SioFlow Enables / disables hardware flow control.
SioGetc Reads the next character from the serial line.
SioGets Receives a string of characters.
SioInfo Returns information such as library version.
SioKeycode Passes the "key code" value to the DLL.
SioMessage Post message when event occurs.
SioParms Sets parity, stop bits, and word length.
SioPutc Transmit a character over a serial line.
SioPuts Transmits a string of characters.
SioRead Reads any UART register.
SioReset Initialize a serial port for processing.
SioRI Reads the Ring Indicator (RI) modem status bit.
SioRTS Sets, clears, or reads the Request to Send (RTS)
SioRxClear Clears the receive buffer.
SioRxQue Returns the number of characters in the RX queue.
SioStatus Returns the serial port line status.
SioTimer Returns the system times in milliseconds.
SioTxClear Clears the transmit buffer.
SioTxQue Returns the number of characters in the TX queue.
SioUnGetc "Ungets" (puts back) a specified character.
SioWinError Returns Win32 error message as text.
SioGetReg Gets registration string
SioSetInteger Sets port specific integer parameters.

в WinCC
_______

1. Скопируем файл wsc32.dll в папку \Siemens\WinCC\bin
2. Скопируем файл wsc.h в папку с проектом \library
3. В скриптах нужна шапка:
#pragma code ("wsc32.dll")
#include "wsc.h"
#pragma code()
4. клиент вебнавигатора
\siemens\wincc\webnavigator\common\scripting\wsc.h

Остальное разжевано в документации от производителя.

Если покупать dll жаба душит, то вот непоследняя вылеченная версия:
http://depositfiles.com/files/5k9lumzj7

alexmaemur
Posts: 8
Joined: Sun Oct 10, 2010 6:27 pm

Re: [?]: Связь WinCC по RS232

Post by alexmaemur » Wed Nov 14, 2012 5:52 pm

Спасибо за подсказку, возвращаюсь к этой теме и вспомнил, что когда то задавал этот вопрос :shock:

Post Reply